From 8ec004cc0888b7472d384d9a5d26e5a9957251f1 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 13 Nov 2018 10:59:03 +0530 Subject: [PATCH 01/89] Import meson build files from an 3.22 Specifically, from 6dd6660c685d22e88af5ed4d0b5f1f22df0338de --- demos/gtk-demo/meson.build | 113 ++++ demos/icon-browser/meson.build | 22 + demos/meson.build | 3 + demos/widget-factory/meson.build | 20 + examples/application1/meson.build | 11 + examples/application10/meson.build | 23 + examples/application2/meson.build | 17 + examples/application3/meson.build | 17 + examples/application4/meson.build | 17 + examples/application5/meson.build | 21 + examples/application6/meson.build | 23 + examples/application7/meson.build | 23 + examples/application8/meson.build | 23 + examples/application9/meson.build | 23 + examples/bp/meson.build | 13 + examples/meson.build | 60 ++ gdk/meson.build | 382 ++++++++++++ gdk/wayland/meson.build | 115 ++++ gtk/a11y/meson.build | 57 ++ gtk/deprecated/meson.build | 42 ++ gtk/inspector/meson.build | 31 + gtk/meson.build | 905 +++++++++++++++++++++++++++++ meson.build | 266 +++++++++ meson_options.txt | 3 + tests/meson.build | 212 +++++++ tests/visuals/meson.build | 6 + testsuite/css/meson.build | 6 + testsuite/css/nodes/meson.build | 3 + testsuite/css/parser/meson.build | 3 + testsuite/css/style/meson.build | 14 + testsuite/gdk/meson.build | 24 + testsuite/gtk/meson.build | 150 +++++ testsuite/meson.build | 3 + 33 files changed, 2651 insertions(+) create mode 100644 demos/gtk-demo/meson.build create mode 100644 demos/icon-browser/meson.build create mode 100644 demos/meson.build create mode 100644 demos/widget-factory/meson.build create mode 100644 examples/application1/meson.build create mode 100644 examples/application10/meson.build create mode 100644 examples/application2/meson.build create mode 100644 examples/application3/meson.build create mode 100644 examples/application4/meson.build create mode 100644 examples/application5/meson.build create mode 100644 examples/application6/meson.build create mode 100644 examples/application7/meson.build create mode 100644 examples/application8/meson.build create mode 100644 examples/application9/meson.build create mode 100644 examples/bp/meson.build create mode 100644 examples/meson.build create mode 100644 gdk/meson.build create mode 100644 gdk/wayland/meson.build create mode 100644 gtk/a11y/meson.build create mode 100644 gtk/deprecated/meson.build create mode 100644 gtk/inspector/meson.build create mode 100644 gtk/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 tests/meson.build create mode 100644 tests/visuals/meson.build create mode 100644 testsuite/css/meson.build create mode 100644 testsuite/css/nodes/meson.build create mode 100644 testsuite/css/parser/meson.build create mode 100644 testsuite/css/style/meson.build create mode 100644 testsuite/gdk/meson.build create mode 100644 testsuite/gtk/meson.build create mode 100644 testsuite/meson.build diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build new file mode 100644 index 0000000000..ee44a8530f --- /dev/null +++ b/demos/gtk-demo/meson.build @@ -0,0 +1,113 @@ + +## These should be in the order you want them to appear in the +## demo app, which means alphabetized by demo title, not filename +demos = files([ + 'application_demo.c', + 'assistant.c', + 'builder.c', + 'button_box.c', + 'changedisplay.c', + 'clipboard.c', + 'colorsel.c', + 'combobox.c', + 'css_accordion.c', + 'css_basics.c', + 'css_blendmodes.c', + 'css_multiplebgs.c', + 'css_pixbufs.c', + 'css_shadows.c', + 'cursors.c', + 'dialog.c', + 'drawingarea.c', + 'editable_cells.c', + 'entry_buffer.c', + 'entry_completion.c', + 'event_axes.c', + 'expander.c', + 'filtermodel.c', + 'foreigndrawing.c', + 'gestures.c', + 'glarea.c', + 'headerbar.c', + 'hypertext.c', + 'iconview.c', + 'iconview_edit.c', + 'images.c', + 'infobar.c', + 'links.c', + 'listbox.c', + 'flowbox.c', + 'list_store.c', + 'markup.c', + 'menus.c', + 'modelbutton.c', + 'offscreen_window.c', + 'offscreen_window2.c', + 'overlay.c', + 'overlay2.c', + 'panes.c', + 'pickers.c', + 'pixbufs.c', + 'popover.c', + 'printing.c', + 'revealer.c', + 'rotated_text.c', + 'scale.c', + 'search_entry.c', + 'search_entry2.c', + 'shortcuts.c', + 'sidebar.c', + 'sizegroup.c', + 'spinbutton.c', + 'spinner.c', + 'stack.c', + 'textmask.c', + 'textview.c', + 'textscroll.c', + 'theming_style_classes.c', + 'toolpalette.c', + 'transparent.c', + 'tree_store.c', +]) + + +gtkdemo_deps = [libgtk_dep] + +if harfbuzz_dep.found() and pangoft_dep.found() + demos += files('font_features.c') + gtkdemo_deps += harfbuzz_dep +endif + +if os_unix + demos += files('pagesetup.c') +endif + +gtkdemo_sources = demos + files([ + 'main.c', +]) + + +geninclude = find_program('geninclude.py') +demos_h = custom_target( + 'gtk3 demo header', + output : 'demos.h', + input : demos, + command : [geninclude, '@OUTPUT@', '@INPUT@'], +) + +gtkdemo_resources = gnome.compile_resources( + 'gtkdemo_resources', + 'demo.gresource.xml', + source_dir: '.' +) + +gtkdemo = executable( + 'gtk3-demo', + gtkdemo_sources, + demos_h, + gtkdemo_resources, + dependencies: gtkdemo_deps, + include_directories : confinc, + gui_app: true, + install: true +) diff --git a/demos/icon-browser/meson.build b/demos/icon-browser/meson.build new file mode 100644 index 0000000000..661e5208c8 --- /dev/null +++ b/demos/icon-browser/meson.build @@ -0,0 +1,22 @@ +iconbrowser_sources = [ + 'main.c', + 'iconbrowserapp.c', + 'iconbrowserwin.c', + 'iconstore.c' +] + +iconbrowser_resources = gnome.compile_resources( + 'iconbrowser_resources', + 'iconbrowser.gresource.xml', + source_dir: '.' +) + +iconbrowser = executable( + 'gtk3-icon-browser', + iconbrowser_sources, + iconbrowser_resources, + dependencies: libgtk_dep, + include_directories : confinc, + gui_app: true, + install: true +) diff --git a/demos/meson.build b/demos/meson.build new file mode 100644 index 0000000000..2fdd19151d --- /dev/null +++ b/demos/meson.build @@ -0,0 +1,3 @@ + subdir('icon-browser') + subdir('widget-factory') + subdir('gtk-demo') diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build new file mode 100644 index 0000000000..170a59e4bc --- /dev/null +++ b/demos/widget-factory/meson.build @@ -0,0 +1,20 @@ + +widgetfactory_sources = [ + 'widget-factory.c' +] + +widgetfactory_resources = gnome.compile_resources( + 'widgetfactory_resources', + 'widget-factory.gresource.xml', + source_dir: '.' +) + +widget_factory = executable( + 'gtk3-widget-factory', + widgetfactory_sources, + widgetfactory_resources, + dependencies: libgtk_dep, + include_directories : confinc, + gui_app: true, + install: true +) diff --git a/examples/application1/meson.build b/examples/application1/meson.build new file mode 100644 index 0000000000..ae5620f07e --- /dev/null +++ b/examples/application1/meson.build @@ -0,0 +1,11 @@ + + +app1 = executable( + 'exampleapp', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + dependencies: libgtk_dep +) diff --git a/examples/application10/meson.build b/examples/application10/meson.build new file mode 100644 index 0000000000..ce842ae794 --- /dev/null +++ b/examples/application10/meson.build @@ -0,0 +1,23 @@ + +app10_resources = gnome.compile_resources( + 'exampleapp10 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app10_schemas = gnome.compile_schemas() + + +app10 = executable( + 'exampleapp10', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app10_resources, + app10_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application2/meson.build b/examples/application2/meson.build new file mode 100644 index 0000000000..99deae6e12 --- /dev/null +++ b/examples/application2/meson.build @@ -0,0 +1,17 @@ + +app2_resources = gnome.compile_resources( + 'exampleapp2 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app2 = executable( + 'exampleapp2', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app2_resources, + dependencies: libgtk_dep +) diff --git a/examples/application3/meson.build b/examples/application3/meson.build new file mode 100644 index 0000000000..f0cec4c198 --- /dev/null +++ b/examples/application3/meson.build @@ -0,0 +1,17 @@ + +app3_resources = gnome.compile_resources( + 'exampleapp3 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app3 = executable( + 'exampleapp3', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app3_resources, + dependencies: libgtk_dep +) diff --git a/examples/application4/meson.build b/examples/application4/meson.build new file mode 100644 index 0000000000..2ae18200b2 --- /dev/null +++ b/examples/application4/meson.build @@ -0,0 +1,17 @@ + +app4_resources = gnome.compile_resources( + 'exampleapp4 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app4 = executable( + 'exampleapp4', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app4_resources, + dependencies: libgtk_dep +) diff --git a/examples/application5/meson.build b/examples/application5/meson.build new file mode 100644 index 0000000000..f0fed1ca59 --- /dev/null +++ b/examples/application5/meson.build @@ -0,0 +1,21 @@ + +app5_resources = gnome.compile_resources( + 'exampleapp5 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app5_schemas = gnome.compile_schemas() + + +app5 = executable( + 'exampleapp5', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + app5_resources, + app5_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application6/meson.build b/examples/application6/meson.build new file mode 100644 index 0000000000..2d923f35a3 --- /dev/null +++ b/examples/application6/meson.build @@ -0,0 +1,23 @@ + +app6_resources = gnome.compile_resources( + 'exampleapp6 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app6_schemas = gnome.compile_schemas() + + +app6 = executable( + 'exampleapp6', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app6_resources, + app6_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application7/meson.build b/examples/application7/meson.build new file mode 100644 index 0000000000..cc32f36ad0 --- /dev/null +++ b/examples/application7/meson.build @@ -0,0 +1,23 @@ + +app7_resources = gnome.compile_resources( + 'exampleapp7 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app7_schemas = gnome.compile_schemas() + + +app7 = executable( + 'exampleapp7', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app7_resources, + app7_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application8/meson.build b/examples/application8/meson.build new file mode 100644 index 0000000000..1192f4d688 --- /dev/null +++ b/examples/application8/meson.build @@ -0,0 +1,23 @@ + +app8_resources = gnome.compile_resources( + 'exampleapp8 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app8_schemas = gnome.compile_schemas() + + +app8 = executable( + 'exampleapp8', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app8_resources, + app8_schemas, + dependencies: libgtk_dep +) diff --git a/examples/application9/meson.build b/examples/application9/meson.build new file mode 100644 index 0000000000..fccee738cb --- /dev/null +++ b/examples/application9/meson.build @@ -0,0 +1,23 @@ + +app9_resources = gnome.compile_resources( + 'exampleapp9 resources', + 'exampleapp.gresource.xml', + source_dir: '.' +) + +app9_schemas = gnome.compile_schemas() + + +app9 = executable( + 'exampleapp9', + 'main.c', + 'exampleapp.c', + 'exampleapp.h', + 'exampleappwin.c', + 'exampleappwin.h', + 'exampleappprefs.c', + 'exampleappprefs.h', + app9_resources, + app9_schemas, + dependencies: libgtk_dep +) diff --git a/examples/bp/meson.build b/examples/bp/meson.build new file mode 100644 index 0000000000..a3f82802f5 --- /dev/null +++ b/examples/bp/meson.build @@ -0,0 +1,13 @@ + +bp_resources = gnome.compile_resources( + 'bloatpad resources', + 'bloatpad.gresources.xml', + source_dir: '.' +) + +bloatpad = executable( + 'bloatpad', + 'bloatpad.c', + bp_resources, + dependencies: libgtk_dep +) diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 0000000000..79af2f8440 --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,60 @@ +builder_example = executable( + 'builder_example', + 'builder.c', + dependencies: libgtk_dep +) + +drawing = executable( + 'drawing', + 'drawing.c', + dependencies: libgtk_dep +) + +grid_packing = executable( + 'grid-packing', + 'grid-packing.c', + dependencies: libgtk_dep +) + +hello_world = executable( + 'hello-world', + 'hello-world.c', + dependencies: libgtk_dep +) + +plugman = executable( + 'plugman', + 'plugman.c', + dependencies: libgtk_dep +) + +search_bar = executable( + 'search-bar', + 'search-bar.c', + dependencies: libgtk_dep +) + +sunny = executable( + 'sunny', + 'sunny.c', + dependencies: libgtk_dep +) + +window_default = executable( + 'window-default', + 'window-default.c', + dependencies: libgtk_dep +) + + +subdir('bp') +subdir('application1') +subdir('application2') +subdir('application3') +subdir('application4') +subdir('application5') +subdir('application6') +subdir('application7') +subdir('application8') +subdir('application9') +subdir('application10') diff --git a/gdk/meson.build b/gdk/meson.build new file mode 100644 index 0000000000..cd5d4cbe2f --- /dev/null +++ b/gdk/meson.build @@ -0,0 +1,382 @@ +deprecated_gdk_sources = ['deprecated/gdkcolor.c'] +gdk_sources = files([ + 'gdk-private.c', + 'gdk.c', + 'gdkapplaunchcontext.c', + 'gdkcairo.c', + 'gdkcursor.c', + 'gdkdeprecated.c', + 'gdkdevice.c', + 'gdkdevicemanager.c', + 'gdkdevicepad.c', + 'gdkdisplay.c', + 'gdkdisplaymanager.c', + 'gdkdnd.c', + 'gdkevents.c', + 'gdkframetimings.c', + 'gdkgl.c', + 'gdkglcontext.c', + 'gdkglobals.c', + 'gdkkeys.c', + 'gdkkeyuni.c', + 'gdkoffscreenwindow.c', + 'gdkframeclock.c', + 'gdkframeclockidle.c', + 'gdkpango.c', + 'gdkpixbuf-drawable.c', + 'gdkproperty.c', + 'gdkrectangle.c', + 'gdkrgba.c', + 'gdkscreen.c', + 'gdkselection.c', + 'gdkvisual.c', + 'gdkwindow.c', + 'gdkwindowimpl.c', + 'gdkseat.c', + 'gdkseatdefault.c', + 'gdkdevicetool.c', + 'gdkdrawingcontext.c', + 'gdkmonitor.c' +]) + +gdk_public_h_sources = files([ + 'gdk.h', + 'gdk-autocleanup.h', + 'gdkapplaunchcontext.h', + 'gdkcairo.h', + 'gdkcursor.h', + 'gdkdevice.h', + 'gdkdevicetool.h', + 'gdkdevicemanager.h', + 'gdkdevicepad.h', + 'gdkdisplay.h', + 'gdkdisplaymanager.h', + 'gdkdnd.h', + 'gdkdrawingcontext.h', + 'gdkevents.h', + 'gdkframetimings.h', + 'gdkglcontext.h', + 'gdkkeys.h', + 'gdkkeysyms.h', + 'gdkmain.h', + 'gdkmonitor.h', + 'gdkpango.h', + 'gdkframeclock.h', + 'gdkpixbuf.h', + 'gdkprivate.h', + 'gdkproperty.h', + 'gdkrectangle.h', + 'gdkrgba.h', + 'gdkscreen.h', + 'gdkseat.h', + 'gdkselection.h', + 'gdktestutils.h', + 'gdkthreads.h', + 'gdktypes.h', + 'gdkvisual.h', + 'gdkwindow.h', +]) + +gdk_private_h_sources = files([ + 'gdkseatdefaultprivate.h', + 'gdkdevicetoolprivate.h', + 'gdkdrawingcontextprivate.h', + 'gdkmonitorprivate.h', + 'gdkprivate.h', +]) + +gdk_x_sources = [ + 'x11/MwmUtil.h', + 'x11/gdkapplaunchcontext-x11.c', + 'x11/gdkasync.c', + 'x11/gdkasync.h', + 'x11/gdkcursor-x11.c', + 'x11/gdkdevice-core-x11.c', + 'x11/gdkdevice-xi2.c', + 'x11/gdkdevicemanager-core-x11.c', + 'x11/gdkdevicemanager-x11.c', + 'x11/gdkdevicemanager-xi2.c', + 'x11/gdkdisplaymanager-x11.c', + 'x11/gdkdisplay-x11.c', + 'x11/gdkdisplay-x11.h', + 'x11/gdkdnd-x11.c', + 'x11/gdkeventsource.c', + 'x11/gdkeventsource.h', + 'x11/gdkeventtranslator.c', + 'x11/gdkeventtranslator.h', + 'x11/gdkgeometry-x11.c', + 'x11/gdkglcontext-x11.c', + 'x11/gdkglcontext-x11.h', + 'x11/gdkkeys-x11.c', + 'x11/gdkmain-x11.c', + 'x11/gdkproperty-x11.c', + 'x11/gdkscreen-x11.c', + 'x11/gdkscreen-x11.h', + 'x11/gdkselection-x11.c', + 'x11/gdktestutils-x11.c', + 'x11/gdkvisual-x11.c', + 'x11/gdkwindow-x11.c', + 'x11/gdkwindow-x11.h', + 'x11/gdkxftdefaults.c', + 'x11/gdkxid.c', + 'x11/gdkx.h', + 'x11/xsettings-client.h', + 'x11/xsettings-client.c', + 'x11/gdkmonitor-x11.c', + 'x11/gdkmonitor-x11.h', + 'x11/gdkx11monitor.h' +] + +gdk_x_private_sources = [ + 'x11/gdkprivate-x11.h', + 'x11/gdkdevicemanagerprivate-core.h', +] + +gdk_wayland_sources = files([ + 'wayland/gdkapplaunchcontext-wayland.c', + 'wayland/gdkcursor-wayland.c', + 'wayland/gdkdevice-wayland.c', + 'wayland/gdkdisplay-wayland.c', + 'wayland/gdkdisplay-wayland.h', + 'wayland/gdkdnd-wayland.c', + 'wayland/gdkeventsource.c', + 'wayland/gdkglcontext-wayland.c', + 'wayland/gdkglcontext-wayland.h', + 'wayland/gdkkeys-wayland.c', + 'wayland/gdkmonitor-wayland.c', + 'wayland/gdkmonitor-wayland.h', + 'wayland/gdkscreen-wayland.c', + 'wayland/gdkseat-wayland.h', + 'wayland/gdkselection-wayland.c', + 'wayland/gdkwaylanddevice.h', + 'wayland/gdkwaylanddisplay.h', + 'wayland/gdkwaylandglcontext.h', + 'wayland/gdkwayland.h', + 'wayland/gdkwaylandmonitor.h', + 'wayland/gdkwaylandselection.h', + 'wayland/gdkwaylandwindow.h', + 'wayland/gdkwindow-wayland.c', + 'wayland/wm-button-layout-translation.c', +]) + +gdk_wayland_private_sources = files([ + 'wayland/gdkprivate-wayland.h', +]) + + + +gdk_broadway_sources = files([ + 'broadway/gdkdisplay-broadway.c', + 'broadway/gdkdisplay-broadway.h', + 'broadway/gdkscreen-broadway.c', + 'broadway/gdkscreen-broadway.h', + 'broadway/broadway-output.c', + 'broadway/broadway-output.h', + 'broadway/broadway-server.h', + 'broadway/broadway-server.c', + 'broadway/gdkbroadway-server.c', + 'broadway/gdkcursor-broadway.c', + 'broadway/gdkvisual-broadway.c', + 'broadway/gdkselection-broadway.c', + 'broadway/gdkwindow-broadway.c', + 'broadway/gdkwindow-broadway.h', + 'broadway/gdkmonitor-broadway.c', + 'broadway/gdkmonitor-broadway.h', + 'broadway/gdkkeys-broadway.c', + 'broadway/gdkglobals-broadway.c', + 'broadway/gdkeventsource.c', + 'broadway/gdkeventsource.h', + 'broadway/gdkdnd-broadway.c', + 'broadway/broadwayd.c', + 'broadway/gdkdevicemanager-broadway.c', + 'broadway/gdkdevicemanager-broadway.h', + 'broadway/gdkdevice-broadway.c', + 'broadway/gdkdevice-broadway.h', + 'broadway/broadway-buffer.c', + 'broadway/broadway-buffer.h', + 'broadway/gdktestutils-broadway.c', + 'broadway/gdkproperty-broadway.c' +]) + +gdk_broadway_private_sources = files([ + 'broadway/gdkprivate-broadway.h' +]) + +# glsl_sources = [ + # 'gl3-texture-2d.fs.glsl', + # 'gl3-texture-2d.vs.glsl', + # 'gl3-texture-rect.fs.glsl', + # 'gl3-texture-rect.vs.glsl', + # 'gl2-texture-2d.fs.glsl', + # 'gl2-texture-2d.fs.glsl', + # 'gl2-texture-rect.vs.glsl', + # 'gl2-texture-rect.vs.glsl', + # 'gles2-texture.fs.glsl', + # 'gles2-texture.vs.glsl', +# ] +# resource_xml = '' +# foreach glsl_file : glsl_sources + # resource_xml += ' resources/glsl/@0@\n'.format(glsl_file) +# endforeach + + +# cdata = configuration_data() +# cdata.set('GDK_GRESOURCE_XML_FILES', resource_xml) +# gdkresources_xml = configure_file( + # input : 'gdk.gresource.xml.meson', + # output : 'gdk.gresource.xml', + # configuration : cdata +# ) + +gdkresources = gnome.compile_resources( + 'gdkresources', + 'gdk.gresource.xml', + source_dir: '.', + c_name: '_gdk', + extra_args: '--manual-register' +) + + +deprecated_h_sources = files(['deprecated/gdkcolor.h']) + +gdk_headers = gdk_public_h_sources + deprecated_h_sources + gdk_private_h_sources + +gdkenum_h = custom_target( + 'gdkenum_h', + output : 'gdkenumtypes.h', + input : gdk_headers, + command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gdkenumtypes.h.template', '@OUTPUT@', '@INPUT@']) + +gdkenum_c = custom_target( + 'gdkenum_c', + output : 'gdkenumtypes.c', + input : gdk_headers, + depends : gdkenum_h, + command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gdkenumtypes.c.template', '@OUTPUT@', '@INPUT@']) + +gdkmarshal_h = custom_target( + 'gdkmarshal_h', + output : 'gdkmarshalers.h', + input : 'gdkmarshalers.list', + command : [mkmarshal, glib_marshal, '_gdk_marshal', '@INPUT@', '@OUTPUT@'] +) + +gdkmarshal_c = custom_target( + 'gdkmarshal_c', + output : 'gdkmarshalers.c', + input : 'gdkmarshalers.list', + command : [mkmarshal, glib_marshal, '_gdk_marshal', '@INPUT@', '@OUTPUT@'] +) + +cdata = configuration_data() +cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +cdata.set('GTK_MICRO_VERSION', gtk_micro_version) + + + +if x11_enabled cdata.set('GDK_WINDOWING_X11', '') endif +if wayland_enabled cdata.set('GDK_WINDOWING_WAYLAND', '') endif +if broadway_enabled cdata.set('GDK_WINDOWING_BROADWAY', '') endif +gdkconfig = configure_file( + input : 'gdkconfig.h.meson', + output : 'gdkconfig.h', + configuration : cdata +) + +gdkversionmacros = configure_file( + input : 'gdkversionmacros.h.in', + output : 'gdkversionmacros.h', + configuration: cdata +) + +xinc = include_directories('x11') +wlinc = include_directories('.') + + +gdk_deps = [ + mlib, + pixbuf_dep, + cairo_dep, + pango_dep, + cairogobj_dep, + glib_dep, + epoxy_dep, + fontconfig_dep, + giounix_dep, + pangocairo_dep +] + +gdk_sources = [ + gdkconfig, + gdk_sources, + deprecated_gdk_sources, + gdkenum_c, gdkenum_h, + gdkmarshal_c, gdkmarshal_h, + gdkresources, + gdkversionmacros, + gdk_headers +] + +if x11_enabled + gdk_deps += [ + xrender_dep, + xi_dep, + xext_dep, + x11_dep, + xcursor_dep, + xdamage_dep, + xfixes_dep, + xcomposite_dep, + xrandr_dep + ] + gdk_sources += [ + gdk_x_sources, + gdk_x_private_sources + ] +endif + +if wayland_enabled + subdir('wayland') + gdk_deps += [ + shmlib, + xkbdep, + wlclientdep, + wlprotocolsdep, + wlcursordep, + wlegldep + ] + gdk_sources += [ + gdk_wayland_sources, + gdk_wayland_private_sources + ] +endif + +if broadway_enabled + gdk_deps += [ + shmlib, + ] + gdk_sources += [ + gdk_broadway_sources, + gdk_broadway_private_sources + ] +endif + + +libgdk = shared_library('gdk', + sources: [gdk_sources, gdkconfig, gdkenum_h], + c_args: ['-DHAVE_CONFIG_H', '-DGDK_COMPILATION'], + include_directories: [confinc, xinc, wlinc], + dependencies: gdk_deps, + install: true +) + + +libgdk_dep = declare_dependency( + sources: ['gdk.h', gdkconfig, gdkenum_h], + depends: gdk_sources, + include_directories: [confinc, xinc, wlinc], + dependencies: gdk_deps, + link_with: libgdk, + link_args: ['-Bsymbolic'], +) diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build new file mode 100644 index 0000000000..6783ecf193 --- /dev/null +++ b/gdk/wayland/meson.build @@ -0,0 +1,115 @@ + + +if wayland_enabled + runcmd = run_command('pkg-config', '--variable=pkgdatadir', 'wayland-protocols') + if runcmd.returncode() == 0 + wayland_protocols_datadir = runcmd.stdout().strip() + '/' + else + error('Could not get wayland-protocols pkgdatadir via pkg-config.') + endif + + wayland_scanner = find_program('wayland-scanner') + genprotocols = find_program('genprotocolfiles.py') + + gtk_shell_h = custom_target( + 'gtk shell protocol header', + input : 'protocol/gtk-shell.xml', + output : 'gtk-shell-client-protocol.h', + command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'client-header'] + ) + + gtk_shell_c = custom_target( + 'gtk shell protocol source', + input : 'protocol/gtk-shell.xml', + output : 'gtk-shell-protocol.c', + command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'code'] + ) + + pointer_gestures_h = custom_target( + 'pointer gestures header', + input : wayland_protocols_datadir + 'unstable/pointer-gestures/pointer-gestures-unstable-v1.xml', + output : 'pointer-gestures-unstable-v1-client-protocol.h', + command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'client-header'] + ) + + pointer_gestures_c = custom_target( + 'pointer gestures source', + input : wayland_protocols_datadir + 'unstable/pointer-gestures/pointer-gestures-unstable-v1.xml', + output : 'pointer-gestures-unstable-v1-protocol.c', + command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'code'] + ) + + primary_selection_h = custom_target( + 'primary selection header', + input : 'protocol/gtk-primary-selection.xml', + output : 'gtk-primary-selection-client-protocol.h', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] + ) + + primary_selection_c = custom_target( + 'primary selection source', + input : 'protocol/gtk-primary-selection.xml', + output : 'gtk-primary-selection-protocol.c', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] + ) + + xdg_shell_h = custom_target( + 'xdg shell v6 header', + input : wayland_protocols_datadir + 'unstable/xdg-shell/xdg-shell-unstable-v6.xml', + output : 'xdg-shell-unstable-v6-client-protocol.h', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] + ) + + xdg_shell_c = custom_target( + 'xdg shell v6 source', + input : wayland_protocols_datadir + 'unstable/xdg-shell/xdg-shell-unstable-v6.xml', + output : 'xdg-shell-unstable-v6-protocol.c', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] + ) + + xdg_foreign_h = custom_target( + 'xdg foreign v1 header', + input : wayland_protocols_datadir + 'unstable/xdg-foreign/xdg-foreign-unstable-v1.xml', + output : 'xdg-foreign-unstable-v1-client-protocol.h', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] + ) + + xdg_foreign_c = custom_target( + 'xdg foreign v1 source', + input : wayland_protocols_datadir + 'unstable/xdg-foreign/xdg-foreign-unstable-v1.xml', + output : 'xdg-foreign-unstable-v1-protocol.c', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] + ) + + tablet_h = custom_target( + 'tablet v2 header', + input : wayland_protocols_datadir + 'unstable/tablet/tablet-unstable-v2.xml', + output : 'tablet-unstable-v2-client-protocol.h', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] + ) + + tablet_c = custom_target( + 'tablet v2 source', + input : wayland_protocols_datadir + 'unstable/tablet/tablet-unstable-v2.xml', + output : 'tablet-unstable-v2-protocol.c', + command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] + ) + + + + gdk_sources += [ + gtk_shell_c, + gtk_shell_h, + pointer_gestures_h, + pointer_gestures_c, + primary_selection_h, + primary_selection_c, + xdg_shell_h, + xdg_shell_c, + xdg_foreign_h, + xdg_foreign_c, + tablet_h, + tablet_c + ] + +endif diff --git a/gtk/a11y/meson.build b/gtk/a11y/meson.build new file mode 100644 index 0000000000..c53c22abdd --- /dev/null +++ b/gtk/a11y/meson.build @@ -0,0 +1,57 @@ +a11y_sources = files( + 'gtkaccessibility.c', + 'gtkaccessibilitymisc.c', + 'gtkaccessibilityutil.c', + 'gtkarrowaccessible.c', + 'gtkbooleancellaccessible.c', + 'gtkbuttonaccessible.c', + 'gtkcellaccessible.c', + 'gtkcellaccessibleparent.c', + 'gtkcheckmenuitemaccessible.c', + 'gtkcolorswatchaccessible.c', + 'gtkcomboboxaccessible.c', + 'gtkcontaineraccessible.c', + 'gtkcontainercellaccessible.c', + 'gtkentryaccessible.c', + 'gtkexpanderaccessible.c', + 'gtkflowboxaccessible.c', + 'gtkflowboxchildaccessible.c', + 'gtkframeaccessible.c', + 'gtkiconviewaccessible.c', + 'gtkimageaccessible.c', + 'gtkimagecellaccessible.c', + 'gtklabelaccessible.c', + 'gtklevelbaraccessible.c', + 'gtklinkbuttonaccessible.c', + 'gtklistboxaccessible.c', + 'gtklistboxrowaccessible.c', + 'gtklockbuttonaccessible.c', + 'gtkmenuaccessible.c', + 'gtkmenubuttonaccessible.c', + 'gtkmenushellaccessible.c', + 'gtkmenuitemaccessible.c', + 'gtknotebookaccessible.c', + 'gtknotebookpageaccessible.c', + 'gtkpanedaccessible.c', + 'gtkpopoveraccessible.c', + 'gtkprogressbaraccessible.c', + 'gtkradiobuttonaccessible.c', + 'gtkradiomenuitemaccessible.c', + 'gtkrangeaccessible.c', + 'gtkrenderercellaccessible.c', + 'gtkscaleaccessible.c', + 'gtkscalebuttonaccessible.c', + 'gtkscrolledwindowaccessible.c', + 'gtkspinbuttonaccessible.c', + 'gtkspinneraccessible.c', + 'gtkstatusbaraccessible.c', + 'gtkswitchaccessible.c', + 'gtktextcellaccessible.c', + 'gtktextviewaccessible.c', + 'gtktogglebuttonaccessible.c', + 'gtktoplevelaccessible.c', + 'gtktreeviewaccessible.c', + 'gtkwidgetaccessible.c', + 'gtkwindowaccessible.c', + 'gtkstackaccessible.c' + ) diff --git a/gtk/deprecated/meson.build b/gtk/deprecated/meson.build new file mode 100644 index 0000000000..c2cf4757eb --- /dev/null +++ b/gtk/deprecated/meson.build @@ -0,0 +1,42 @@ +gtk_deprecated_c_sources = files( + 'gtkactivatable.c', + 'gtkaction.c', + 'gtkactiongroup.c', + 'gtkalignment.c', + 'gtkarrow.c', + 'gtkcolorsel.c', + 'gtkcolorseldialog.c', + 'gtkfontsel.c', + 'gtkgradient.c', + 'gtkhandlebox.c', + 'gtkhbbox.c', + 'gtkhbox.c', + 'gtkhpaned.c', + 'gtkhscale.c', + 'gtkhscrollbar.c', + 'gtkhseparator.c', + 'gtkhsv.c', + 'gtkiconfactory.c', + 'gtkimagemenuitem.c', + 'gtkmisc.c', + 'gtknumerableicon.c', + 'gtkradioaction.c', + 'gtkrc.c', + 'gtkrecentaction.c', + 'gtkstatusicon.c', + 'gtkstock.c', + 'gtkstyle.c', + 'gtkstyleproperties.c', + 'gtksymboliccolor.c', + 'gtktable.c', + 'gtktearoffmenuitem.c', + 'gtkthemingengine.c', + 'gtktoggleaction.c', + 'gtkuimanager.c', + 'gtkvbbox.c', + 'gtkvbox.c', + 'gtkvscale.c', + 'gtkvscrollbar.c', + 'gtkvseparator.c', + 'gtkvpaned.c', +) diff --git a/gtk/inspector/meson.build b/gtk/inspector/meson.build new file mode 100644 index 0000000000..a119a08db8 --- /dev/null +++ b/gtk/inspector/meson.build @@ -0,0 +1,31 @@ +inspector_sources = files( + 'action-editor.c', + 'actions.c', + 'cellrenderergraph.c', + 'css-editor.c', + 'css-node-tree.c', + 'data-list.c', + 'general.c', + 'gestures.c', + 'graphdata.c', + 'gtktreemodelcssnode.c', + 'init.c', + 'inspect-button.c', + 'magnifier.c', + 'menu.c', + 'misc-info.c', + 'object-hierarchy.c', + 'object-tree.c', + 'prop-editor.c', + 'prop-list.c', + 'resource-list.c', + 'selector.c', + 'signals-list.c', + 'size-groups.c', + 'statistics.c', + 'treewalk.c', + 'visual.c', + 'window.c', + 'strv-editor.c', + 'gtkstackcombo.c' +) diff --git a/gtk/meson.build b/gtk/meson.build new file mode 100644 index 0000000000..46fa1a9a4d --- /dev/null +++ b/gtk/meson.build @@ -0,0 +1,905 @@ +subdir('deprecated') +subdir('a11y') +subdir('inspector') + +gtk_sources = files([ + 'gtkactionmuxer.c', + 'gtkactionobserver.c', + 'gtkactionobservable.c', + 'gtkactionable.c', + 'gtkquery.c', + 'gtksearchbar.c', + 'gtksearchentry.c', + 'gtksearchengine.c', + 'gtksearchenginesimple.c', + 'gtksearchenginemodel.c', + 'fnmatch.c', + 'gtkaboutdialog.c', + 'gtkaccelgroup.c', + 'gtkaccellabel.c', + 'gtkaccelmap.c', + 'gtkaccessible.c', + 'gtkactionbar.c', + 'gtkactionhelper.c', + 'gtkadjustment.c', + 'gtkallocatedbitmask.c', + 'gtkappchooser.c', + 'gtkappchooserwidget.c', + 'gtkappchooserbutton.c', + 'gtkappchooserdialog.c', + 'gtkapplication.c', + 'gtkapplicationimpl.c', + 'gtkapplicationwindow.c', + 'gtkaspectframe.c', + 'gtkassistant.c', + 'gtkbbox.c', + 'gtkbin.c', + 'gtkbindings.c', + 'gtkbookmarksmanager.c', + 'gtkborder.c', + 'gtkbox.c', + 'gtkbuildable.c', + 'gtkbuilder.c', + 'gtkicon.c', + 'gtkshortcutswindow.c', + 'gtkshortcutssection.c', + 'gtkbuilderparser.c', + 'gtkbuilder-menus.c', + 'gtkbutton.c', + 'gtkcairoblur.c', + 'gtkcssnode.c', + 'gtkcsscalcvalue.c', + 'gtkcalendar.c', + 'gtkcellarea.c', + 'gtkcellareabox.c', + 'gtkcellareaboxcontext.c', + 'gtkcellareacontext.c', + 'gtkcelleditable.c', + 'gtkcelllayout.c', + 'gtkcellrenderer.c', + 'gtkcellrendereraccel.c', + 'gtkcellrenderercombo.c', + 'gtkcellrendererpixbuf.c', + 'gtkcellrendererprogress.c', + 'gtkcellrendererspin.c', + 'gtkcellrendererspinner.c', + 'gtkcellrenderertext.c', + 'gtkcellrenderertoggle.c', + 'gtkcellview.c', + 'gtkcenterbox.c', + 'gtkcheckbutton.c', + 'gtkcheckmenuitem.c', + 'gtkcolorbutton.c', + 'gtkcolorchooser.c', + 'gtkcolorchooserwidget.c', + 'gtkcolorchooserdialog.c', + 'gtkcoloreditor.c', + 'gtkcolorplane.c', + 'gtkcolorscale.c', + 'gtkcolorswatch.c', + 'gtkcolorutils.c', + 'gtkcombobox.c', + 'gtkcomboboxtext.c', + 'gtkcontainer.c', + 'gtkcssanimation.c', + 'gtkcssgadget.c', + 'gtkcsscustomgadget.c', + 'gtkboxgadget.c', + 'gtkimagedefinition.c', + 'gtkprogresstracker.c', + 'gtkcssimageradial.c', + 'gtkcssimagerecolor.c', + 'gtkcssimagefallback.c', + 'gtkbuiltinicon.c', + 'gtkcssstylechange.c', + 'gtkcsspalettevalue.c', + 'gtkcssanimatedstyle.c', + 'gtkcssarrayvalue.c', + 'gtkcssbgsizevalue.c', + 'gtkcssbordervalue.c', + 'gtkcsscolorvalue.c', + 'gtkcsscornervalue.c', + 'gtkcsscustomproperty.c', + 'gtkcsseasevalue.c', + 'gtkcssenumvalue.c', + 'gtkcssenginevalue.c', + 'gtkcssiconthemevalue.c', + 'gtkcssimage.c', + 'gtkcssimagebuiltin.c', + 'gtkcssimagecrossfade.c', + 'gtkcssimagegradient.c', + 'gtkcssimageicontheme.c', + 'gtkcssimagelinear.c', + 'gtkcssimagesurface.c', + 'gtkcssimageurl.c', + 'gtkcssimagescaled.c', + 'gtkcssimagevalue.c', + 'gtkcssimagewin32.c', + 'gtkcssinheritvalue.c', + 'gtkcssinitialvalue.c', + 'gtkcsskeyframes.c', + 'gtkcsslookup.c', + 'gtkcssmatcher.c', + 'gtkcssnode.c', + 'gtkcssnodedeclaration.c', + 'gtkcssnumbervalue.c', + 'gtkcssparser.c', + 'gtkcsspathnode.c', + 'gtkcsspositionvalue.c', + 'gtkcssprovider.c', + 'gtkcssrepeatvalue.c', + 'gtkcssrgbavalue.c', + 'gtkcsssection.c', + 'gtkcssselector.c', + 'gtkcssstringvalue.c', + 'gtkcssstyle.c', + 'gtkcssshadowsvalue.c', + 'gtkcssshadowvalue.c', + 'gtkcssshorthandproperty.c', + 'gtkshortcutlabel.c', + 'gtkfilechoosernativeportal.c', + 'gtkdragsource.c', + 'gtkcssshorthandpropertyimpl.c', + 'gtkcssstaticstyle.c', + 'gtkcssstylefuncs.c', + 'gtkcssstyleproperty.c', + 'gtkcssstylepropertyimpl.c', + 'gtkcsstransformvalue.c', + 'gtkcsstransientnode.c', + 'gtkcsstransition.c', + 'gtkcsstypedvalue.c', + 'gtkcssunsetvalue.c', + 'gtkcsstypes.c', + 'gtkcssvalue.c', + 'gtkcsswidgetnode.c', + 'gtkcssnodestylecache.c', + 'gtkapplicationaccels.c', + 'gtkcssdimensionvalue.c', + 'gtkshortcutsgroup.c', + 'gtkshortcutsshortcut.c', + 'gtkfilechoosernative.c', + 'gtknativedialog.c', + 'gtkdialog.c', + 'gtkdrawingarea.c', + 'gtkutils.c', + 'gtktooltipwindow.c', + 'gtkeditable.c', + 'gtkentry.c', + 'gtkentrybuffer.c', + 'gtkentrycompletion.c', + 'gtkeventbox.c', + 'gtkeventcontroller.c', + 'gtkexpander.c', + 'gtkfilechooser.c', + 'gtkfilechooserbutton.c', + 'gtkfilechooserdialog.c', + 'gtkfilechooserembed.c', + 'gtkfilechooserentry.c', + 'gtkfilechooserutils.c', + 'gtkfilechooserwidget.c', + 'gtkfilefilter.c', + 'gtkfilesystem.c', + 'gtkfilesystemmodel.c', + 'gtkfixed.c', + 'gtkflowbox.c', + 'gtkfontbutton.c', + 'gtkfontchooser.c', + 'gtkfontchooserdialog.c', + 'gtkcsswin32sizevalue.c', + 'gtkfontchooserutils.c', + 'gtkwin32theme.c', + 'gtkwin32draw.c', + 'gtkcomposetable.c', + 'gdkpixbufutils.c', + 'gtkfontchooserwidget.c', + 'gtkframe.c', + 'gtkprintoperation-portal.c', + 'gtkgladecatalog.c', + 'gtkgesture.c', + 'gtkgesturedrag.c', + 'gtkgesturelongpress.c', + 'gtkgesturemultipress.c', + 'gtkgesturepan.c', + 'gtkgesturerotate.c', + 'gtkgesturesingle.c', + 'gtkgestureswipe.c', + 'gtkgesturezoom.c', + 'gtkgizmo.c', + 'gtkgladecatalog.c', + 'gtkglarea.c', + 'gtkgrid.c', + 'gtkheaderbar.c', + 'gtkdragdest.c', + 'gtkhsla.c', + 'gtkiconcache.c', + 'gtkiconcachevalidator.c', + 'gtkiconhelper.c', + 'gtkicontheme.c', + 'gtkiconview.c', + 'gtkimage.c', + 'gtkimcontext.c', + 'gtkimcontextsimple.c', + 'gtkimmodule.c', + 'gtkimmulticontext.c', + 'gtkinfobar.c', + 'gtkinvisible.c', + 'gtkkeyhash.c', + 'gtkkineticscrolling.c', + 'gtklabel.c', + 'gtklayout.c', + 'gtklevelbar.c', + 'gtklinkbutton.c', + 'gtklistbox.c', + 'gtkliststore.c', + 'gtklockbutton.c', + 'gtkmain.c', + 'gtkmagnifier.c', + 'gtkmenu.c', + 'gtkmenubar.c', + 'gtkmenubutton.c', + 'gtkmenuitem.c', + 'gtkmenusectionbox.c', + 'gtkmenushell.c', + 'gtkmenutracker.c', + 'gtkmenutrackeritem.c', + 'gtkmenutoolbutton.c', + 'gtkmessagedialog.c', + 'gtkmnemonichash.c', + 'gtkmodelmenuitem.c', + 'gtkmodelbutton.c', + 'gtkmodifierstyle.c', + 'gtkmodules.c', + 'gtkmountoperation.c', + 'gtknotebook.c', + 'gtkoffscreenwindow.c', + 'gtkorientable.c', + 'gtkoverlay.c', + 'gtkpadcontroller.c', + 'gtkpagesetup.c', + 'gtkpaned.c', + 'gtkpango.c', + 'gtkpapersize.c', + 'gtkpathbar.c', + 'gtkplacessidebar.c', + 'gtkplacesview.c', + 'gtkplacesviewrow.c', + 'gtkprintcontext.c', + 'gtkprintoperation.c', + 'gtkprintoperationpreview.c', + 'gtkprintsettings.c', + 'gtkprintutils.c', + 'gtkprivate.c', + 'gtkprogressbar.c', + 'gtkpixelcache.c', + 'gtkpopover.c', + 'gtkpopovermenu.c', + 'gtkradiobutton.c', + 'gtkradiomenuitem.c', + 'gtkradiotoolbutton.c', + 'gtkrange.c', + 'gtkrbtree.c', + 'gtkrecentchooserdefault.c', + 'gtkrecentchooserdialog.c', + 'gtkrecentchoosermenu.c', + 'gtkrecentchooserwidget.c', + 'gtkrecentchooserutils.c', + 'gtkrecentchooser.c', + 'gtkrecentfilter.c', + 'gtkrecentmanager.c', + 'gtkrender.c', + 'gtkrenderbackground.c', + 'gtkrenderborder.c', + 'gtkrendericon.c', + 'gtkrevealer.c', + 'gtkroundedbox.c', + 'gtkscale.c', + 'gtkscalebutton.c', + 'gtkscrollable.c', + 'gtkscrollbar.c', + 'gtkscrolledwindow.c', + 'gtkselection.c', + 'gtkseparator.c', + 'gtkseparatormenuitem.c', + 'gtkseparatortoolitem.c', + 'gtksettings.c', + 'gtksidebarrow.c', + 'gtksizegroup.c', + 'gtksizerequest.c', + 'gtksizerequestcache.c', + 'gtkshow.c', + 'gtkstacksidebar.c', + 'gtkspinbutton.c', + 'gtkspinner.c', + 'gtkstack.c', + 'gtkstackswitcher.c', + 'gtkstatusbar.c', + 'gtkstyleanimation.c', + 'gtkstylecascade.c', + 'gtkstylecontext.c', + 'gtkstyleproperty.c', + 'gtkstyleprovider.c', + 'gtkstyleproviderprivate.c', + 'gtkswitch.c', + 'gtktestutils.c', + 'gtktextattributes.c', + 'gtktextbtree.c', + 'gtktextbuffer.c', + 'gtktextbufferrichtext.c', + 'gtktextbufferserialize.c', + 'gtktextchild.c', + 'gtktextdisplay.c', + 'gtktexthandle.c', + 'gtktextiter.c', + 'gtktextlayout.c', + 'gtktextmark.c', + 'gtktextsegment.c', + 'gtktexttag.c', + 'gtktexttagtable.c', + 'gtktexttypes.c', + 'gtktextutil.c', + 'gtktextview.c', + 'gtktogglebutton.c', + 'gtktoggletoolbutton.c', + 'gtktoolbar.c', + 'gtktoolbutton.c', + 'gtktoolitem.c', + 'gtktoolitemgroup.c', + 'gtktoolpalette.c', + 'gtktoolshell.c', + 'gtktooltip.c', + 'gtktrashmonitor.c', + 'gtktreedatalist.c', + 'gtktreednd.c', + 'gtktreemenu.c', + 'gtktreemodel.c', + 'gtktreemodelfilter.c', + 'gtktreemodelsort.c', + 'gtktreeselection.c', + 'gtktreesortable.c', + 'gtktreestore.c', + 'gtktreeview.c', + 'gtktreeviewcolumn.c', + 'gtkvolumebutton.c', + 'gtkviewport.c', + 'gtkwidget.c', + 'gtkwidgetfocus.c', + 'gtkwidgetpath.c', + 'gtkwindow.c', + 'gtkwindowgroup.c', + 'gtkwin32theme.c', + 'fallback-c89.c' +]) + +gtk_private_type_headers = files([ + 'gtkcsstypesprivate.h', + 'gtktexthandleprivate.h', +]) + +gtk_private_h_sources = gtk_private_type_headers + files([ + 'gtkrecentchooserutils.h', + 'gtkrbtree.h', +]) + +gtk_public_h_sources = files([ + 'gtk.h', + 'gtk-autocleanups.h', + 'gtkx.h', + 'gtkx-autocleanups.h', + 'gtk-a11y.h', + 'gtkaboutdialog.h', + 'gtkaccelgroup.h', + 'gtkaccellabel.h', + 'gtkaccelmap.h', + 'gtkaccessible.h', + 'gtkactionable.h', + 'gtkactionbar.h', + 'gtkadjustment.h', + 'gtkappchooser.h', + 'gtkappchooserbutton.h', + 'gtkappchooserdialog.h', + 'gtkappchooserwidget.h', + 'gtkapplication.h', + 'gtkapplicationwindow.h', + 'gtkaspectframe.h', + 'gtkassistant.h', + 'gtkbbox.h', + 'gtkbin.h', + 'gtkbindings.h', + 'gtkborder.h', + 'gtkbox.h', + 'gtkbuilder.h', + 'gtkbuildable.h', + 'gtkbutton.h', + 'gtkcalendar.h', + 'gtkcellarea.h', + 'gtkcellareacontext.h', + 'gtkcellareabox.h', + 'gtkcelleditable.h', + 'gtkcelllayout.h', + 'gtkcellrenderer.h', + 'gtkcellrendereraccel.h', + 'gtkcellrenderercombo.h', + 'gtkcellrendererpixbuf.h', + 'gtkcellrendererprogress.h', + 'gtkcellrendererspin.h', + 'gtkcellrendererspinner.h', + 'gtkcellrenderertext.h', + 'gtkcellrenderertoggle.h', + 'gtkcellview.h', + 'gtkcheckbutton.h', + 'gtkcheckmenuitem.h', + 'gtkclipboard.h', + 'gtkcolorbutton.h', + 'gtkcolorchooser.h', + 'gtkcolorchooserwidget.h', + 'gtkcolorchooserdialog.h', + 'gtkcolorutils.h', + 'gtkcombobox.h', + 'gtkcomboboxtext.h', + 'gtkcontainer.h', + 'gtkcssprovider.h', + 'gtkcsssection.h', + 'gtkdebug.h', + 'gtkdialog.h', + 'gtkdnd.h', + 'gtkdragdest.h', + 'gtkdragsource.h', + 'gtkdrawingarea.h', + 'gtkeditable.h', + 'gtkentry.h', + 'gtkentrybuffer.h', + 'gtkentrycompletion.h', + 'gtkenums.h', + 'gtkeventbox.h', + 'gtkeventcontroller.h', + 'gtkexpander.h', + 'gtkfilechooser.h', + 'gtkfilechooserbutton.h', + 'gtkfilechooserdialog.h', + 'gtkfilechoosernative.h', + 'gtkfilechooserwidget.h', + 'gtkfilefilter.h', + 'gtkfixed.h', + 'gtkflowbox.h', + 'gtkfontbutton.h', + 'gtkfontchooser.h', + 'gtkfontchooserdialog.h', + 'gtkfontchooserwidget.h', + 'gtkframe.h', + 'gtkgesture.h', + 'gtkgesturedrag.h', + 'gtkgesturelongpress.h', + 'gtkgesturemultipress.h', + 'gtkgesturepan.h', + 'gtkgesturerotate.h', + 'gtkgesturesingle.h', + 'gtkgestureswipe.h', + 'gtkgesturezoom.h', + 'gtkglarea.h', + 'gtkgrid.h', + 'gtkheaderbar.h', + 'gtkicontheme.h', + 'gtkiconview.h', + 'gtkimage.h', + 'gtkimcontext.h', + 'gtkimcontextinfo.h', + 'gtkimcontextsimple.h', + 'gtkimmodule.h', + 'gtkimmulticontext.h', + 'gtkinfobar.h', + 'gtkinvisible.h', + 'gtklabel.h', + 'gtklayout.h', + 'gtklevelbar.h', + 'gtklinkbutton.h', + 'gtklistbox.h', + 'gtkliststore.h', + 'gtklockbutton.h', + 'gtkmain.h', + 'gtkmenu.h', + 'gtkmenubar.h', + 'gtkmenubutton.h', + 'gtkmenuitem.h', + 'gtkmenushell.h', + 'gtkmenutoolbutton.h', + 'gtkmessagedialog.h', + 'gtkmodelbutton.h', + 'gtkmodules.h', + 'gtkmountoperation.h', + 'gtknativedialog.h', + 'gtknotebook.h', + 'gtkoffscreenwindow.h', + 'gtkorientable.h', + 'gtkoverlay.h', + 'gtkpadcontroller.h', + 'gtkpagesetup.h', + 'gtkpaned.h', + 'gtkpapersize.h', + 'gtkplacessidebar.h', + 'gtkplug.h', + 'gtkpopover.h', + 'gtkpopovermenu.h', + 'gtkprintcontext.h', + 'gtkprintoperation.h', + 'gtkprintoperationpreview.h', + 'gtkprintsettings.h', + 'gtkprogressbar.h', + 'gtkradiobutton.h', + 'gtkradiomenuitem.h', + 'gtkradiotoolbutton.h', + 'gtkrange.h', + 'gtkrecentchooser.h', + 'gtkrecentchooserdialog.h', + 'gtkrecentchoosermenu.h', + 'gtkrecentchooserwidget.h', + 'gtkrecentfilter.h', + 'gtkrecentmanager.h', + 'gtkrender.h', + 'gtkrevealer.h', + 'gtkscale.h', + 'gtkscalebutton.h', + 'gtkscrollable.h', + 'gtkscrollbar.h', + 'gtkscrolledwindow.h', + 'gtksearchbar.h', + 'gtksearchentry.h', + 'gtkselection.h', + 'gtkseparator.h', + 'gtkseparatormenuitem.h', + 'gtkseparatortoolitem.h', + 'gtksettings.h', + 'gtkshortcutlabel.h', + 'gtkshortcutsgroup.h', + 'gtkshortcutssection.h', + 'gtkshortcutsshortcut.h', + 'gtkshortcutswindow.h', + 'gtkshow.h', + 'gtkstacksidebar.h', + 'gtksizegroup.h', + 'gtksizerequest.h', + 'gtksocket.h', + 'gtkspinbutton.h', + 'gtkspinner.h', + 'gtkstack.h', + 'gtkstackswitcher.h', + 'gtkstatusbar.h', + 'gtkstylecontext.h', + 'gtkstyleprovider.h', + 'gtkswitch.h', + 'gtktestutils.h', + 'gtktextattributes.h', + 'gtktextbuffer.h', + 'gtktextbufferrichtext.h', + 'gtktextchild.h', + 'gtktextdisplay.h', + 'gtktextiter.h', + 'gtktextmark.h', + 'gtktexttag.h', + 'gtktexttagtable.h', + 'gtktextview.h', + 'gtktogglebutton.h', + 'gtktoggletoolbutton.h', + 'gtktoolbar.h', + 'gtktoolbutton.h', + 'gtktoolitem.h', + 'gtktoolitemgroup.h', + 'gtktoolpalette.h', + 'gtktoolshell.h', + 'gtktooltip.h', + 'gtktreednd.h', + 'gtktreemodel.h', + 'gtktreemodelfilter.h', + 'gtktreemodelsort.h', + 'gtktreeselection.h', + 'gtktreesortable.h', + 'gtktreestore.h', + 'gtktreeview.h', + 'gtktreeviewcolumn.h', + 'gtktypes.h', + 'gtkviewport.h', + 'gtkvolumebutton.h', + 'gtkwidget.h', + 'gtkwidgetpath.h', + 'gtkwindow.h', + 'gtkwindowgroup.h', +]) + +gtk_deprecated_type_headers = files([ + 'deprecated/gtkactivatable.h', + 'deprecated/gtkaction.h', + 'deprecated/gtkactiongroup.h', + 'deprecated/gtkalignment.h', + 'deprecated/gtkarrow.h', + 'deprecated/gtkcolorsel.h', + 'deprecated/gtkcolorseldialog.h', + 'deprecated/gtkfontsel.h', + 'deprecated/gtkgradient.h', + 'deprecated/gtkhandlebox.h', + 'deprecated/gtkhbbox.h', + 'deprecated/gtkhbox.h', + 'deprecated/gtkhpaned.h', + 'deprecated/gtkhscale.h', + 'deprecated/gtkhscrollbar.h', + 'deprecated/gtkhseparator.h', + 'deprecated/gtkhsv.h', + 'deprecated/gtkiconfactory.h', + 'deprecated/gtkimagemenuitem.h', + 'deprecated/gtkmisc.h', + 'deprecated/gtknumerableicon.h', + 'deprecated/gtkradioaction.h', + 'deprecated/gtkrc.h', + 'deprecated/gtkrecentaction.h', + 'deprecated/gtkstatusicon.h', + 'deprecated/gtkstock.h', + 'deprecated/gtkstyle.h', + 'deprecated/gtkstyleproperties.h', + 'deprecated/gtksymboliccolor.h', + 'deprecated/gtktable.h', + 'deprecated/gtktearoffmenuitem.h', + 'deprecated/gtkthemingengine.h', + 'deprecated/gtktoggleaction.h', + 'deprecated/gtkuimanager.h', + 'deprecated/gtkvbbox.h', + 'deprecated/gtkvbox.h', + 'deprecated/gtkvscale.h', + 'deprecated/gtkvscrollbar.h', + 'deprecated/gtkvseparator.h', + 'deprecated/gtkvpaned.h', +]) + +gtk_unix_sources = files([ + 'gtkcustompaperunixdialog.c', + 'gtkpagesetupunixdialog.c', + 'gtkprinter.c', + 'gtkprinteroption.c', + 'gtkprinteroptionset.c', + 'gtkprinteroptionwidget.c', + 'gtkprintjob.c', + 'gtkprintoperation-unix.c', + 'gtkprintunixdialog.c', + 'gtkprintbackend.c', + 'gtksearchenginetracker.c', +]) + +gtkresources = gnome.compile_resources( + 'gtkresources', + 'gtk.gresource.xml', + source_dir: '.', + c_name: '_gtk', + extra_args: '--manual-register' +) + +gtk_x11_sources = files([ + 'gtkplug.c', + 'gtksocket.c', + 'gtkxembed.c', + 'deprecated/gtktrayicon-x11.c', + 'gtkapplication-x11.c', + 'gtkmountoperation-x11.c', +]) + +gtk_wayland_sources = files([ + 'gtkapplication-wayland.c' +]) + +dnd_sources = files([ + 'gtkclipboard.c', + 'gtkdnd.c' +]) + +gtk_use_wayland_or_x11_c_sources = files([ + 'gtkapplication-dbus.c' +]) + +gtk_dbus_src = gnome.gdbus_codegen('gtkdbusgenerated', 'gtkdbusinterfaces.xml', + interface_prefix: 'org.Gtk.', + namespace: '_Gtk') + +gtkmarshal_h = custom_target( + 'gtkmarshal_h', + output : 'gtkmarshalers.h', + input : 'gtkmarshalers.list', + command : [mkmarshal, glib_marshal, '_gtk_marshal', '@INPUT@', '@OUTPUT@'] +) + +gtkmarshal_c = custom_target( + 'gtkmarshal_c', + output : 'gtkmarshalers.c', + input : 'gtkmarshalers.list', + command : [mkmarshal, glib_marshal, '_gtk_marshal', '@INPUT@', '@OUTPUT@'] +) + + + +gtktypebuiltins_h = custom_target( + 'gtkypebuiltins_h', + output : 'gtktypebuiltins.h', + input : gtk_public_h_sources + gtk_deprecated_type_headers, + command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtktypebuiltins.h.template', '@OUTPUT@', '@INPUT@'] +) + +gtktypebuiltins_c = custom_target( + 'gtkypebuiltins_c', + output : 'gtktypebuiltins.c', + input : gtk_public_h_sources + gtk_deprecated_type_headers, + depends : gtktypebuiltins_h, + command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtktypebuiltins.c.template', '@OUTPUT@', '@INPUT@'] +) + +gtkprivatetypebuiltins_h = custom_target( + 'gtkprivateypebuiltins_h', + output : 'gtkprivatetypebuiltins.h', + input : gtk_private_type_headers, + command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtkprivatetypebuiltins.h.template', '@OUTPUT@', '@INPUT@'] +) + +gtkprivatetypebuiltins_c = custom_target( + 'gtkprivateypebuiltins_c', + output : 'gtkprivatetypebuiltins.c', + input : gtk_private_type_headers, + depends : [gtkprivatetypebuiltins_h, gtktypebuiltins_h], + command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtkprivatetypebuiltins.c.template', '@OUTPUT@', '@INPUT@'] +) + +gentypefuncs_prog = find_program('gentypefuncs.py') +# Generate gtktypefuncs.c +typefuncs = custom_target( + 'typefuncs', + depends: gdkenum_h, + output : 'gtktypefuncs.c', + input : gdk_headers + gtk_public_h_sources + gtk_deprecated_type_headers + gtk_private_h_sources + [gtktypebuiltins_h] + [gdkenum_h], + command: [gentypefuncs_prog, '@OUTPUT@', '@INPUT@'], + install: false, +) + +cdata = configuration_data() +cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +cdata.set('GTK_MICRO_VERSION', gtk_micro_version) +cdata.set('GTK_BINARY_AGE', gtk_binary_age) +cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) + +gtkversion = configure_file( + input : 'gtkversion.h.in', + output : 'gtkversion.h', + configuration: cdata +) + +gtk_cargs = [ + '-DGTK_COMPILATION', + '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED', + '-DGTK_BINARY_VERSION="' + gtk_binary_version + '"', + '-DGTK_HOST="' + host_machine.system() + '"', + '-DGTK_SYSCONFDIR="' + get_option('prefix') + '/etc"', + '-DGTK_DATADIR="' + get_option('datadir') + '"', + '-DGTK_DATA_PREFIX="'+ get_option('prefix') + '"', + '-DGTK_PRINT_BACKENDS="null"', +] + +gtk_sources += [ + gtk_dbus_src, + gtk_unix_sources, + gtk_deprecated_c_sources, + dnd_sources, + inspector_sources, + a11y_sources, + gtkresources, + gtkmarshal_c, + gtkprivatetypebuiltins_c, + gtktypebuiltins_c, +] + +gtk_deps = [ + gmodule_dep, + giounix_dep, + glib_dep, + atkbridge_dep, + pangocairo_dep, + pango_dep, + cairogobj_dep, + cairo_dep, + fontconfig_dep, + pixbuf_dep, + atk_dep, + epoxy_dep, + mlib, +] + +if x11_enabled + runcmd = run_command('pkg-config', '--variable=prefix', 'x11') + if runcmd.returncode() == 0 + gtk_cargs += '-DX11_DATA_PREFIX="' + runcmd.stdout().strip() + '"' + else + error('Could not get x11 data prefix via pkg-config.') + endif + + gtk_sources += [ + gtk_x11_sources, + gtk_use_wayland_or_x11_c_sources + ] + gtk_deps += [ + xi_dep, + x11_dep, + pangoft_dep + ] +endif + +if wayland_enabled + gtk_sources += [ + gtk_wayland_sources, + gtk_use_wayland_or_x11_c_sources + ] + gtk_deps += [ + pangoft_dep + ] +endif + +gnome.compile_schemas() + +libgtk = shared_library('gtk', + gtk_sources, + gtkmarshal_h, + c_args: gtk_cargs, + include_directories: [confinc, gdkinc, gtkinc], + dependencies: [gtk_deps, libgdk_dep], + install: true +) + +libgtk_dep = declare_dependency( + sources: [ + 'gtk.h', + gtkversion, + gtktypebuiltins_c, + gtktypebuiltins_h, + ], + dependencies: gtk_deps, + link_with: [libgtk, libgdk], + link_args: ['-Bsymbolic'], + include_directories: [confinc, gtkinc] +) + + + +####### Utils ###### +gtk_query_settings = executable( + 'gtk-query-settings', + 'gtk-query-settings.c', + dependencies: libgtk_dep, + install: true +) + +gtk_builder_tool = executable( + 'gtk-builder-tool', + 'gtk-builder-tool.c', + dependencies: libgtk_dep, + install: true +) + +gtk_update_icon_cache = executable( + 'gtk-update-icon-cache', + 'updateiconcache.c', + dependencies: libgtk_dep, + install: true +) + +# gtk_query_immodules = executable( + # 'gtk-query-immodules-3.0', + # 'queryimmodules.c', + # 'gtkutils.c', + # dependencies: libgtk_dep, + # install: true +# ) + +gtk_encode_symbolic_svg = executable( + 'gtk-encode-symbolic-svg', + 'encodesymbolic.c', + dependencies: libgtk_dep, + install: true +) + +gtk_launch = executable( + 'gtk-launch', + 'gtk-launch.c', + dependencies: libgtk_dep, + install: true +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..e3d9ec4eca --- /dev/null +++ b/meson.build @@ -0,0 +1,266 @@ +project('gtk+-3.0', 'c', + version: '3.22.0', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=gnu89', + 'warning_level=1' + ], + license: 'LGPLv2.1+') + +gnome = import('gnome') + +add_global_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c') +add_global_arguments('-DG_ENABLE_DEBUG', language: 'c') +add_global_arguments('-DG_ENABLE_CONSISTENCY_CHECKS', language: 'c') + +gtk_version = meson.project_version().split('.') +gtk_major_version = gtk_version[0].to_int() +gtk_minor_version = gtk_version[1].to_int() +gtk_micro_version = gtk_version[2].to_int() +gtk_interface_age = 0 +add_global_arguments('-DGTK_VERSION="' + meson.project_version() + '"', language: 'c') + +# Define a string for the earliest version that this release has +# backwards binary compatibility with for all interfaces a module +# might. Unless we add module-only API with lower stability +# guarantees, this should be unchanged until we break binary compat +# for GTK+. +gtk_binary_version = '3.0.0' + +gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version +gtk_api_version = '@0@.0'.format(gtk_major_version) + +x11_enabled = get_option('enable-x11-backend') +wayland_enabled = get_option('enable-wayland-backend') +broadway_enabled = get_option('enable-broadway-backend') + + +mkmarshal = find_program('build_marshal.py') +glib_marshal = find_program('glib-genmarshal') +mkenum = find_program('build_enum.py') +perl = find_program('perl') +glib_mkenums = find_program('glib-mkenums') + +os_unix = false +os_linux = false +os_win32 = false +os_darwin = false + +if host_machine.system().contains('darwin') + os_darwin = true +elif host_machine.system().contains('mingw') + os_win32 = true +elif host_machine.system().contains('linux') + os_linux = true +endif + +os_unix = not os_win32 + + +cc = meson.get_compiler('c') +cdata = configuration_data() +cdata.set('PACKAGE_VERSION', '"'+meson.project_version()+'"') +cdata.set('GTK_LOCALEDIR', '"'+get_option('localedir')+'"') +cdata.set('GTK_DATADIR', '"'+get_option('datadir')+'"') +cdata.set('GTK_LIBDIR', '"'+get_option('libdir')+'"') +cdata.set('GETTEXT_PACKAGE', '"gtk30"') +cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +cdata.set('GTK_MICRO_VERSION', gtk_micro_version) +cdata.set('GTK_BINARY_AGE', gtk_binary_age) +cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) +check_headers = [ + ['HAVE_CRT_EXTERNS_H', 'crt/externs.h'], + ['HAVE_DLFCN_H', 'dlfcn.h'], + ['HAVE_FTW_H', 'ftw.h'], + ['HAVE_INTTYPES_H', 'inttypes.h'], + ['HAVE_LOCALE_H', 'locale.h'], + ['HAVE_MEMORY_H', 'memory.h'], + ['HAVE_STDINT_H', 'stdint.h'], + ['HAVE_STDLIB_H', 'stdlib.h'], + ['HAVE_STRINGS_H', 'strings.h'], + ['HAVE_STRING_H', 'string.h'], + ['HAVE_SYS_MMAN_H', 'sys/mman.h'], + ['HAVE_SYS_PARAM_H', 'sys/param.h'], + ['HAVE_SYS_STAT_H', 'sys/stat.h'], + ['HAVE_SYS_SYSINFO_H', 'sys/sysinfo.h'], + ['HAVE_SYS_SYSTEMINFO_H', 'sys/systeminfo.h'], + ['HAVE_SYS_TIME_H', 'sys/time.h'], + ['HAVE_SYS_TYPES_H', 'sys/types.h'], + ['HAVE_UNISTD_H', 'unistd.h'], + ['HAVE_LINUX_MEMFD_H', 'linux/memfd.h'], +] + +foreach h : check_headers + if cc.has_header(h.get(1)) + cdata.set(h.get(0), 1) + endif +endforeach + +check_functions = [ +# check token HAVE_BIND_TEXTDOMAIN_CODESET +# check token HAVE_CUPS_API_1_6 + ['HAVE_DCGETTEXT', 'dcgettext', '#include'], + ['HAVE_DECL_ISINF', 'isinf', '#include'], + ['HAVE_DECL_ISNAN', 'isnan', '#include'], + ['HAVE_GETPAGESIZE', 'getpagesize', '#include'], + ['HAVE_GETRESUID', 'getresuid', '#include'], +# check token HAVE_GETTEXT +# check token HAVE_GIO_UNIX +# check token HAVE_GNU_FTW +# check token HAVE_HTTPGETAUTHSTRING +# check token HAVE_HTTP_AUTHSTRING +# check token HAVE_IPRINTDIALOGCALLBACK +# check token HAVE_LC_MESSAGES +# check token HAVE_LOCALTIME_R + ['HAVE_LSTAT', 'lstat', '#include'], + ['HAVE_MMAP', 'mmap', '#include'], + ['HAVE_NEARBYINT', 'nearbyint', '#include'], + ['HAVE_POSIX_FALLOCATE', 'posix_fallocate', '#include'], + ['HAVE__LOCK_FILE', '_lock_file', '#include'], + ['HAVE_FLOCKFILE', 'flockfile', '#include'], + ['HAVE_MKSTEMP', 'mkstemp', '#include'], + ['HAVE_MALLINFO', 'mallinfo', '#include'], + ['HAVE_ROUND', 'round', '#include'], + ['HAVE_RINT', 'rint', '#include'], + ['HAVE_LOG2', 'log2', '#include'], + ['HAVE_EXP2', 'exp2', '#include'], + ['HAVE_SINCOS', 'sincos', '#include'], + ['HAVE_XKB', 'XkbQueryExtension', '#include'], +# check token HAVE_SOCKADDR_UN_SUN_LEN +# check token HAVE_SOLARIS_XINERAMA +# check token HAVE_XFREE_XINERAMA +# check token HAVE_XINERAMA +# check token HAVE__NL_MEASUREMENT_MEASUREMENT +# check token HAVE__NL_PAPER_HEIGHT +# check token HAVE__NL_PAPER_WIDTH +# check token HAVE__NL_TIME_FIRST_WEEKDAY +# check token HAVE__NSGETENVIRON +] +if x11_enabled +check_functions += [ + ['HAVE_XGENERICEVENTS', 'XGetEventData', '#include'], + ['HAVE_XSYNC', 'XSyncQueryExtension', '#include\n#include'] +] +endif + +foreach f : check_functions + if cc.has_function(f.get(1), prefix : f.get(2)) + cdata.set(f.get(0), 1) + endif +endforeach + +# +# Disable deprecation checks for all libraries we depend on on stable branches. +# This is so newer versions of those libraries don't cause more warnings with +# a stable GTK version. +# We don't ever want to turn off deprecation warnings for master however, because +# that's where we get rid of deprecated API we use. +if gtk_minor_version % 2 == 0 + cdata.set('GLIB_DISABLE_DEPRECATION_WARNINGS', 1) +endif + + +confinc = include_directories('.') +gdkinc = include_directories('gdk') +gtkinc = include_directories('gtk') + +glib_dep = dependency('glib-2.0', version: '>= 2.49.4') +giounix_dep = dependency('gio-unix-2.0', required : false) +pango_dep = dependency('pango', version: '>=1.37.3') +pangoft_dep = dependency('pangoft2', required: wayland_enabled or x11_enabled) +cairo_dep = dependency('cairo', version: '>= 1.14.0') +pangocairo_dep = dependency('pangocairo') +cairogobj_dep = dependency('cairo-gobject') +pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.30.0') +epoxy_dep = dependency('epoxy', version: '>= 1.0') +atk_dep = dependency('atk', version: '>= 2.15.1') +atkbridge_dep = dependency('atk-bridge-2.0') +gmodule_dep = dependency('gmodule-2.0') +colord_dep = dependency('colord', version: '>= 0.1.9', required: false) +fontconfig_dep = dependency('fontconfig') +harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false) +xkbdep = dependency('xkbcommon', version: '>= 0.2.0') + +if wayland_enabled + wlclientdep = dependency('wayland-client', version: '>= 1.9.91') + wlprotocolsdep = dependency('wayland-protocols', version: '>= 1.7') + wlcursordep = dependency('wayland-cursor', version: '>= 1.9.91') + wlegldep = dependency('wayland-egl') +endif + +if x11_enabled + xrandr_dep = dependency('xrandr', version: '>= 1.2.99') + xrandr15_dep = dependency('xrandr', version: '>= 1.5', required: false) + x11_dep = dependency('x11') + xrender_dep = dependency('xrender') + xi_dep = dependency('xi') + xext_dep = dependency('xext') + xcursor_dep = dependency('xcursor', required: false) + xdamage_dep = dependency('xdamage', required: false) + xfixes_dep = dependency('xfixes', required: false) + xcomposite_dep = dependency('xcomposite', required: false) + + + if xdamage_dep.found() + cdata.set('HAVE_XDAMAGE', 1) + endif + + if xcursor_dep.found() + cdata.set('HAVE_XCURSOR', 1) + endif + + if xcomposite_dep.found() + cdata.set('HAVE_XCOMPOSITE', 1) + endif + + if xfixes_dep.found() + cdata.set('HAVE_XFIXES', 1) + endif + + + + if xi_dep.found() and cc.has_header('X11/extensions/XInput2.h') + cdata.set('XINPUT_2', 1) + prefix = '#include\n#include' + if cc.has_function('XIAllowTouchEvents', prefix: prefix) and cc.has_member('XIScrollClassInfo', 'number', prefix: prefix) + cdata.set('XINPUT_2_2', 1) + endif + endif + + if xrandr_dep.found() + cdata.set('HAVE_RANDR', 1) + + if xrandr15_dep.found() + cdata.set('HAVE_RANDR15', 1) + endif + endif +endif + +mlib = cc.find_library('m', required: false) +shmlib = cc.find_library('rt') + +if giounix_dep.found() + cdata.set('HAVE_GIO_UNIX', 1) +endif + +if colord_dep.found() + cdata.set('HAVE_COLORD', 1) +endif + +if mlib.found() + cdata.set('HAVE_LIBM', 1) +endif + +configure_file( + input : 'config.h.meson', + output: 'config.h', + configuration: cdata +) + +subdir('gdk') +subdir('gtk') +subdir('demos') +subdir('tests') +subdir('testsuite') +subdir('examples') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..e8f8ee60e9 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('enable-x11-backend', type: 'boolean', value: 'true') +option('enable-wayland-backend', type: 'boolean', value: 'true') +option('enable-broadway-backend', type: 'boolean', value: 'false') diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000000..2fdc5ebd5d --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,212 @@ + +test_animated_resizing = executable('animated-resizing', + 'animated-resizing.c', + 'frame-stats.c', + 'frame-stats.h', + 'variable.c', + 'variable.h', + dependencies: libgtk_dep +) +test_animted_revealing = executable('animated-revealing', + 'animated-revealing.c', + 'frame-stats.c', + 'frame-stats.h', + 'variable.c', + 'variable.h', + dependencies: libgtk_dep +) +test_scrolling_performance = executable('scrolling-performance', + 'scrolling-performance.c', + 'frame-stats.c', + 'frame-stats.h', + 'variable.c', + 'variable.h', + dependencies: libgtk_dep +) +test_blur_performance = executable('blur-performance', + 'blur-performance.c', + '../gtk/gtkcairoblur.c', + dependencies: libgtk_dep +) +test_video_timer = executable('video-timer', + 'video-timer.c', + 'variable.c', + 'variable.h', + dependencies: libgtk_dep +) +test_print = executable('testprint', + 'testprint.c', + 'testprintfileoperation.c', + 'testprintfileoperation.h', + dependencies: libgtk_dep +) + +test_offscren = executable('testoffscreen', + 'testoffscreen.c', + 'gtkoffscreenbox.c', + 'gtkoffscreenbox.h', + dependencies: libgtk_dep +) +test_gdkgears = executable('gdkgears', + 'gdkgears.c', + 'gtkgears.c', + 'gtkgears.h', + dependencies: libgtk_dep +) +test_glblending = executable('testglblending', + 'testglblending.c', + 'gtkgears.c', + 'gtkgears.h', + dependencies: libgtk_dep +) + +test_boxcss = executable('testboxcss', 'testboxcss.c', dependencies: libgtk_dep) +test_entrycompletion = executable('testentrycompletion', 'testentrycompletion.c', dependencies: libgtk_dep) +test_entryicons = executable('testentryicons', 'testentryicons.c', dependencies: libgtk_dep) +test_filechooser = executable('testfilechooser', 'testfilechooser.c', dependencies: libgtk_dep) +test_filechooserbutton = executable('testfilechooserbutton', 'testfilechooserbutton.c', dependencies: libgtk_dep) +test_flowbox = executable('testflowbox', 'testflowbox.c', dependencies: libgtk_dep) +test_fontselection = executable('testfontselection', 'testfontselection.c', dependencies: libgtk_dep) +test_fontselectiondialog = executable('testfontselectiondialog', 'testfontselectiondialog.c', dependencies: libgtk_dep) +test_fontchooser = executable('testfontchooser', 'testfontchooser.c', dependencies: libgtk_dep) +test_fontoptions = executable('testfontoptions', 'testfontoptions.c', dependencies: libgtk_dep) +test_grid = executable('testgrid', 'testgrid.c', dependencies: libgtk_dep) +# TODO: Can't find the x11/gdkx.h +#test_gtk = executable('testgtk', 'testgtk.c', dependencies: libgtk_dep) +test_treechanging = executable('testtreechanging', 'testtreechanging.c', dependencies: libgtk_dep) +test_treednd = executable('testtreednd', 'testtreednd.c', dependencies: libgtk_dep) +test_treeedit = executable('testtreeedit', 'testtreeedit.c', dependencies: libgtk_dep) +test_treemodel = executable('testtreemodel', 'testtreemodel.c', dependencies: libgtk_dep) +test_treeview = executable('testtreeview', 'testtreeview.c', dependencies: libgtk_dep) +test_treefocus = executable('testtreefocus', 'testtreefocus.c', dependencies: libgtk_dep) +test_treeflow = executable('testtreeflow', 'testtreeflow.c', dependencies: libgtk_dep) +test_treecolumns = executable('testtreecolumns', 'testtreecolumns.c', dependencies: libgtk_dep) +test_treecolumnsizing = executable('testtreecolumnsizing', 'testtreecolumnsizing.c', dependencies: libgtk_dep) +test_treesort = executable('testtreesort', 'testtreesort.c', dependencies: libgtk_dep) +test_toolbar = executable('testtoolbar', 'testtoolbar.c', dependencies: libgtk_dep) +test_toolbar2 = executable('testtoolbar2', 'testtoolbar2.c', dependencies: libgtk_dep) +test_menubutton = executable('testmenubutton', 'testmenubutton.c', dependencies: libgtk_dep) +test_spinbutton = executable('testspinbutton', 'testspinbutton.c', dependencies: libgtk_dep) +test_statusicon = executable('teststatusicon', 'teststatusicon.c', dependencies: libgtk_dep) +test_merge = executable('testmerge', 'testmerge.c', dependencies: libgtk_dep) +test_actions = executable('testactions', 'testactions.c', dependencies: libgtk_dep) +test_baseline = executable('testbaseline', 'testbaseline.c', dependencies: libgtk_dep) +test_bbox = executable('testbbox', 'testbbox.c', dependencies: libgtk_dep) +test_buttons = executable('testbuttons', 'testbuttons.c', dependencies: libgtk_dep) +test_frame = executable('testframe', 'testframe.c', dependencies: libgtk_dep) +test_geometry = executable('testgeometry', 'testgeometry.c', dependencies: libgtk_dep) +test_giconpixbuf = executable('testgiconpixbuf', 'testgiconpixbuf.c', dependencies: libgtk_dep) +test_iconview = executable('testiconview', 'testiconview.c', dependencies: libgtk_dep) +test_iconview_keynav = executable('testiconview_keynav', 'testiconview-keynav.c', dependencies: libgtk_dep) +test_numerableicon = executable('testnumerableicon', 'testnumerableicon.c', dependencies: libgtk_dep) +test_recentchooser = executable('testrecentchooser', 'testrecentchooser.c', dependencies: libgtk_dep) +test_grouping = executable('testgrouping', 'testgrouping.c', dependencies: libgtk_dep) +test_tooltips = executable('testtooltips', 'testtooltips.c', dependencies: libgtk_dep) +test_recentchoosermenu = executable('testrecentchoosermenu', 'testrecentchoosermenu.c', dependencies: libgtk_dep) +test_volumebutton = executable('testvolumebutton', 'testvolumebutton.c', dependencies: libgtk_dep) +test_scrolledwindow = executable('testscrolledwindow', 'testscrolledwindow.c', dependencies: libgtk_dep) +test_cellarea = executable('testcellarea', 'testcellarea.c', dependencies: libgtk_dep) +test_treemenu = executable('testtreemenu', 'testtreemenu.c', dependencies: libgtk_dep) +test_offscreenwindow = executable('testoffscreenwindow', 'testoffscreenwindow.c', dependencies: libgtk_dep) +test_overlay = executable('testoverlay', 'testoverlay.c', dependencies: libgtk_dep) +test_overlaystyleclass = executable('testoverlaystyleclass', 'testoverlaystyleclass.c', dependencies: libgtk_dep) +test_appchooser = executable('testappchooser', 'testappchooser.c', dependencies: libgtk_dep) +test_windows = executable('testwindows', 'testwindows.c', dependencies: libgtk_dep) +test_expand = executable('testexpand', 'testexpand.c', dependencies: libgtk_dep) +test_expander = executable('testexpander', 'testexpander.c', dependencies: libgtk_dep) +test_switch = executable('testswitch', 'testswitch.c', dependencies: libgtk_dep) +test_styleexamples = executable('styleexamples', 'styleexamples.c', dependencies: libgtk_dep) +test_toplevelembed = executable('testtoplevelembed', 'testtoplevelembed.c', dependencies: libgtk_dep) +test_textview = executable('testtextview', 'testtextview.c', dependencies: libgtk_dep) +test_animation = executable('testanimation', 'testanimation.c', dependencies: libgtk_dep) +test_pixbuf_scale = executable('testpixbuf_scale', 'testpixbuf-scale.c', dependencies: libgtk_dep) +test_pixbuf_color = executable('testpixbuf_color', 'testpixbuf-color.c', dependencies: libgtk_dep) +test_pixbuf_save = executable('testpixbuf_save', 'testpixbuf-save.c', dependencies: libgtk_dep) +test_colorchooser = executable('testcolorchooser', 'testcolorchooser.c', dependencies: libgtk_dep) +test_colorchooser2 = executable('testcolorchooser2', 'testcolorchooser2.c', dependencies: libgtk_dep) +test_kineticscrolling = executable('testkineticscrolling', 'testkineticscrolling.c', dependencies: libgtk_dep) +test_stack = executable('teststack', 'teststack.c', dependencies: libgtk_dep) +test_revealer = executable('testrevealer', 'testrevealer.c', dependencies: libgtk_dep) +test_revealer2 = executable('testrevealer2', 'testrevealer2.c', dependencies: libgtk_dep) +test_titlebar = executable('testtitlebar', 'testtitlebar.c', dependencies: libgtk_dep) +test_windowsize = executable('testwindowsize', 'testwindowsize.c', dependencies: libgtk_dep) +test_listmodel = executable('listmodel', 'listmodel.c', dependencies: libgtk_dep) +test_popover = executable('testpopover', 'testpopover.c', dependencies: libgtk_dep) +test_cairo = executable('testcairo', 'testcairo.c', dependencies: libgtk_dep) +test_overlayscroll = executable('overlayscroll', 'overlayscroll.c', dependencies: libgtk_dep) +test_syncscroll = executable('syncscroll', 'syncscroll.c', dependencies: libgtk_dep) +test_subsurface = executable('subsurface', 'subsurface.c', dependencies: libgtk_dep) +test_motion_compression = executable('motion-compression', 'motion-compression.c', dependencies: libgtk_dep) +test_simple = executable('simple', 'simple.c', dependencies: libgtk_dep) +test_flicker = executable('flicker', 'flicker.c', dependencies: libgtk_dep) +test_print_editor = executable('print-editor', 'print-editor.c', dependencies: libgtk_dep) +test_accel = executable('testaccel', 'testaccel.c', dependencies: libgtk_dep) +test_adjustsize = executable('testadjustsize', 'testadjustsize.c', dependencies: libgtk_dep) +test_appchooserbutton = executable('testappchooserbutton', 'testappchooserbutton.c', dependencies: libgtk_dep) +test_assistant = executable('testassistant', 'testassistant.c', dependencies: libgtk_dep) +test_box = executable('testbox', 'testbox.c', dependencies: libgtk_dep) +test_calendar = executable('testcalendar', 'testcalendar.c', dependencies: libgtk_dep) +test_clipboard = executable('testclipboard', 'testclipboard.c', dependencies: libgtk_dep) +test_combo = executable('testcombo', 'testcombo.c', dependencies: libgtk_dep) +test_combochange = executable('testcombochange', 'testcombochange.c', dependencies: libgtk_dep) +test_cellrenderertext = executable('testcellrenderertext', 'testcellrenderertext.c', dependencies: libgtk_dep) +test_dialog = executable('testdialog', 'testdialog.c', dependencies: libgtk_dep) +test_dnd = executable('testdnd', 'testdnd.c', dependencies: libgtk_dep) +test_dnd2 = executable('testdnd2', 'testdnd2.c', dependencies: libgtk_dep) +test_ellipsise = executable('testellipsise', 'testellipsise.c', dependencies: libgtk_dep) +test_emblems = executable('testemblems', 'testemblems.c', dependencies: libgtk_dep) +test_fullscreen = executable('testfullscreen', 'testfullscreen.c', dependencies: libgtk_dep) +test_headerbar = executable('testheaderbar', 'testheaderbar.c', dependencies: libgtk_dep) +test_heightforwidth = executable('testheightforwidth', 'testheightforwidth.c', dependencies: libgtk_dep) +test_icontheme = executable('testicontheme', 'testicontheme.c', dependencies: libgtk_dep) +test_image = executable('testimage', 'testimage.c', dependencies: libgtk_dep) +test_input = executable('testinput', 'testinput.c', dependencies: libgtk_dep) +test_list = executable('testlist', 'testlist.c', dependencies: libgtk_dep) +test_list2 = executable('testlist2', 'testlist2.c', dependencies: libgtk_dep) +test_list3 = executable('testlist3', 'testlist3.c', dependencies: libgtk_dep) +test_levelbar = executable('testlevelbar', 'testlevelbar.c', dependencies: libgtk_dep) +test_lockbutton = executable('testlockbutton', 'testlockbutton.c', dependencies: libgtk_dep) +test_mountoperation = executable('testmountoperation', 'testmountoperation.c', dependencies: libgtk_dep) +test_multidisplay = executable('testmultidisplay', 'testmultidisplay.c', dependencies: libgtk_dep) +test_notebookdnd = executable('testnotebookdnd', 'testnotebookdnd.c', dependencies: libgtk_dep) +test_nouiprint = executable('testnouiprint', 'testnouiprint.c', dependencies: libgtk_dep) +test_orientable = executable('testorientable', 'testorientable.c', dependencies: libgtk_dep) +test_richtext = executable('testrichtext', 'testrichtext.c', dependencies: libgtk_dep) +test_scale = executable('testscale', 'testscale.c', dependencies: libgtk_dep) +test_selection = executable('testselection', 'testselection.c', dependencies: libgtk_dep) +test_selectionmode = executable('testselectionmode', 'testselectionmode.c', dependencies: libgtk_dep) +test_stockbuttonmenu = executable('teststockbuttonmenu', 'teststockbuttonmenu.c', dependencies: libgtk_dep) +test_stresstest_toolbar = executable('stresstest-oolbar', 'stresstest-toolbar.c', dependencies: libgtk_dep) +test_verticalcells = executable('testverticalcells', 'testverticalcells.c', dependencies: libgtk_dep) +test_treestoretest = executable('treestoretest', 'treestoretest.c', dependencies: libgtk_dep) +test_xinerama = executable('testxinerama', 'testxinerama.c', dependencies: libgtk_dep) +test_scrolledge = executable('testscrolledge', 'testscrolledge.c', dependencies: libgtk_dep) +test_noscreen = executable('testnoscreen', 'testnoscreen.c', dependencies: libgtk_dep) +test_treepos = executable('testtreepos', 'testtreepos.c', dependencies: libgtk_dep) +test_sensitive = executable('testsensitive', 'testsensitive.c', dependencies: libgtk_dep) +test_gmenu = executable('testgmenu', 'testgmenu.c', dependencies: libgtk_dep) +test_logout = executable('testlogout', 'testlogout.c', dependencies: libgtk_dep) +test_splitheaders = executable('testsplitheaders', 'testsplitheaders.c', dependencies: libgtk_dep) +test_actionbar = executable('testactionbar', 'testactionbar.c', dependencies: libgtk_dep) +test_popup = executable('testpopup', 'testpopup.c', dependencies: libgtk_dep) +test_popupat = executable('testpopupat', 'testpopupat.c', dependencies: libgtk_dep) + +# Conditionally compiled tests +if x11_enabled + test_socket = executable('testsocket', + 'testsocket.c', + 'testsocket_common.c', + dependencies: libgtk_dep + ) + test_socket_child = executable('testsocket_child', + 'testsocket_child.c', + 'testsocket_common.c', + dependencies: libgtk_dep + ) +endif + +if os_linux + test_fontchooserdialog = executable('testfontchooserdialog', 'testfontchooserdialog.c', dependencies: libgtk_dep) +endif + +subdir('visuals') diff --git a/tests/visuals/meson.build b/tests/visuals/meson.build new file mode 100644 index 0000000000..3aa3f9b9f5 --- /dev/null +++ b/tests/visuals/meson.build @@ -0,0 +1,6 @@ + +visuals = executable( + 'visuals', + 'visuals.c', + dependencies: libgtk_dep, +) diff --git a/testsuite/css/meson.build b/testsuite/css/meson.build new file mode 100644 index 0000000000..e90cd77c96 --- /dev/null +++ b/testsuite/css/meson.build @@ -0,0 +1,6 @@ +subdir('parser') +subdir('nodes') +subdir('style') + +test_api = executable('api', 'api.c', dependencies: libgtk_dep) +test('css/api', test_api) diff --git a/testsuite/css/nodes/meson.build b/testsuite/css/nodes/meson.build new file mode 100644 index 0000000000..a7d5050abd --- /dev/null +++ b/testsuite/css/nodes/meson.build @@ -0,0 +1,3 @@ + +test_nodes = executable('test-css-nodes', 'test-css-nodes.c', dependencies: libgtk_dep) +test('css/nodes/test-nodes', test_nodes) diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build new file mode 100644 index 0000000000..fee149a7c0 --- /dev/null +++ b/testsuite/css/parser/meson.build @@ -0,0 +1,3 @@ + +test_parser = executable('test-css-parser', 'test-css-parser.c', dependencies: libgtk_dep) +test('css/parser/css-parser', test_parser) diff --git a/testsuite/css/style/meson.build b/testsuite/css/style/meson.build new file mode 100644 index 0000000000..db3766a5e3 --- /dev/null +++ b/testsuite/css/style/meson.build @@ -0,0 +1,14 @@ + +cssresources = gnome.compile_resources( + 'cssresources', + 'test-css-style.gresource.xml', + source_dir: '.', +) + +test_style = executable( + 'test-css-style', + 'test-css-style.c', + cssresources, + dependencies: libgtk_dep, +) +test('css/style/test-style', test_style) diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build new file mode 100644 index 0000000000..6c33c5e165 --- /dev/null +++ b/testsuite/gdk/meson.build @@ -0,0 +1,24 @@ + +test_cairo = executable('cairo', 'cairo.c', dependencies: libgdk_dep) +test('gdk/cairo', test_cairo) + +test_display = executable('display', 'display.c', dependencies: libgdk_dep) +test('gdk/display', test_display) + +test_encoding = executable('encoding', 'encoding.c', dependencies: libgdk_dep) +test('gdk/encoding', test_encoding) + +test_keysyms = executable('keysyms', 'keysyms.c', dependencies: libgdk_dep) +test('gdk/keysyms', test_keysyms) + +test_rectangle = executable('rectangle', 'rectangle.c', dependencies: libgdk_dep) +test('gdk/rectangle', test_rectangle) + +test_rgba = executable('rgba', 'rgba.c', dependencies: libgdk_dep) +test('gdk/rgba', test_rgba) + +test_seat = executable('seat', 'seat.c', dependencies: libgdk_dep) +test('gdk/seat', test_seat) + +test_visual = executable('visual', 'visual.c', dependencies: libgdk_dep) +test('gdk/visual', test_visual) diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build new file mode 100644 index 0000000000..a11db7be76 --- /dev/null +++ b/testsuite/gtk/meson.build @@ -0,0 +1,150 @@ +test_accel = executable('accel', 'accel.c', dependencies: libgtk_dep) +test('gtk/accel test', test_accel) + +test_accessible = executable('accessible', 'accessible.c', dependencies: libgtk_dep) +test('gtk/accessible test', test_accessible) + +test_action = executable('action', 'action.c', dependencies: libgtk_dep) +test('gtk/action test', test_action) + + +test_adjustment = executable('adjustment', 'adjustment.c', dependencies: libgtk_dep) +test('gtk/adjustment test', test_adjustment) + +test_bitmask = executable('bitmask', 'bitmask.c', dependencies: libgtk_dep) +test('gtk/bitmask test', test_bitmask) + +test_builder = executable('builder', 'builder.c', dependencies: libgtk_dep) +test('gtk/builder test', test_builder) + +test_builderparser = executable( + 'builderparser', + 'builderparser.c', + dependencies: libgtk_dep, + link_with: libgtk, + +) +test( + 'gtk/builderparser test', + test_builderparser, + env: [ + 'G_TEST_SRCDIR='+meson.source_root(), + 'G_TEST_BUILDDIR='+meson.build_root() + ] +) + +test_cellarea = executable('cellarea', 'cellarea.c', dependencies: libgtk_dep) +test('gtk/cellarea test', test_cellarea) + +test_check_icon_names = executable('check_icon_names', 'check-icon-names.c', dependencies: libgtk_dep) +test('gtk/check_icon_names test', test_check_icon_names) + +test_check_cursor_names = executable('check_cursor_names', 'check-cursor-names.c', dependencies: libgtk_dep) +test('gtk/check_cursor_names test', test_check_cursor_names) + +test_clipboard = executable('clipboard', 'clipboard.c', dependencies: libgtk_dep) +test('gtk/clipboard test', test_clipboard) + +test_cssprovider = executable('cssprovider', 'cssprovider.c', dependencies: libgtk_dep) +test('gtk/cssprovider test', test_cssprovider) + +test_defaultvalue = executable('defaultvalue', 'defaultvalue.c', dependencies: libgtk_dep) +test('gtk/defaultvalue test', test_defaultvalue) + +test_entry = executable('entry', 'entry.c', dependencies: libgtk_dep) +test('gtk/entry test', test_entry) + +test_firefox_stylecontext = executable('firefox_stylecontext', 'firefox-stylecontext.c', dependencies: libgtk_dep) +test('gtk/firefox_stylecontext test', test_firefox_stylecontext) + +test_floating = executable('floating', 'floating.c', dependencies: libgtk_dep) +test('gtk/floating test', test_floating) + +test_focus = executable('focus', 'focus.c', dependencies: libgtk_dep) +test('gtk/focus test', test_focus) + +test_gestures = executable('gestures', 'gestures.c', dependencies: libgtk_dep) +test('gtk/gestures test', test_gestures) + +test_grid = executable('grid', 'grid.c', dependencies: libgtk_dep) +test('gtk/grid test', test_grid) + +test_gtkmenu = executable('gtkmenu', 'gtkmenu.c', dependencies: libgtk_dep) +test('gtk/gtkmenu test', test_gtkmenu) + +test_icontheme = executable('icontheme', 'icontheme.c', dependencies: libgtk_dep) +test('gtk/icontheme test', test_icontheme) + +test_keyhash = executable('keyhash', 'keyhash.c', dependencies: libgtk_dep) +test('gtk/keyhash test', test_keyhash) + +test_listbox = executable('listbox', 'listbox.c', dependencies: libgtk_dep) +test('gtk/listbox test', test_listbox) + +test_notify = executable('notify', 'notify.c', dependencies: libgtk_dep) +test('gtk/notify test', test_notify) + +test_no_gtk_init = executable('no_gtk_init', 'no-gtk-init.c', dependencies: libgtk_dep) +test('gtk/no_gtk_init test', test_no_gtk_init) + +test_object = executable('object', 'object.c', dependencies: libgtk_dep) +test('gtk/object test', test_object) + +test_objects_finalize = executable('objects_finalize', 'objects-finalize.c', dependencies: libgtk_dep) +test('gtk/objects_finalize test', test_objects_finalize) + +test_papersize = executable('papersize', 'papersize.c', dependencies: libgtk_dep) +test('gtk/papersize test', test_papersize) + +test_rbtree = executable('rbtree', 'rbtree.c', dependencies: libgtk_dep) +test('gtk/rbtree test', test_rbtree) + +test_recentmanager = executable('recentmanager', 'recentmanager.c', dependencies: libgtk_dep) +test('gtk/recentmanager test', test_recentmanager) + +test_regression_tests = executable('regression_tests', 'regression-tests.c', dependencies: libgtk_dep) +test('gtk/regression_tests test', test_regression_tests) + +test_scrolledwindow = executable('scrolledwindow', 'scrolledwindow.c', dependencies: libgtk_dep) +test('gtk/scrolledwindow test', test_scrolledwindow) + +test_spinbutton = executable('spinbutton', 'spinbutton.c', dependencies: libgtk_dep) +test('gtk/spinbutton test', test_spinbutton) + +test_stylecontext = executable('stylecontext', 'stylecontext.c', dependencies: libgtk_dep) +test('gtk/stylecontext test', test_stylecontext) + +test_templates = executable('templates', 'templates.c', dependencies: libgtk_dep) +test('gtk/templates test', test_templates) + +test_textbuffer = executable('textbuffer', 'textbuffer.c', dependencies: libgtk_dep) +test('gtk/textbuffer test', test_textbuffer) + +test_textiter = executable('textiter', 'textiter.c', dependencies: libgtk_dep) +test('gtk/textiter test', test_textiter) + +test_treemodel = executable( + 'treemodel', + 'treemodel.c', 'liststore.c', 'treestore.c', 'filtermodel.c', + 'modelrefcount.c', 'sortmodel.c', 'gtktreemodelrefcount.c', + dependencies: libgtk_dep +) +test('gtk/treemodel test', test_treemodel) + +test_treepath = executable('treepath', 'treepath.c', dependencies: libgtk_dep) +test('gtk/treepath test', test_treepath) + +test_treeview = executable('treeview', 'treeview.c', dependencies: libgtk_dep) +test('gtk/treeview test', test_treeview) + +test_typename = executable('typename', 'typename.c', dependencies: libgtk_dep) +test('gtk/typename test', test_typename) + +test_window = executable('window', 'window.c', dependencies: libgtk_dep) +test('gtk/window test', test_window) + +test_displayclose = executable('displayclose', 'displayclose.c', dependencies: libgtk_dep) +test('gtk/displayclose test', test_displayclose) + +test_revealer_size = executable('revealer_size', 'revealer-size.c', dependencies: libgtk_dep) +test('gtk/revealer_size test', test_revealer_size) diff --git a/testsuite/meson.build b/testsuite/meson.build new file mode 100644 index 0000000000..a3507d5e06 --- /dev/null +++ b/testsuite/meson.build @@ -0,0 +1,3 @@ +subdir('gtk') +subdir('gdk') +subdir('css') From 8caa9377392fe69b691bb4a31eb7d13234b1a385 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 21 Jul 2017 16:00:44 +0800 Subject: [PATCH 02/89] tests: Include system headers appropriately Don't include unistd.h on Windows, and include the appropriate headers on Windows as necessary. https://bugzilla.gnome.org/show_bug.cgi?id=773299 --- tests/testanimation.c | 5 ++++- testsuite/a11y/accessibility-dump.c | 4 ++++ testsuite/css/nodes/test-css-nodes.c | 4 ++++ testsuite/css/parser/test-css-parser.c | 4 ++++ testsuite/css/style/test-css-style.c | 4 ++++ testsuite/reftests/gtk-reftest.c | 4 ++++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/testanimation.c b/tests/testanimation.c index 356b8827d2..8bd43a6c66 100644 --- a/tests/testanimation.c +++ b/tests/testanimation.c @@ -19,11 +19,14 @@ #include "config.h" #include #include -#include #include #include #include +#ifndef G_OS_WIN32 +# include +#endif + typedef struct _LoadContext LoadContext; struct _LoadContext diff --git a/testsuite/a11y/accessibility-dump.c b/testsuite/a11y/accessibility-dump.c index 67747d4c05..2986f297f6 100644 --- a/testsuite/a11y/accessibility-dump.c +++ b/testsuite/a11y/accessibility-dump.c @@ -25,6 +25,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + #define DEPTH_INCREMENT 2 static char * diff --git a/testsuite/css/nodes/test-css-nodes.c b/testsuite/css/nodes/test-css-nodes.c index bb0b02cc48..334b60a11c 100644 --- a/testsuite/css/nodes/test-css-nodes.c +++ b/testsuite/css/nodes/test-css-nodes.c @@ -22,6 +22,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + static char * test_get_reference_file (const char *ui_file) diff --git a/testsuite/css/parser/test-css-parser.c b/testsuite/css/parser/test-css-parser.c index a5bb173075..c925d89bfa 100644 --- a/testsuite/css/parser/test-css-parser.c +++ b/testsuite/css/parser/test-css-parser.c @@ -26,6 +26,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + static char * test_get_reference_file (const char *css_file) { diff --git a/testsuite/css/style/test-css-style.c b/testsuite/css/style/test-css-style.c index 53fac070e5..0992223ac0 100644 --- a/testsuite/css/style/test-css-style.c +++ b/testsuite/css/style/test-css-style.c @@ -22,6 +22,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + /* There shall be no other styles */ #define GTK_STYLE_PROVIDER_PRIORITY_FORCE G_MAXUINT diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c index 4930af8184..6400b26ecf 100644 --- a/testsuite/reftests/gtk-reftest.c +++ b/testsuite/reftests/gtk-reftest.c @@ -28,6 +28,10 @@ #include #include +#ifdef G_OS_WIN32 +# include +#endif + typedef enum { SNAPSHOT_WINDOW, SNAPSHOT_DRAW From a4fe15d9f0c76862a5e3d5da9d3d71b12beef2fb Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 20 Nov 2018 01:37:09 +0530 Subject: [PATCH 03/89] meson: Sync build files with master and update to 3.24 --- build-aux/meson/post-install.sh | 26 + config.h.meson | 329 +++++++++++++ demos/gtk-demo/geninclude.py | 108 +++++ demos/gtk-demo/meson.build | 3 +- demos/icon-browser/meson.build | 1 - demos/widget-factory/meson.build | 1 - gdk/broadway/meson.build | 78 +++ gdk/gdkconfig.h.meson | 20 + gdk/gen-gdk-gresources-xml.py | 33 ++ gdk/meson.build | 329 +++++-------- gdk/quartz/meson.build | 51 ++ gdk/wayland/meson.build | 206 ++++---- gdk/win32/meson.build | 48 ++ gdk/x11/meson.build | 81 ++++ gtk/Makefile.am | 6 +- gtk/a11y/meson.build | 61 ++- gtk/deprecated/meson.build | 47 +- gtk/gen-gtk-gresources-xml.py | 89 ++++ gtk/gentypefuncs.py | 55 +++ gtk/gtktestutils.c | 2 +- gtk/inspector/meson.build | 4 +- gtk/meson.build | 632 ++++++++++++++---------- gtk/theme/Adwaita/meson.build | 30 ++ gtk/theme/HighContrast/meson.build | 29 ++ meson.build | 748 +++++++++++++++++++++++------ meson_options.txt | 42 +- modules/meson.build | 8 + testsuite/gdk/meson.build | 16 +- testsuite/gtk/meson.build | 239 ++++----- 29 files changed, 2432 insertions(+), 890 deletions(-) create mode 100755 build-aux/meson/post-install.sh create mode 100644 config.h.meson create mode 100755 demos/gtk-demo/geninclude.py create mode 100644 gdk/broadway/meson.build create mode 100644 gdk/gdkconfig.h.meson create mode 100644 gdk/gen-gdk-gresources-xml.py create mode 100644 gdk/quartz/meson.build create mode 100644 gdk/win32/meson.build create mode 100644 gdk/x11/meson.build create mode 100644 gtk/gen-gtk-gresources-xml.py create mode 100644 gtk/gentypefuncs.py create mode 100644 gtk/theme/Adwaita/meson.build create mode 100644 gtk/theme/HighContrast/meson.build create mode 100644 modules/meson.build diff --git a/build-aux/meson/post-install.sh b/build-aux/meson/post-install.sh new file mode 100755 index 0000000000..3471336bdb --- /dev/null +++ b/build-aux/meson/post-install.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +gtk_api_version=$1 +gtk_abi_version=$2 +gtk_libdir=$3 +gtk_datadir=$4 + +# Package managers set this so we don't need to run +if [ -z "$DESTDIR" ]; then + echo Compiling GSettings schemas... + glib-compile-schemas ${gtk_datadir}/glib-2.0/schemas + + echo Updating desktop database... + update-desktop-database -q ${gtk_datadir}/applications + + echo Updating icon cache... + gtk-update-icon-cache -q -t -f ${gtk_datadir}/icons/hicolor + + echo Updating module cache for print backends... + mkdir -p ${gtk_libdir}/gtk-3.0/3.0.0/printbackends + gio-querymodules ${gtk_libdir}/gtk-3.0/3.0.0/printbackends + + echo Updating module cache for input methods... + mkdir -p ${gtk_libdir}/gtk-3.0/3.0.0/immodules + gio-querymodules ${gtk_libdir}/gtk-3.0/3.0.0/immodules +fi diff --git a/config.h.meson b/config.h.meson new file mode 100644 index 0000000000..9fd690f966 --- /dev/null +++ b/config.h.meson @@ -0,0 +1,329 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* always defined to indicate that i18n is enabled */ +#mesondefine ENABLE_NLS + +/* The prefix for our gettext translation domains. */ +#mesondefine GETTEXT_PACKAGE + +/* Disable deprecation warnings from glib */ +#mesondefine GLIB_DISABLE_DEPRECATION_WARNINGS + +/* Define the location where the catalogs will be installed */ +#mesondefine GTK_LOCALEDIR + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#mesondefine HAVE_BIND_TEXTDOMAIN_CODESET + +/* define if we have colord */ +#mesondefine HAVE_COLORD + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_CRT_EXTERNS_H + +/* Define to 1 if CUPS 1.6 API is available */ +#mesondefine HAVE_CUPS_API_1_6 + +/* Define to 1 if you have the `dcgettext' function. */ +#mesondefine HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#mesondefine HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#mesondefine HAVE_DECL_ISNAN + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_FTW_H + +/* Define to 1 if you have the `getpagesize' function. */ +#mesondefine HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getresuid' function. */ +#mesondefine HAVE_GETRESUID + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#mesondefine HAVE_GETTEXT + +/* Define if gio-unix is available */ +#mesondefine HAVE_GIO_UNIX + +/* Have GNU ftw */ +#mesondefine HAVE_GNU_FTW + +/* Define to 1 if you have the `httpGetAuthString' function. */ +#mesondefine HAVE_HTTPGETAUTHSTRING + +/* Define if cups http_t authstring field is accessible */ +#mesondefine HAVE_HTTP_AUTHSTRING + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_INTTYPES_H + +/* Define to 1 if the system has the type `IPrintDialogCallback'. */ +#mesondefine HAVE_IPRINTDIALOGCALLBACK + +/* Define if your file defines LC_MESSAGES. */ +#mesondefine HAVE_LC_MESSAGES + +/* Define to 1 if you have the `m' library (-lm). */ +#mesondefine HAVE_LIBM + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_LOCALE_H + +/* Define to 1 if you have the `localtime_r' function. */ +#mesondefine HAVE_LOCALTIME_R + +/* Define to 1 if you have the `lstat' function. */ +#mesondefine HAVE_LSTAT + +/* Define to 1 if you have the `mallinfo' function. */ +#mesondefine HAVE_MALLINFO + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_MEMORY_H + +/* Define to 1 if you have the `mkstemp' function. */ +#mesondefine HAVE_MKSTEMP + +/* Define to 1 if you have a working `mmap' system call. */ +#mesondefine HAVE_MMAP + +/* Define to 1 if you have the `nearbyint' function. */ +#mesondefine HAVE_NEARBYINT + +/* Define to 1 if libpapi available */ +#mesondefine HAVE_PAPI + +/* Define to 1 if you have the `posix_fallocate' function. */ +#mesondefine HAVE_POSIX_FALLOCATE + +/* Have the Xrandr extension library */ +#mesondefine HAVE_RANDR + +/* Have the Xrandr 1.5 extension library */ +#mesondefine HAVE_RANDR15 + +/* Define to 1 if you have the `rint' function. */ +#mesondefine HAVE_RINT + +/* Define to 1 if you have the `round' function. */ +#mesondefine HAVE_ROUND + +/* Define to 1 if you have the `sincos' function. */ +#mesondefine HAVE_SINCOS + +/* Define to 1 if you have the `log2` function */ +#mesondefine HAVE_LOG2 + +/* Define to 1 if you ahve the `exp2` function */ +#mesondefine HAVE_EXP2 + +/* Have the sockaddr_un.sun_len member */ +#mesondefine HAVE_SOCKADDR_UN_SUN_LEN + +/* Define to 1 if solaris xinerama is available */ +#mesondefine HAVE_SOLARIS_XINERAMA + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_STAT_H + +/* Define to 1 if sys/sysinfo.h is available */ +#mesondefine HAVE_SYS_SYSINFO_H + +/* Define to 1 if sys/systeminfo.h is available */ +#mesondefine HAVE_SYS_SYSTEMINFO_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_UNISTD_H + +/* Have the XCOMPOSITE X extension */ +#mesondefine HAVE_XCOMPOSITE + +/* Have the Xcursor library */ +#mesondefine HAVE_XCURSOR + +/* Have the XDAMAGE X extension */ +#mesondefine HAVE_XDAMAGE + +/* Have the XFIXES X extension */ +#mesondefine HAVE_XFIXES + +/* Define to 1 if XFree Xinerama is available */ +#mesondefine HAVE_XFREE_XINERAMA + +/* Have XGenericEvent */ +#mesondefine HAVE_XGENERICEVENTS + +/* Define to 1 if xinerama is available */ +#mesondefine HAVE_XINERAMA + +/* Define to use XKB extension */ +#mesondefine HAVE_XKB + +/* Have the SYNC extension library */ +#mesondefine HAVE_XSYNC + +/* Define to 1 if you have the `_lock_file' function */ +#mesondefine HAVE__LOCK_FILE + +/* Define to 1 if you have the `flockfile' function */ +#mesondefine HAVE_FLOCKFILE + +/* Define if _NL_MEASUREMENT_MEASUREMENT is available */ +#mesondefine HAVE__NL_MEASUREMENT_MEASUREMENT + +/* Define if _NL_PAPER_HEIGHT is available */ +#mesondefine HAVE__NL_PAPER_HEIGHT + +/* Define if _NL_PAPER_WIDTH is available */ +#mesondefine HAVE__NL_PAPER_WIDTH + +/* Define if _NL_TIME_FIRST_WEEKDAY is available */ +#mesondefine HAVE__NL_TIME_FIRST_WEEKDAY + +/* Define to 1 if you have the `_NSGetEnviron' function. */ +#mesondefine HAVE__NSGETENVIRON + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#mesondefine LT_OBJDIR + +/* Define if needed for xReply */ +#mesondefine NEED_XIPROTO_H_FOR_XREPLY + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#mesondefine NO_MINUS_C_MINUS_O + +/* Define to the address where bug reports for this package should be sent. */ +#mesondefine PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#mesondefine PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#mesondefine PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#mesondefine PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#mesondefine PACKAGE_URL + +/* Define to the version of this package. */ +#mesondefine PACKAGE_VERSION + +/* Use NSBundle functions to determine load paths for libraries, translations, + etc. */ +#mesondefine QUARTZ_RELOCATION + +/* Define to 1 if you have the ANSI C header files. */ +#mesondefine STDC_HEADERS + +/* Define to 1 if gmodule works and should be used */ +#mesondefine USE_GMODULE + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define to 1 if XInput 2.0 is available */ +#mesondefine XINPUT_2 + +/* Define to 1 if XInput 2.2 is available */ +#mesondefine XINPUT_2_2 + +/* Define to 1 if the X Window System is missing or not being used. */ +#mesondefine X_DISPLAY_MISSING + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#mesondefine _FILE_OFFSET_BITS + +/* defines how to decorate public symbols while building */ +#mesondefine _GDK_EXTERN + +/* Define for large files, on AIX-style hosts. */ +#mesondefine _LARGE_FILES + +/* Define to 1 if on MINIX. */ +#mesondefine _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#mesondefine _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#mesondefine _POSIX_SOURCE + +/* Define to `int' if doesn't define. */ +#mesondefine gid_t + +/* Define to `int' if doesn't define. */ +#mesondefine uid_t + +/* Define to 1 if linux/memfd.h exists */ +#mesondefine HAVE_LINUX_MEMFD_H + +#mesondefine GTK_LOCALEDIR + +#mesondefine GTK_DATADIR + +#mesondefine GTK_LIBDIR + +#mesondefine HAVE_LINUX_INPUT_H + +#mesondefine HAVE_DEV_EVDEV_INPUT_H + +#mesondefine HAVE_TRUNC diff --git a/demos/gtk-demo/geninclude.py b/demos/gtk-demo/geninclude.py new file mode 100755 index 0000000000..57038a43b8 --- /dev/null +++ b/demos/gtk-demo/geninclude.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +import re +import os +from collections import * + +out_file = sys.argv[1] +in_files = sys.argv[2:] + + +file_output = """ +typedef GtkWidget *(*GDoDemoFunc) (GtkWidget *do_widget); + +typedef struct _Demo Demo; + +struct _Demo +{ + gchar *name; + gchar *title; + gchar *filename; + GDoDemoFunc func; + Demo *children; +}; + +""" + +# Demo = namedtuple('Demo', ['name', 'title', 'file', 'func']) + +demos = [] + +for demo_file in in_files: + filename = demo_file[demo_file.rfind('/')+1:] + demo_name = filename.replace(".c", "") + with open(demo_file, 'r') as f: + title = f.readline().replace("/*", "").strip() + + + file_output += "GtkWidget *do_" + demo_name + " (GtkWidget *do_widget);\n" + # demos += Demo(name = demo_name, + # title = title, + # file = demo_file, + # func = "do_" + title) + demos.append((demo_name, title, filename, "do_" + demo_name, -1)) + +# Generate a List of "Parent names" +parents = [] +parent_ids = [] +parent_index = 0 +for demo in demos: + if "/" in demo[1]: + slash_index = demo[1].index('/') + parent_name = demo[1][:slash_index] + do_break = False + + # Check for duplicates + if not parent_name in parents: + parents.append(parent_name) + parent_ids.append(parent_index) + demos.append(("NULL", parent_name, "NULL", "NULL", parent_index)) + + parent_index = parent_index + 1 + + +# For every child with a parent, generate a list of child demos +i = 0 +for parent in parents: + id = parent_ids[i] + file_output += "\nDemo child" + str(id) + "[] = {\n" + # iterate over all demos and check if the name starts with the given parent name + for child in demos: + if child[1].startswith(parent + "/"): + title = child[1][child[1].rfind('/') + 1:] + file_output += " { \"" + child[0] + "\", \"" + title + "\", \"" + child[2] + "\", " + child[3] + ", NULL },\n" + + + file_output += " { NULL }\n};\n" + i = i + 1 + + +# Sort demos by title +demos = sorted(demos, key=lambda x: x[1]) + +file_output += "\nDemo gtk_demos[] = {\n" +for demo in demos: + # Do not generate one of these for demos with a parent demo + if "/" not in demo[1]: + child_array = "NULL" + name = demo[0]; + title = demo[1]; + file = demo[2] + if name != "NULL": + name = "\"" + name + "\"" + if title != "NULL": + title = "\"" + title + "\"" + if file != "NULL": + file = "\"" + file + "\"" + + if demo[4] != -1: + child_array = "child" + str(demo[4]) + file_output += " { " + name + ", " + title + ", " + file + ", " + demo[3] + ", " + child_array + " },\n" + +file_output += " { NULL }\n};\n" + +ofile = open(out_file, "w") +ofile.write(file_output) +ofile.close() diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build index ee44a8530f..4a4489231a 100644 --- a/demos/gtk-demo/meson.build +++ b/demos/gtk-demo/meson.build @@ -75,7 +75,7 @@ gtkdemo_deps = [libgtk_dep] if harfbuzz_dep.found() and pangoft_dep.found() demos += files('font_features.c') - gtkdemo_deps += harfbuzz_dep + gtkdemo_deps += [harfbuzz_dep, pangoft_dep] endif if os_unix @@ -108,6 +108,5 @@ gtkdemo = executable( gtkdemo_resources, dependencies: gtkdemo_deps, include_directories : confinc, - gui_app: true, install: true ) diff --git a/demos/icon-browser/meson.build b/demos/icon-browser/meson.build index 661e5208c8..8bd7e9e5bb 100644 --- a/demos/icon-browser/meson.build +++ b/demos/icon-browser/meson.build @@ -17,6 +17,5 @@ iconbrowser = executable( iconbrowser_resources, dependencies: libgtk_dep, include_directories : confinc, - gui_app: true, install: true ) diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build index 170a59e4bc..184a8abbb4 100644 --- a/demos/widget-factory/meson.build +++ b/demos/widget-factory/meson.build @@ -15,6 +15,5 @@ widget_factory = executable( widgetfactory_resources, dependencies: libgtk_dep, include_directories : confinc, - gui_app: true, install: true ) diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build new file mode 100644 index 0000000000..57e3488786 --- /dev/null +++ b/gdk/broadway/meson.build @@ -0,0 +1,78 @@ +gdk_broadway_sources = files( + 'gdkcursor-broadway.c', + 'gdkdevice-broadway.c', + 'gdkdevicemanager-broadway.c', + 'gdkdisplay-broadway.c', + 'gdkdnd-broadway.c', + 'gdkeventsource.c', + 'gdkglobals-broadway.c', + 'gdkkeys-broadway.c', + 'gdkmonitor-broadway.c', + 'gdkproperty-broadway.c', + 'gdkscreen-broadway.c', + 'gdkselection-broadway.c', + 'gdktestutils-broadway.c', + 'gdkvisual-broadway.c', + 'gdkwindow-broadway.c', + 'gdkbroadway-server.c', +) + +gdk_broadway_public_headers = files( + 'gdkbroadwaydisplay.h', + 'gdkbroadwaysurface.h', + 'gdkbroadwaycursor.h', + 'gdkbroadwaymonitor.h', +) + +# Broadway backend headers aren't installed it seems +#install_headers(gdk_broadway_public_headers, subdir: 'gtk-4.0/gdk/broadway/') +#install_headers('gdkbroadway.h', subdir: 'gtk-4.0/gdk/') + +gdk_broadway_deps = [shmlib] + +gen_c_array = find_program('gen-c-array.py') + +clienthtml_h = custom_target('clienthtml.h', + input : 'client.html', + output : 'clienthtml.h', + command : [ + gen_c_array, + '--array-name=client_html', + '--output=@OUTPUT@', + '@INPUT@', + ], +) + +broadwayjs_h = custom_target('broadwayjs.h', + input : ['broadway.js'], + output : 'broadwayjs.h', + command : [ + gen_c_array, + '--array-name=broadway_js', + '--output=@OUTPUT@', + '@INPUT0@', + ], +) + +libgdk_broadway = static_library('gdk-broadway', + clienthtml_h, broadwayjs_h, + gdk_broadway_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_args: common_ldflags, + dependencies: [gdk_deps, gdk_broadway_deps]) + +# gtk4-broadwayd + +broadwayd_syslib = os_win32 ? find_library('ws2_32') : shmlib + +executable('broadwayd', + clienthtml_h, broadwayjs_h, + 'broadwayd.c', 'broadway-server.c', 'broadway-output.c', + include_directories: [confinc, gdkinc, include_directories('.')], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ], + dependencies : [broadwayd_syslib, gdk_deps], + install : true) diff --git a/gdk/gdkconfig.h.meson b/gdk/gdkconfig.h.meson new file mode 100644 index 0000000000..14f9e8e1ae --- /dev/null +++ b/gdk/gdkconfig.h.meson @@ -0,0 +1,20 @@ +#ifndef __GDKCONFIG_H__ +#define __GDKCONFIG_H__ + +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + + +#mesondefine GDK_WINDOWING_X11 +#mesondefine GDK_WINDOWING_BROADWAY +#mesondefine GDK_WINDOWING_WAYLAND +#mesondefine GDK_WINDOWING_WIN32 + +G_END_DECLS + +#endif /* __GDKCONFIG_H__ */ diff --git a/gdk/gen-gdk-gresources-xml.py b/gdk/gen-gdk-gresources-xml.py new file mode 100644 index 0000000000..694a9159aa --- /dev/null +++ b/gdk/gen-gdk-gresources-xml.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# +# Generate gdk.gresources.xml +# +# Usage: gen-gdk-gresources-xml SRCDIR_GDK [OUTPUT-FILE] + +import os, sys + +srcdir = sys.argv[1] + +xml = ''' + + + +''' + +def get_files(subdir,extension): + return sorted(filter(lambda x: x.endswith((extension)), os.listdir(os.path.join(srcdir,subdir)))) + +for f in get_files('resources/glsl', '.glsl'): + xml += ' resources/glsl/{0}\n'.format(f) + +xml += ''' + +''' + +if len(sys.argv) > 2: + outfile = sys.argv[2] + f = open(outfile, 'w') + f.write(xml) + f.close() +else: + print(xml) diff --git a/gdk/meson.build b/gdk/meson.build index cd5d4cbe2f..e9e7b8a819 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -1,5 +1,5 @@ -deprecated_gdk_sources = ['deprecated/gdkcolor.c'] -gdk_sources = files([ +deprecated_gdk_sources = files('deprecated/gdkcolor.c') +gdk_sources = files( 'gdk-private.c', 'gdk.c', 'gdkapplaunchcontext.c', @@ -37,9 +37,9 @@ gdk_sources = files([ 'gdkdevicetool.c', 'gdkdrawingcontext.c', 'gdkmonitor.c' -]) +) -gdk_public_h_sources = files([ +gdk_public_headers = files( 'gdk.h', 'gdk-autocleanup.h', 'gdkapplaunchcontext.h', @@ -58,6 +58,7 @@ gdk_public_h_sources = files([ 'gdkglcontext.h', 'gdkkeys.h', 'gdkkeysyms.h', + 'gdkkeysyms-compat.h', 'gdkmain.h', 'gdkmonitor.h', 'gdkpango.h', @@ -75,227 +76,125 @@ gdk_public_h_sources = files([ 'gdktypes.h', 'gdkvisual.h', 'gdkwindow.h', -]) +) +install_headers(gdk_public_headers, subdir : 'gtk-3.0/gdk') -gdk_private_h_sources = files([ +deprecated_h_sources = files('deprecated/gdkcolor.h') +install_headers(deprecated_h_sources, subdir : 'gtk-3.0/gdk/deprecated') + +# This variable is unused, but added just for completeness +gdk_private_headers = files( 'gdkseatdefaultprivate.h', 'gdkdevicetoolprivate.h', 'gdkdrawingcontextprivate.h', 'gdkmonitorprivate.h', 'gdkprivate.h', -]) +) -gdk_x_sources = [ - 'x11/MwmUtil.h', - 'x11/gdkapplaunchcontext-x11.c', - 'x11/gdkasync.c', - 'x11/gdkasync.h', - 'x11/gdkcursor-x11.c', - 'x11/gdkdevice-core-x11.c', - 'x11/gdkdevice-xi2.c', - 'x11/gdkdevicemanager-core-x11.c', - 'x11/gdkdevicemanager-x11.c', - 'x11/gdkdevicemanager-xi2.c', - 'x11/gdkdisplaymanager-x11.c', - 'x11/gdkdisplay-x11.c', - 'x11/gdkdisplay-x11.h', - 'x11/gdkdnd-x11.c', - 'x11/gdkeventsource.c', - 'x11/gdkeventsource.h', - 'x11/gdkeventtranslator.c', - 'x11/gdkeventtranslator.h', - 'x11/gdkgeometry-x11.c', - 'x11/gdkglcontext-x11.c', - 'x11/gdkglcontext-x11.h', - 'x11/gdkkeys-x11.c', - 'x11/gdkmain-x11.c', - 'x11/gdkproperty-x11.c', - 'x11/gdkscreen-x11.c', - 'x11/gdkscreen-x11.h', - 'x11/gdkselection-x11.c', - 'x11/gdktestutils-x11.c', - 'x11/gdkvisual-x11.c', - 'x11/gdkwindow-x11.c', - 'x11/gdkwindow-x11.h', - 'x11/gdkxftdefaults.c', - 'x11/gdkxid.c', - 'x11/gdkx.h', - 'x11/xsettings-client.h', - 'x11/xsettings-client.c', - 'x11/gdkmonitor-x11.c', - 'x11/gdkmonitor-x11.h', - 'x11/gdkx11monitor.h' -] - -gdk_x_private_sources = [ - 'x11/gdkprivate-x11.h', - 'x11/gdkdevicemanagerprivate-core.h', -] - -gdk_wayland_sources = files([ +gdk_wayland_sources = files( 'wayland/gdkapplaunchcontext-wayland.c', 'wayland/gdkcursor-wayland.c', 'wayland/gdkdevice-wayland.c', 'wayland/gdkdisplay-wayland.c', - 'wayland/gdkdisplay-wayland.h', 'wayland/gdkdnd-wayland.c', 'wayland/gdkeventsource.c', 'wayland/gdkglcontext-wayland.c', - 'wayland/gdkglcontext-wayland.h', 'wayland/gdkkeys-wayland.c', 'wayland/gdkmonitor-wayland.c', - 'wayland/gdkmonitor-wayland.h', 'wayland/gdkscreen-wayland.c', - 'wayland/gdkseat-wayland.h', 'wayland/gdkselection-wayland.c', - 'wayland/gdkwaylanddevice.h', - 'wayland/gdkwaylanddisplay.h', - 'wayland/gdkwaylandglcontext.h', - 'wayland/gdkwayland.h', - 'wayland/gdkwaylandmonitor.h', - 'wayland/gdkwaylandselection.h', - 'wayland/gdkwaylandwindow.h', 'wayland/gdkwindow-wayland.c', 'wayland/wm-button-layout-translation.c', -]) - -gdk_wayland_private_sources = files([ - 'wayland/gdkprivate-wayland.h', -]) - - +) gdk_broadway_sources = files([ 'broadway/gdkdisplay-broadway.c', - 'broadway/gdkdisplay-broadway.h', 'broadway/gdkscreen-broadway.c', - 'broadway/gdkscreen-broadway.h', 'broadway/broadway-output.c', - 'broadway/broadway-output.h', - 'broadway/broadway-server.h', 'broadway/broadway-server.c', 'broadway/gdkbroadway-server.c', 'broadway/gdkcursor-broadway.c', 'broadway/gdkvisual-broadway.c', 'broadway/gdkselection-broadway.c', 'broadway/gdkwindow-broadway.c', - 'broadway/gdkwindow-broadway.h', 'broadway/gdkmonitor-broadway.c', - 'broadway/gdkmonitor-broadway.h', 'broadway/gdkkeys-broadway.c', 'broadway/gdkglobals-broadway.c', 'broadway/gdkeventsource.c', - 'broadway/gdkeventsource.h', 'broadway/gdkdnd-broadway.c', 'broadway/broadwayd.c', 'broadway/gdkdevicemanager-broadway.c', - 'broadway/gdkdevicemanager-broadway.h', 'broadway/gdkdevice-broadway.c', - 'broadway/gdkdevice-broadway.h', 'broadway/broadway-buffer.c', - 'broadway/broadway-buffer.h', 'broadway/gdktestutils-broadway.c', 'broadway/gdkproperty-broadway.c' ]) -gdk_broadway_private_sources = files([ - 'broadway/gdkprivate-broadway.h' -]) +gdk_gresource_xml = configure_file(output : 'gdk.gresource.xml', + input : 'gen-gdk-gresources-xml.py', + command : [find_program('gen-gdk-gresources-xml.py'), + meson.current_source_dir(), '@OUTPUT@']) -# glsl_sources = [ - # 'gl3-texture-2d.fs.glsl', - # 'gl3-texture-2d.vs.glsl', - # 'gl3-texture-rect.fs.glsl', - # 'gl3-texture-rect.vs.glsl', - # 'gl2-texture-2d.fs.glsl', - # 'gl2-texture-2d.fs.glsl', - # 'gl2-texture-rect.vs.glsl', - # 'gl2-texture-rect.vs.glsl', - # 'gles2-texture.fs.glsl', - # 'gles2-texture.vs.glsl', -# ] -# resource_xml = '' -# foreach glsl_file : glsl_sources - # resource_xml += ' resources/glsl/@0@\n'.format(glsl_file) -# endforeach - - -# cdata = configuration_data() -# cdata.set('GDK_GRESOURCE_XML_FILES', resource_xml) -# gdkresources_xml = configure_file( - # input : 'gdk.gresource.xml.meson', - # output : 'gdk.gresource.xml', - # configuration : cdata -# ) - -gdkresources = gnome.compile_resources( - 'gdkresources', - 'gdk.gresource.xml', +gdkresources = gnome.compile_resources('gdkresources', + gdk_gresource_xml, source_dir: '.', c_name: '_gdk', extra_args: '--manual-register' ) +gdk_headers = gdk_public_headers -deprecated_h_sources = files(['deprecated/gdkcolor.h']) +gdk_enums = gnome.mkenums('gdkenumtypes', + sources: gdk_public_headers, + c_template : 'gdkenumtypes.c.template', + h_template : 'gdkenumtypes.h.template', + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'), + install_header : true) -gdk_headers = gdk_public_h_sources + deprecated_h_sources + gdk_private_h_sources +gdkenum_h = gdk_enums[1] -gdkenum_h = custom_target( - 'gdkenum_h', - output : 'gdkenumtypes.h', - input : gdk_headers, - command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gdkenumtypes.h.template', '@OUTPUT@', '@INPUT@']) +gdk_marshalers = gnome.genmarshal('gdkmarshalers', + sources : 'gdkmarshalers.list', + prefix : '_gdk_marshal', + valist_marshallers : true) -gdkenum_c = custom_target( - 'gdkenum_c', - output : 'gdkenumtypes.c', - input : gdk_headers, - depends : gdkenum_h, - command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gdkenumtypes.c.template', '@OUTPUT@', '@INPUT@']) +gdkmarshal_h = gdk_marshalers[1] -gdkmarshal_h = custom_target( - 'gdkmarshal_h', - output : 'gdkmarshalers.h', - input : 'gdkmarshalers.list', - command : [mkmarshal, glib_marshal, '_gdk_marshal', '@INPUT@', '@OUTPUT@'] -) +gdkconfig_cdata = configuration_data() +gdkconfig_cdata.set('GDK_WINDOWING_X11', x11_enabled) +gdkconfig_cdata.set('GDK_WINDOWING_WAYLAND', wayland_enabled) +gdkconfig_cdata.set('GDK_WINDOWING_WIN32', win32_enabled) +gdkconfig_cdata.set('GDK_WINDOWING_BROADWAY', broadway_enabled) -gdkmarshal_c = custom_target( - 'gdkmarshal_c', - output : 'gdkmarshalers.c', - input : 'gdkmarshalers.list', - command : [mkmarshal, glib_marshal, '_gdk_marshal', '@INPUT@', '@OUTPUT@'] -) - -cdata = configuration_data() -cdata.set('GTK_MAJOR_VERSION', gtk_major_version) -cdata.set('GTK_MINOR_VERSION', gtk_minor_version) -cdata.set('GTK_MICRO_VERSION', gtk_micro_version) - - - -if x11_enabled cdata.set('GDK_WINDOWING_X11', '') endif -if wayland_enabled cdata.set('GDK_WINDOWING_WAYLAND', '') endif -if broadway_enabled cdata.set('GDK_WINDOWING_BROADWAY', '') endif gdkconfig = configure_file( input : 'gdkconfig.h.meson', output : 'gdkconfig.h', - configuration : cdata -) + configuration : gdkconfig_cdata, + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'), + install : true) + + +gdkversion_cdata = configuration_data() +gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version) gdkversionmacros = configure_file( input : 'gdkversionmacros.h.in', output : 'gdkversionmacros.h', - configuration: cdata -) + configuration: gdkversion_cdata, + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk')) + +gdkinc = include_directories('.') +gdkx11_inc = include_directories('x11') +gdkwayland_inc = include_directories('wayland') -xinc = include_directories('x11') wlinc = include_directories('.') +gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros] gdk_deps = [ - mlib, + libm, pixbuf_dep, cairo_dep, pango_dep, @@ -303,80 +202,74 @@ gdk_deps = [ glib_dep, epoxy_dep, fontconfig_dep, - giounix_dep, + platform_gio_dep, pangocairo_dep ] +if win32_enabled + gdk_deps += [cc.find_library('advapi32'), + cc.find_library('comctl32'), + cc.find_library('dwmapi'), + cc.find_library('imm32'), + cc.find_library('setupapi'), + cc.find_library('winmm')] +endif + gdk_sources = [ + # Generated gdkconfig, - gdk_sources, - deprecated_gdk_sources, - gdkenum_c, gdkenum_h, - gdkmarshal_c, gdkmarshal_h, + gdk_enums, + gdk_marshalers, gdkresources, gdkversionmacros, - gdk_headers + # Static + gdk_sources, + deprecated_gdk_sources, ] -if x11_enabled - gdk_deps += [ - xrender_dep, - xi_dep, - xext_dep, - x11_dep, - xcursor_dep, - xdamage_dep, - xfixes_dep, - xcomposite_dep, - xrandr_dep - ] - gdk_sources += [ - gdk_x_sources, - gdk_x_private_sources - ] +if wayland_enabled or broadway_enabled + if cc.has_function('shm_open') + shmlib = [] + elif cc.has_function('shm_open', args : '-lrt') + shmlib = cc.find_library('rt') + else + shmlib = [] + endif endif -if wayland_enabled - subdir('wayland') - gdk_deps += [ - shmlib, - xkbdep, - wlclientdep, - wlprotocolsdep, - wlcursordep, - wlegldep - ] - gdk_sources += [ - gdk_wayland_sources, - gdk_wayland_private_sources - ] +gdk_backends = [] +gdk_backends_gen_headers = [] # non-public generated headers +foreach backend : ['broadway', 'quartz', 'wayland', 'win32', 'x11'] + if get_variable('@0@_enabled'.format(backend)) + subdir(backend) + gdk_deps += get_variable('gdk_@0@_deps'.format(backend)) + gdk_backends += get_variable('libgdk_@0@'.format(backend)) + # Special-case this for now to work around Meson bug with get_variable() + # fallback being an empty array, or any array (#1481) + if backend == 'wayland' + gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend)) + endif + endif +endforeach + +if gdk_backends.length() == 0 + error('No backends enabled') endif -if broadway_enabled - gdk_deps += [ - shmlib, - ] - gdk_sources += [ - gdk_broadway_sources, - gdk_broadway_private_sources - ] -endif - - -libgdk = shared_library('gdk', - sources: [gdk_sources, gdkconfig, gdkenum_h], - c_args: ['-DHAVE_CONFIG_H', '-DGDK_COMPILATION'], - include_directories: [confinc, xinc, wlinc], - dependencies: gdk_deps, - install: true -) - +libgdk = shared_library('gdk-3', + sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig], + dependencies: gdk_deps, + include_directories: [confinc, gdkx11_inc, wlinc], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_whole: gdk_backends, + link_args: common_ldflags, + install: true) libgdk_dep = declare_dependency( - sources: ['gdk.h', gdkconfig, gdkenum_h], - depends: gdk_sources, - include_directories: [confinc, xinc, wlinc], - dependencies: gdk_deps, link_with: libgdk, - link_args: ['-Bsymbolic'], -) + sources: ['gdk.h', gdkconfig, gdkenum_h], + include_directories: [confinc, gdkx11_inc, wlinc], + dependencies: gdk_deps) diff --git a/gdk/quartz/meson.build b/gdk/quartz/meson.build new file mode 100644 index 0000000000..8c1b8d1795 --- /dev/null +++ b/gdk/quartz/meson.build @@ -0,0 +1,51 @@ +# FIXME: do we need to do an add_language() for objective-c here? +gdk_quartz_sources = files( + 'GdkQuartzView.c', + 'GdkQuartzNSWindow.c', + 'gdkcursor-quartz.c', + 'gdkdevice-core-quartz.c', + 'gdkdevicemanager-core-quartz.c', + 'gdkdisplay-quartz.c', + 'gdkdisplaymanager-quartz.c', + 'gdkdnd-quartz.c', + 'gdkevents-quartz.c', + 'gdkeventloop-quartz.c', + 'gdkglcontext-quartz.c', + 'gdkglobals-quartz.c', + 'gdkkeys-quartz.c', + 'gdkmonitor-quartz.c', + 'gdkproperty-quartz.c', + 'gdkscreen-quartz.c', + 'gdkselection-quartz.c', + 'gdktestutils-quartz.c', + 'gdkutils-quartz.c', + 'gdkvisual-quartz.c', + 'gdkwindow-quartz.c', +) + +gdk_quartz_public_headers = files( + 'gdkquartzcursor.h', + 'gdkquartzdevice-core.h', + 'gdkquartzdevicemanager-core.h', + 'gdkquartzdisplay.h', + 'gdkquartzdisplaymanager.h', + 'gdkquartzdnd.h', + 'gdkquartzkeys.h', + 'gdkquartzmonitor.h', + 'gdkquartzscreen.h', + 'gdkquartzutils.h', + 'gdkquartzvisual.h', + 'gdkquartzwindow.h', +) + +install_headers(gdk_quartz_public_headers, subdir: 'gtk-3.0/gdk/quartz') +install_headers('gdkquartz.h', subdir: 'gtk-3.0/gdk') + +gdk_quartz_deps = [ # FIXME +] + +libgdk_quartz = static_library('gdk-quartz', + gdk_quartz_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-xobjective-c'], + dependencies: [gdk_deps, gdk_quartz_deps]) diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build index 6783ecf193..559e02ba3d 100644 --- a/gdk/wayland/meson.build +++ b/gdk/wayland/meson.build @@ -1,115 +1,105 @@ +gdk_wayland_sources = files( + 'gdkapplaunchcontext-wayland.c', + 'gdkcursor-wayland.c', + 'gdkdevice-wayland.c', + 'gdkdisplay-wayland.c', + 'gdkdnd-wayland.c', + 'gdkeventsource.c', + 'gdkkeys-wayland.c', + 'gdkglcontext-wayland.c', + 'gdkmonitor-wayland.c', + 'gdkscreen-wayland.c', + 'gdkselection-wayland.c', + 'gdkwindow-wayland.c', + 'wm-button-layout-translation.c', +) +gdk_wayland_public_headers = files( + 'gdkwaylanddevice.h', + 'gdkwaylanddisplay.h', + 'gdkwaylandglcontext.h', + 'gdkwaylandmonitor.h', + 'gdkwaylandselection.h', + 'gdkwaylandwindow.h', +) -if wayland_enabled - runcmd = run_command('pkg-config', '--variable=pkgdatadir', 'wayland-protocols') - if runcmd.returncode() == 0 - wayland_protocols_datadir = runcmd.stdout().strip() + '/' +install_headers(gdk_wayland_public_headers, subdir: 'gtk-3.0/gdk/wayland') +install_headers('gdkwayland.h', subdir: 'gtk-3.0/gdk') + +gdk_wayland_deps = [ + shmlib, + xkbdep, + wlclientdep, + wlprotocolsdep, + wlcursordep, + wlegldep, +] + +# wayland protocols +proto_dir = dependency('wayland-protocols').get_pkgconfig_variable('pkgdatadir') +assert(proto_dir != '', 'Could not get pkgdatadir from wayland-protocols.pc') + +wayland_scanner = find_program('wayland-scanner') + +# Format: +# - protocol name +# - protocol stability ('private', 'stable' or 'unstable') +# - protocol version (if stability is 'unstable') +proto_sources = [ + ['gtk-shell', 'private', ], + ['gtk-primary-selection', 'private', ], + ['pointer-gestures', 'unstable', 'v1', ], + ['xdg-shell', 'unstable', 'v6', ], + ['xdg-shell', 'stable', ], + ['xdg-foreign', 'unstable', 'v1', ], + ['tablet', 'unstable', 'v2', ], + ['keyboard-shortcuts-inhibit', 'unstable', 'v1', ], + ['server-decoration', 'private' ], +] + +gdk_wayland_gen_headers = [] + +foreach p: proto_sources + proto_name = p.get(0) + proto_stability = p.get(1) + + if proto_stability == 'stable' + output_base = proto_name + input = join_paths(proto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)) + elif proto_stability == 'private' + output_base = proto_name + input = 'protocol/@0@.xml'.format(proto_name) else - error('Could not get wayland-protocols pkgdatadir via pkg-config.') + proto_version = p.get(2) + output_base = '@0@-@1@-@2@'.format(proto_name, proto_stability, proto_version) + input = join_paths(proto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)) endif - wayland_scanner = find_program('wayland-scanner') - genprotocols = find_program('genprotocolfiles.py') + gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base), + input: input, + output: '@0@-client-protocol.h'.format(output_base), + command: [ + wayland_scanner, + 'client-header', + '@INPUT@', '@OUTPUT@', + ]) - gtk_shell_h = custom_target( - 'gtk shell protocol header', - input : 'protocol/gtk-shell.xml', - output : 'gtk-shell-client-protocol.h', - command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'client-header'] - ) + gdk_wayland_sources += custom_target('@0@ source'.format(output_base), + input: input, + output: '@0@-protocol.c'.format(output_base), + command: [ + wayland_scanner, + 'private-code', + '@INPUT@', '@OUTPUT@', + ]) +endforeach - gtk_shell_c = custom_target( - 'gtk shell protocol source', - input : 'protocol/gtk-shell.xml', - output : 'gtk-shell-protocol.c', - command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'code'] - ) - - pointer_gestures_h = custom_target( - 'pointer gestures header', - input : wayland_protocols_datadir + 'unstable/pointer-gestures/pointer-gestures-unstable-v1.xml', - output : 'pointer-gestures-unstable-v1-client-protocol.h', - command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'client-header'] - ) - - pointer_gestures_c = custom_target( - 'pointer gestures source', - input : wayland_protocols_datadir + 'unstable/pointer-gestures/pointer-gestures-unstable-v1.xml', - output : 'pointer-gestures-unstable-v1-protocol.c', - command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'code'] - ) - - primary_selection_h = custom_target( - 'primary selection header', - input : 'protocol/gtk-primary-selection.xml', - output : 'gtk-primary-selection-client-protocol.h', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] - ) - - primary_selection_c = custom_target( - 'primary selection source', - input : 'protocol/gtk-primary-selection.xml', - output : 'gtk-primary-selection-protocol.c', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] - ) - - xdg_shell_h = custom_target( - 'xdg shell v6 header', - input : wayland_protocols_datadir + 'unstable/xdg-shell/xdg-shell-unstable-v6.xml', - output : 'xdg-shell-unstable-v6-client-protocol.h', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] - ) - - xdg_shell_c = custom_target( - 'xdg shell v6 source', - input : wayland_protocols_datadir + 'unstable/xdg-shell/xdg-shell-unstable-v6.xml', - output : 'xdg-shell-unstable-v6-protocol.c', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] - ) - - xdg_foreign_h = custom_target( - 'xdg foreign v1 header', - input : wayland_protocols_datadir + 'unstable/xdg-foreign/xdg-foreign-unstable-v1.xml', - output : 'xdg-foreign-unstable-v1-client-protocol.h', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] - ) - - xdg_foreign_c = custom_target( - 'xdg foreign v1 source', - input : wayland_protocols_datadir + 'unstable/xdg-foreign/xdg-foreign-unstable-v1.xml', - output : 'xdg-foreign-unstable-v1-protocol.c', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] - ) - - tablet_h = custom_target( - 'tablet v2 header', - input : wayland_protocols_datadir + 'unstable/tablet/tablet-unstable-v2.xml', - output : 'tablet-unstable-v2-client-protocol.h', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'client-header'] - ) - - tablet_c = custom_target( - 'tablet v2 source', - input : wayland_protocols_datadir + 'unstable/tablet/tablet-unstable-v2.xml', - output : 'tablet-unstable-v2-protocol.c', - command: [genprotocols, wayland_scanner,'@INPUT@', '@OUTPUT@', 'code'] - ) - - - - gdk_sources += [ - gtk_shell_c, - gtk_shell_h, - pointer_gestures_h, - pointer_gestures_c, - primary_selection_h, - primary_selection_c, - xdg_shell_h, - xdg_shell_c, - xdg_foreign_h, - xdg_foreign_c, - tablet_h, - tablet_c - ] - -endif +libgdk_wayland = static_library('gdk-wayland', + gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h, + include_directories: [ confinc, gdkinc, ], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_args: common_ldflags, + dependencies: [ gdk_deps, gdk_wayland_deps, ]) diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build new file mode 100644 index 0000000000..343a9ff402 --- /dev/null +++ b/gdk/win32/meson.build @@ -0,0 +1,48 @@ +gdk_win32_sources = files( + 'gdkcursor-win32.c', + 'gdkdevicemanager-win32.c', + 'gdkdevice-virtual.c', + 'gdkdevice-win32.c', + 'gdkdevice-wintab.c', + 'gdkdisplay-win32.c', + 'gdkdisplaymanager-win32.c', + 'gdkdnd-win32.c', + 'gdkevents-win32.c', + 'gdkgeometry-win32.c', + 'gdkglcontext-win32.c', + 'gdkglobals-win32.c', + 'gdkkeys-win32.c', + 'gdkmain-win32.c', + 'gdkmonitor-win32.c', + 'gdkproperty-win32.c', + 'gdkscreen-win32.c', + 'gdkselection-win32.c', + 'gdktestutils-win32.c', + 'gdkwin32id.c', + 'gdkwindow-win32.c', +) + +gdk_win32_public_headers = files( + 'gdkwin32cursor.h', + 'gdkwin32display.h', + 'gdkwin32displaymanager.h', + 'gdkwin32dnd.h', + 'gdkwin32glcontext.h', + 'gdkwin32keys.h', + 'gdkwin32misc.h', + 'gdkwin32monitor.h', + 'gdkwin32screen.h', + 'gdkwin32window.h', +) + +install_headers(gdk_win32_public_headers, subdir: 'gtk-3.0/gdk/win32') +install_headers('gdkwin32.h', subdir: 'gtk-3.0/gdk') + +gdk_win32_deps = [ # FIXME +] + +libgdk_win32 = static_library('gdk-win32', + gdk_win32_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'], + dependencies: [gdk_deps, gdk_win32_deps]) diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build new file mode 100644 index 0000000000..c31a682d69 --- /dev/null +++ b/gdk/x11/meson.build @@ -0,0 +1,81 @@ +# Note: gdksettings.c gets included from xsettings-client.c, do not add here +gdk_x11_sources = files( + 'gdkapplaunchcontext-x11.c', + 'gdkasync.c', + 'gdkcursor-x11.c', + 'gdkdevice-core-x11.c', + 'gdkdevice-xi2.c', + 'gdkdevicemanager-core-x11.c', + 'gdkdevicemanager-x11.c', + 'gdkdevicemanager-xi2.c', + 'gdkdisplaymanager-x11.c', + 'gdkdisplay-x11.c', + 'gdkdnd-x11.c', + 'gdkeventsource.c', + 'gdkeventtranslator.c', + 'gdkgeometry-x11.c', + 'gdkglcontext-x11.c', + 'gdkkeys-x11.c', + 'gdkmain-x11.c', + 'gdkproperty-x11.c', + 'gdkscreen-x11.c', + 'gdkscreen-x11.h', + 'gdkselection-x11.c', + 'gdktestutils-x11.c', + 'gdkvisual-x11.c', + 'gdkwindow-x11.c', + 'gdkxftdefaults.c', + 'gdkxid.c', + 'xsettings-client.c', + 'gdkmonitor-x11.c', +) + +gdk_x11_public_headers = files( + 'gdkx-autocleanups.h', + 'gdkx11applaunchcontext.h', + 'gdkx11cursor.h', + 'gdkx11device.h', + 'gdkx11device-core.h', + 'gdkx11device-xi2.h', + 'gdkx11devicemanager.h', + 'gdkx11devicemanager-core.h', + 'gdkx11devicemanager-xi2.h', + 'gdkx11display.h', + 'gdkx11displaymanager.h', + 'gdkx11dnd.h', + 'gdkx11glcontext.h', + 'gdkx11keys.h', + 'gdkx11monitor.h', + 'gdkx11property.h', + 'gdkx11screen.h', + 'gdkx11selection.h', + 'gdkx11utils.h', + 'gdkx11visual.h', + 'gdkx11window.h', +) + +install_headers(gdk_x11_public_headers, subdir: 'gtk-3.0/gdk/x11/') +install_headers('gdkx.h', subdir: 'gtk-3.0/gdk/') + +gdk_x11_deps = [ + xrender_dep, + xi_dep, + xext_dep, + x11_dep, + xcursor_dep, + xdamage_dep, + xfixes_dep, + xcomposite_dep, + xrandr_dep, + xinerama_dep, +] + +libgdk_x11 = static_library('gdk-x11', gdkmarshal_h, + gdk_x11_sources, gdkconfig, gdkenum_h, + include_directories: [ confinc, gdkinc, ], + c_args: [ + '-DGDK_COMPILATION', + '-DG_LOG_DOMAIN="Gdk"', + ] + common_cflags, + link_args: common_ldflags, + dependencies: [ gdk_deps, gdk_x11_deps, ]) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index ea2dd5863c..e56ce9ee6c 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -1177,7 +1177,7 @@ MAINTAINERCLEANFILES = \ $(print_portal_built_sources) \ $(stamp_files) -DISTCLEANFILES = gtktypefuncs.c +DISTCLEANFILES = gtktypefuncs.inc if OS_WIN32 DISTCLEANFILES += gtk-win32.rc @@ -1442,7 +1442,7 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources) gtkprivatetypebuiltins. && rm -f xgen-gptbc -gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile +gtktypefuncs.inc: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile $(AM_V_GEN) export LC_ALL=C ; \ (echo '#undef GTK_COMPILATION' && echo '#include ') > xgen-gtfsrc.c && \ echo 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' > xgen-gtf && \ @@ -1451,7 +1451,7 @@ gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_src sort | uniq | \ $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; }' >> xgen-gtf \ && cp xgen-gtf $@ && rm -f xgen-gtf -$(srcdir)/gtktestutils.c: gtktypefuncs.c +$(srcdir)/gtktestutils.c: gtktypefuncs.inc # target platform: lib_LTLIBRARIES = libgtk-3.la diff --git a/gtk/a11y/meson.build b/gtk/a11y/meson.build index c53c22abdd..d0359158d0 100644 --- a/gtk/a11y/meson.build +++ b/gtk/a11y/meson.build @@ -45,6 +45,7 @@ a11y_sources = files( 'gtkspinbuttonaccessible.c', 'gtkspinneraccessible.c', 'gtkstatusbaraccessible.c', + 'gtkstackaccessible.c', 'gtkswitchaccessible.c', 'gtktextcellaccessible.c', 'gtktextviewaccessible.c', @@ -53,5 +54,61 @@ a11y_sources = files( 'gtktreeviewaccessible.c', 'gtkwidgetaccessible.c', 'gtkwindowaccessible.c', - 'gtkstackaccessible.c' - ) +) + +a11y_headers = files( + 'gtk-a11y-autocleanups.h', + 'gtkarrowaccessible.h', + 'gtkbooleancellaccessible.h', + 'gtkbuttonaccessible.h', + 'gtkcellaccessible.h', + 'gtkcellaccessibleparent.h', + 'gtkcheckmenuitemaccessible.h', + 'gtkcomboboxaccessible.h', + 'gtkcontaineraccessible.h', + 'gtkcontainercellaccessible.h', + 'gtkentryaccessible.h', + 'gtkexpanderaccessible.h', + 'gtkflowboxaccessible.h', + 'gtkflowboxchildaccessible.h', + 'gtkframeaccessible.h', + 'gtkiconviewaccessible.h', + 'gtkimageaccessible.h', + 'gtkimagecellaccessible.h', + 'gtklabelaccessible.h', + 'gtklevelbaraccessible.h', + 'gtklinkbuttonaccessible.h', + 'gtklistboxaccessible.h', + 'gtklistboxrowaccessible.h', + 'gtklockbuttonaccessible.h', + 'gtkmenuaccessible.h', + 'gtkmenubuttonaccessible.h', + 'gtkmenuitemaccessible.h', + 'gtkmenushellaccessible.h', + 'gtknotebookaccessible.h', + 'gtknotebookpageaccessible.h', + 'gtkpanedaccessible.h', + 'gtkpopoveraccessible.h', + 'gtkprogressbaraccessible.h', + 'gtkradiobuttonaccessible.h', + 'gtkradiomenuitemaccessible.h', + 'gtkrangeaccessible.h', + 'gtkrenderercellaccessible.h', + 'gtkscaleaccessible.h', + 'gtkscalebuttonaccessible.h', + 'gtkscrolledwindowaccessible.h', + 'gtkspinbuttonaccessible.h', + 'gtkspinneraccessible.h', + 'gtkstatusbaraccessible.h', + 'gtkstackaccessible.h', + 'gtkswitchaccessible.h', + 'gtktextcellaccessible.h', + 'gtktextviewaccessible.h', + 'gtktogglebuttonaccessible.h', + 'gtktoplevelaccessible.h', + 'gtktreeviewaccessible.h', + 'gtkwidgetaccessible.h', + 'gtkwindowaccessible.h', +) + +install_headers(a11y_headers, subdir : 'gtk-3.0/gtk/a11y') diff --git a/gtk/deprecated/meson.build b/gtk/deprecated/meson.build index c2cf4757eb..9dfd5f0255 100644 --- a/gtk/deprecated/meson.build +++ b/gtk/deprecated/meson.build @@ -1,4 +1,4 @@ -gtk_deprecated_c_sources = files( +gtk_deprecated_sources = files( 'gtkactivatable.c', 'gtkaction.c', 'gtkactiongroup.c', @@ -40,3 +40,48 @@ gtk_deprecated_c_sources = files( 'gtkvseparator.c', 'gtkvpaned.c', ) + +gtk_deprecated_headers = files( + 'gtkactivatable.h', + 'gtkaction.h', + 'gtkactiongroup.h', + 'gtkalignment.h', + 'gtkarrow.h', + 'gtkcolorsel.h', + 'gtkcolorseldialog.h', + 'gtkfontsel.h', + 'gtkgradient.h', + 'gtkhandlebox.h', + 'gtkhbbox.h', + 'gtkhbox.h', + 'gtkhpaned.h', + 'gtkhscale.h', + 'gtkhscrollbar.h', + 'gtkhseparator.h', + 'gtkhsv.h', + 'gtkiconfactory.h', + 'gtkimagemenuitem.h', + 'gtkmisc.h', + 'gtknumerableicon.h', + 'gtkradioaction.h', + 'gtkrc.h', + 'gtkrecentaction.h', + 'gtkstatusicon.h', + 'gtkstock.h', + 'gtkstyle.h', + 'gtkstyleproperties.h', + 'gtksymboliccolor.h', + 'gtktable.h', + 'gtktearoffmenuitem.h', + 'gtkthemingengine.h', + 'gtktoggleaction.h', + 'gtkuimanager.h', + 'gtkvbbox.h', + 'gtkvbox.h', + 'gtkvscale.h', + 'gtkvscrollbar.h', + 'gtkvseparator.h', + 'gtkvpaned.h', +) + +install_headers(gtk_deprecated_headers, subdir: 'gtk-3.0/gtk/deprecated/') diff --git a/gtk/gen-gtk-gresources-xml.py b/gtk/gen-gtk-gresources-xml.py new file mode 100644 index 0000000000..720d588a4e --- /dev/null +++ b/gtk/gen-gtk-gresources-xml.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +# +# Generate gtk.gresources.xml +# +# Usage: gen-gtk-gresources-xml SRCDIR_GTK [OUTPUT-FILE] + +import os, sys + +srcdir = sys.argv[1] + +xml = ''' + + +''' + +def get_files(subdir,extension): + return sorted(filter(lambda x: x.endswith((extension)), os.listdir(os.path.join(srcdir,subdir)))) + +xml += ''' + theme/Adwaita/gtk.css + theme/Adwaita/gtk-dark.css + theme/Adwaita/gtk-contained.css + theme/Adwaita/gtk-contained-dark.css +''' + +for f in get_files('theme/Adwaita/assets', '.png'): + xml += ' theme/Adwaita/assets/{0}\n'.format(f) + +xml += '\n' + +for f in get_files('theme/Adwaita/assets', '.svg'): + xml += ' theme/Adwaita/assets/{0}\n'.format(f) + +xml += ''' + theme/HighContrast/gtk.css + theme/HighContrast/gtk-inverse.css + theme/HighContrast/gtk-contained.css + theme/HighContrast/gtk-contained-inverse.css +''' + +for f in get_files('theme/HighContrast/assets', '.png'): + xml += ' theme/HighContrast/assets/{0}\n'.format(f) + +xml += '\n' + +for f in get_files('theme/HighContrast/assets', '.svg'): + xml += ' theme/HighContrast/assets/{0}\n'.format(f) + +xml += ''' + theme/win32/gtk-win32-base.css + theme/win32/gtk.css +''' + +for f in get_files('cursor', '.png'): + xml += ' cursor/{0}\n'.format(f) + +for f in get_files('gesture', '.symbolic.png'): + xml += ' gesture/{0}\n'.format(f) + +xml += '\n' + +for f in get_files('ui', '.ui'): + xml += ' ui/{0}\n'.format(f) + +xml += '\n' + +for s in ['16x16', '22x22', '24x24', '32x32', '48x48']: + for c in ['actions', 'status', 'categories']: + icons_dir = 'icons/{0}/{1}'.format(s,c) + if os.path.exists(os.path.join(srcdir,icons_dir)): + for f in get_files(icons_dir, '.png'): + xml += ' icons/{0}/{1}/{2}\n'.format(s,c,f) + +for f in get_files('inspector', '.ui'): + xml += ' inspector/{0}\n'.format(f) + +xml += ''' + inspector/logo.png + emoji/emoji.data + +''' + +if len(sys.argv) > 2: + outfile = sys.argv[2] + f = open(outfile, 'w') + f.write(xml) + f.close() +else: + print(xml) diff --git a/gtk/gentypefuncs.py b/gtk/gentypefuncs.py new file mode 100644 index 0000000000..b17b7233a1 --- /dev/null +++ b/gtk/gentypefuncs.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +import re +import os + +debug = os.getenv('GTK_GENTYPEFUNCS_DEBUG') is not None + +out_file = sys.argv[1] +in_files = sys.argv[2:] + +funcs = [] + + +if debug: print ('Output file: ', out_file) + +if debug: print (len(in_files), 'input files') + +def open_file(filename, mode): + if sys.version_info[0] < 3: + return open(filename, mode=mode) + else: + return open(filename, mode=mode, encoding='utf-8') + +for filename in in_files: + if debug: print ('Input file: ', filename) + with open_file(filename, "r") as f: + for line in f: + line = line.rstrip('\n').rstrip('\r') + # print line + match = re.search(r'\bg[tds]k_[a-zA-Z0-9_]*_get_type\b', line) + if match: + func = match.group(0) + if not func in funcs: + funcs.append(func) + if debug: print ('Found ', func) + +file_output = 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS\n' + +funcs = sorted(funcs) + +for f in funcs: + if f.startswith('gdk_x11') or f.startswith('gtk_socket') or f.startswith('gtk_plug'): + file_output += '#ifdef GDK_WINDOWING_X11\n' + file_output += '*tp++ = {0}();\n'.format(f) + file_output += '#endif\n' + else: + file_output += '*tp++ = {0}();\n'.format(f) + +if debug: print (len(funcs), 'functions') + +ofile = open(out_file, "w") +ofile.write(file_output) +ofile.close() diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c index 7b78f739fe..5c0a362296 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -764,7 +764,7 @@ gtk_test_register_all_types (void) GType *tp; all_registered_types = g_new0 (GType, max_gtk_types); tp = all_registered_types; -#include "gtktypefuncs.c" +#include "gtktypefuncs.inc" n_all_registered_types = tp - all_registered_types; g_assert (n_all_registered_types + 1 < max_gtk_types); *tp = 0; diff --git a/gtk/inspector/meson.build b/gtk/inspector/meson.build index a119a08db8..7ca24ae2ee 100644 --- a/gtk/inspector/meson.build +++ b/gtk/inspector/meson.build @@ -8,6 +8,7 @@ inspector_sources = files( 'general.c', 'gestures.c', 'graphdata.c', + 'gtkstackcombo.c', 'gtktreemodelcssnode.c', 'init.c', 'inspect-button.c', @@ -23,9 +24,8 @@ inspector_sources = files( 'signals-list.c', 'size-groups.c', 'statistics.c', + 'strv-editor.c', 'treewalk.c', 'visual.c', 'window.c', - 'strv-editor.c', - 'gtkstackcombo.c' ) diff --git a/gtk/meson.build b/gtk/meson.build index 46fa1a9a4d..9526c049f7 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -2,7 +2,23 @@ subdir('deprecated') subdir('a11y') subdir('inspector') -gtk_sources = files([ +gtk_cargs = [ + '-DGTK_COMPILATION', + '-DG_LOG_DOMAIN="Gtk"', + # FIXME, support other backends + '-DGTK_PRINT_BACKENDS="file"', + '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED', + '-DGTK_BINARY_VERSION="@0@"'.format(gtk_binary_version), + '-DGTK_HOST="@0@"'.format(host_machine.system()), + '-DGTK_DATA_PREFIX="@0@"'.format(gtk_prefix), + '-DGTK_LIBDIR="@0@"'.format(gtk_libdir), + '-DGTK_LOCALEDIR="@0@"'.format(gtk_localedir), + '-DGTK_DATADIR="@0@"'.format(gtk_datadir), + '-DGTK_SYSCONFDIR="@0@"'.format(gtk_sysconfdir), +] + +# List of sources to build the library from +gtk_sources = files( 'gtkactionmuxer.c', 'gtkactionobserver.c', 'gtkactionobservable.c', @@ -28,6 +44,7 @@ gtk_sources = files([ 'gtkappchooserbutton.c', 'gtkappchooserdialog.c', 'gtkapplication.c', + 'gtkapplicationaccels.c', 'gtkapplicationimpl.c', 'gtkapplicationwindow.c', 'gtkaspectframe.c', @@ -38,17 +55,14 @@ gtk_sources = files([ 'gtkbookmarksmanager.c', 'gtkborder.c', 'gtkbox.c', + 'gtkboxgadget.c', 'gtkbuildable.c', 'gtkbuilder.c', - 'gtkicon.c', - 'gtkshortcutswindow.c', - 'gtkshortcutssection.c', 'gtkbuilderparser.c', 'gtkbuilder-menus.c', + 'gtkbuiltinicon.c', 'gtkbutton.c', 'gtkcairoblur.c', - 'gtkcssnode.c', - 'gtkcsscalcvalue.c', 'gtkcalendar.c', 'gtkcellarea.c', 'gtkcellareabox.c', @@ -66,7 +80,6 @@ gtk_sources = files([ 'gtkcellrenderertext.c', 'gtkcellrenderertoggle.c', 'gtkcellview.c', - 'gtkcenterbox.c', 'gtkcheckbutton.c', 'gtkcheckmenuitem.c', 'gtkcolorbutton.c', @@ -74,44 +87,45 @@ gtk_sources = files([ 'gtkcolorchooserwidget.c', 'gtkcolorchooserdialog.c', 'gtkcoloreditor.c', + 'gtkcolorpicker.c', + 'gtkcolorpickerkwin.c', + 'gtkcolorpickerportal.c', + 'gtkcolorpickershell.c', 'gtkcolorplane.c', 'gtkcolorscale.c', 'gtkcolorswatch.c', 'gtkcolorutils.c', 'gtkcombobox.c', 'gtkcomboboxtext.c', + 'gtkcomposetable.c', 'gtkcontainer.c', 'gtkcssanimation.c', - 'gtkcssgadget.c', - 'gtkcsscustomgadget.c', - 'gtkboxgadget.c', - 'gtkimagedefinition.c', - 'gtkprogresstracker.c', - 'gtkcssimageradial.c', - 'gtkcssimagerecolor.c', - 'gtkcssimagefallback.c', - 'gtkbuiltinicon.c', - 'gtkcssstylechange.c', - 'gtkcsspalettevalue.c', 'gtkcssanimatedstyle.c', 'gtkcssarrayvalue.c', 'gtkcssbgsizevalue.c', 'gtkcssbordervalue.c', + 'gtkcsscalcvalue.c', 'gtkcsscolorvalue.c', 'gtkcsscornervalue.c', + 'gtkcsscustomgadget.c', 'gtkcsscustomproperty.c', + 'gtkcssdimensionvalue.c', 'gtkcsseasevalue.c', 'gtkcssenumvalue.c', 'gtkcssenginevalue.c', + 'gtkcssgadget.c', 'gtkcssiconthemevalue.c', 'gtkcssimage.c', 'gtkcssimagebuiltin.c', 'gtkcssimagecrossfade.c', + 'gtkcssimagefallback.c', 'gtkcssimagegradient.c', 'gtkcssimageicontheme.c', 'gtkcssimagelinear.c', + 'gtkcssimageradial.c', 'gtkcssimagesurface.c', 'gtkcssimageurl.c', + 'gtkcssimagerecolor.c', 'gtkcssimagescaled.c', 'gtkcssimagevalue.c', 'gtkcssimagewin32.c', @@ -122,7 +136,9 @@ gtk_sources = files([ 'gtkcssmatcher.c', 'gtkcssnode.c', 'gtkcssnodedeclaration.c', + 'gtkcssnodestylecache.c', 'gtkcssnumbervalue.c', + 'gtkcsspalettevalue.c', 'gtkcssparser.c', 'gtkcsspathnode.c', 'gtkcsspositionvalue.c', @@ -133,12 +149,10 @@ gtk_sources = files([ 'gtkcssselector.c', 'gtkcssstringvalue.c', 'gtkcssstyle.c', + 'gtkcssstylechange.c', 'gtkcssshadowsvalue.c', 'gtkcssshadowvalue.c', 'gtkcssshorthandproperty.c', - 'gtkshortcutlabel.c', - 'gtkfilechoosernativeportal.c', - 'gtkdragsource.c', 'gtkcssshorthandpropertyimpl.c', 'gtkcssstaticstyle.c', 'gtkcssstylefuncs.c', @@ -152,29 +166,29 @@ gtk_sources = files([ 'gtkcsstypes.c', 'gtkcssvalue.c', 'gtkcsswidgetnode.c', - 'gtkcssnodestylecache.c', - 'gtkapplicationaccels.c', - 'gtkcssdimensionvalue.c', - 'gtkshortcutsgroup.c', - 'gtkshortcutsshortcut.c', - 'gtkfilechoosernative.c', - 'gtknativedialog.c', + 'gtkcsswin32sizevalue.c', 'gtkdialog.c', + 'gtkdragsource.c', 'gtkdrawingarea.c', - 'gtkutils.c', - 'gtktooltipwindow.c', 'gtkeditable.c', + 'gtkemojichooser.c', + 'gtkemojicompletion.c', 'gtkentry.c', 'gtkentrybuffer.c', 'gtkentrycompletion.c', 'gtkeventbox.c', 'gtkeventcontroller.c', + 'gtkeventcontrollerkey.c', + 'gtkeventcontrollermotion.c', + 'gtkeventcontrollerscroll.c', 'gtkexpander.c', 'gtkfilechooser.c', 'gtkfilechooserbutton.c', 'gtkfilechooserdialog.c', 'gtkfilechooserembed.c', 'gtkfilechooserentry.c', + 'gtkfilechoosernative.c', + 'gtkfilechoosernativeportal.c', 'gtkfilechooserutils.c', 'gtkfilechooserwidget.c', 'gtkfilefilter.c', @@ -185,15 +199,9 @@ gtk_sources = files([ 'gtkfontbutton.c', 'gtkfontchooser.c', 'gtkfontchooserdialog.c', - 'gtkcsswin32sizevalue.c', 'gtkfontchooserutils.c', - 'gtkwin32theme.c', - 'gtkwin32draw.c', - 'gtkcomposetable.c', - 'gdkpixbufutils.c', 'gtkfontchooserwidget.c', 'gtkframe.c', - 'gtkprintoperation-portal.c', 'gtkgladecatalog.c', 'gtkgesture.c', 'gtkgesturedrag.c', @@ -202,21 +210,21 @@ gtk_sources = files([ 'gtkgesturepan.c', 'gtkgesturerotate.c', 'gtkgesturesingle.c', + 'gtkgesturestylus.c', 'gtkgestureswipe.c', 'gtkgesturezoom.c', - 'gtkgizmo.c', - 'gtkgladecatalog.c', 'gtkglarea.c', 'gtkgrid.c', 'gtkheaderbar.c', - 'gtkdragdest.c', 'gtkhsla.c', + 'gtkicon.c', 'gtkiconcache.c', 'gtkiconcachevalidator.c', 'gtkiconhelper.c', 'gtkicontheme.c', 'gtkiconview.c', 'gtkimage.c', + 'gtkimagedefinition.c', 'gtkimcontext.c', 'gtkimcontextsimple.c', 'gtkimmodule.c', @@ -250,6 +258,7 @@ gtk_sources = files([ 'gtkmodifierstyle.c', 'gtkmodules.c', 'gtkmountoperation.c', + 'gtknativedialog.c', 'gtknotebook.c', 'gtkoffscreenwindow.c', 'gtkorientable.c', @@ -270,6 +279,7 @@ gtk_sources = files([ 'gtkprintutils.c', 'gtkprivate.c', 'gtkprogressbar.c', + 'gtkprogresstracker.c', 'gtkpixelcache.c', 'gtkpopover.c', 'gtkpopovermenu.c', @@ -302,6 +312,11 @@ gtk_sources = files([ 'gtkseparatormenuitem.c', 'gtkseparatortoolitem.c', 'gtksettings.c', + 'gtkshortcutsgroup.c', + 'gtkshortcutlabel.c', + 'gtkshortcutsshortcut.c', + 'gtkshortcutssection.c', + 'gtkshortcutswindow.c', 'gtksidebarrow.c', 'gtksizegroup.c', 'gtksizerequest.c', @@ -347,6 +362,7 @@ gtk_sources = files([ 'gtktoolpalette.c', 'gtktoolshell.c', 'gtktooltip.c', + 'gtktooltipwindow.c', 'gtktrashmonitor.c', 'gtktreedatalist.c', 'gtktreednd.c', @@ -359,28 +375,26 @@ gtk_sources = files([ 'gtktreestore.c', 'gtktreeview.c', 'gtktreeviewcolumn.c', + 'gtkutils.c', 'gtkvolumebutton.c', 'gtkviewport.c', 'gtkwidget.c', - 'gtkwidgetfocus.c', 'gtkwidgetpath.c', 'gtkwindow.c', 'gtkwindowgroup.c', + 'gtkwin32draw.c', 'gtkwin32theme.c', - 'fallback-c89.c' -]) + 'gdkpixbufutils.c', + 'language-names.c', + 'script-names.c', +) -gtk_private_type_headers = files([ +gtk_private_type_headers = files( 'gtkcsstypesprivate.h', 'gtktexthandleprivate.h', -]) +) -gtk_private_h_sources = gtk_private_type_headers + files([ - 'gtkrecentchooserutils.h', - 'gtkrbtree.h', -]) - -gtk_public_h_sources = files([ +gtk_public_headers = files( 'gtk.h', 'gtk-autocleanups.h', 'gtkx.h', @@ -452,6 +466,9 @@ gtk_public_h_sources = files([ 'gtkenums.h', 'gtkeventbox.h', 'gtkeventcontroller.h', + 'gtkeventcontrollerkey.h', + 'gtkeventcontrollermotion.h', + 'gtkeventcontrollerscroll.h', 'gtkexpander.h', 'gtkfilechooser.h', 'gtkfilechooserbutton.h', @@ -473,6 +490,7 @@ gtk_public_h_sources = files([ 'gtkgesturepan.h', 'gtkgesturerotate.h', 'gtkgesturesingle.h', + 'gtkgesturestylus.h', 'gtkgestureswipe.h', 'gtkgesturezoom.h', 'gtkglarea.h', @@ -602,52 +620,14 @@ gtk_public_h_sources = files([ 'gtkwidgetpath.h', 'gtkwindow.h', 'gtkwindowgroup.h', -]) +) -gtk_deprecated_type_headers = files([ - 'deprecated/gtkactivatable.h', - 'deprecated/gtkaction.h', - 'deprecated/gtkactiongroup.h', - 'deprecated/gtkalignment.h', - 'deprecated/gtkarrow.h', - 'deprecated/gtkcolorsel.h', - 'deprecated/gtkcolorseldialog.h', - 'deprecated/gtkfontsel.h', - 'deprecated/gtkgradient.h', - 'deprecated/gtkhandlebox.h', - 'deprecated/gtkhbbox.h', - 'deprecated/gtkhbox.h', - 'deprecated/gtkhpaned.h', - 'deprecated/gtkhscale.h', - 'deprecated/gtkhscrollbar.h', - 'deprecated/gtkhseparator.h', - 'deprecated/gtkhsv.h', - 'deprecated/gtkiconfactory.h', - 'deprecated/gtkimagemenuitem.h', - 'deprecated/gtkmisc.h', - 'deprecated/gtknumerableicon.h', - 'deprecated/gtkradioaction.h', - 'deprecated/gtkrc.h', - 'deprecated/gtkrecentaction.h', - 'deprecated/gtkstatusicon.h', - 'deprecated/gtkstock.h', - 'deprecated/gtkstyle.h', - 'deprecated/gtkstyleproperties.h', - 'deprecated/gtksymboliccolor.h', - 'deprecated/gtktable.h', - 'deprecated/gtktearoffmenuitem.h', - 'deprecated/gtkthemingengine.h', - 'deprecated/gtktoggleaction.h', - 'deprecated/gtkuimanager.h', - 'deprecated/gtkvbbox.h', - 'deprecated/gtkvbox.h', - 'deprecated/gtkvscale.h', - 'deprecated/gtkvscrollbar.h', - 'deprecated/gtkvseparator.h', - 'deprecated/gtkvpaned.h', -]) +# Installed headers without compatibility guarantees that are not included in gtk/gtk.h +gtk_semi_private_headers = files('gtktextlayout.h') -gtk_unix_sources = files([ +install_headers(gtk_public_headers + gtk_semi_private_headers, subdir: 'gtk-3.0/gtk') + +gtk_unix_sources = files( 'gtkcustompaperunixdialog.c', 'gtkpagesetupunixdialog.c', 'gtkprinter.c', @@ -656,20 +636,57 @@ gtk_unix_sources = files([ 'gtkprinteroptionwidget.c', 'gtkprintjob.c', 'gtkprintoperation-unix.c', + 'gtkprintoperation-portal.c', 'gtkprintunixdialog.c', 'gtkprintbackend.c', 'gtksearchenginetracker.c', -]) - -gtkresources = gnome.compile_resources( - 'gtkresources', - 'gtk.gresource.xml', - source_dir: '.', - c_name: '_gtk', - extra_args: '--manual-register' ) -gtk_x11_sources = files([ +if os_unix + gtk_sources += gtk_unix_sources +endif + +gtk_win32_sources = files( + 'gtkprint-win32.c', + 'gtkprintoperation-win32.c', + 'gtkfilechoosernativewin32.c', + 'gtkwin32.c', +) + +if os_win32 + gtk_sources += gtk_win32_sources +endif + +gen_gtk_gresources_xml = find_program('gen-gtk-gresources-xml.py') +gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml', + command: [ + gen_gtk_gresources_xml, + meson.current_source_dir(), + '@OUTPUT@' + ]) + +# Re-build the theme files if sassc is available +theme_deps = [] +sassc = find_program('sassc', required: false) +if sassc.found() + sassc_opts = [ '-a', '-M', '-t', 'compact' ] + + subdir('theme/Adwaita') + subdir('theme/HighContrast') +endif + +gtkresources = gnome.compile_resources('gtkresources', + gtk_gresources_xml, + dependencies: theme_deps, + source_dir: [ + # List in order of preference + meson.current_build_dir(), + meson.current_source_dir(), + ], + c_name: '_gtk', + extra_args: '--manual-register') + +gtk_use_x11_sources = files([ 'gtkplug.c', 'gtksocket.c', 'gtkxembed.c', @@ -678,122 +695,120 @@ gtk_x11_sources = files([ 'gtkmountoperation-x11.c', ]) -gtk_wayland_sources = files([ +gtk_use_wayland_sources = files([ 'gtkapplication-wayland.c' ]) -dnd_sources = files([ - 'gtkclipboard.c', - 'gtkdnd.c' -]) +if quartz_enabled + gtk_sources += files( + 'gtkclipboard-quartz.c', + 'gtkdnd-quartz.c', + ) +else + gtk_sources += files( + 'gtkclipboard.c', + 'gtkdnd.c', + 'gtkdragdest.c', + ) +endif -gtk_use_wayland_or_x11_c_sources = files([ - 'gtkapplication-dbus.c' -]) +gtk_use_wayland_or_x11_sources = files( 'gtkapplication-dbus.c') + +gtk_use_win32_sources = files( + 'gtkwin32embed.c', + 'gtkwin32embedwidget.c', + 'gtkmountoperation-stub.c', +) + +gtk_use_quartz_sources = files( + 'gtksearchenginequartz.c', + 'gtkmountoperation-stub.c', + 'gtkapplication-quartz.c', + 'gtkapplication-quartz-menu.c', + 'gtkfilechoosernativequartz.c', + 'gtkquartz.c', +) + +gtk_stub_sources = files('gtkmountoperation-stub.c') gtk_dbus_src = gnome.gdbus_codegen('gtkdbusgenerated', 'gtkdbusinterfaces.xml', interface_prefix: 'org.Gtk.', namespace: '_Gtk') -gtkmarshal_h = custom_target( - 'gtkmarshal_h', - output : 'gtkmarshalers.h', - input : 'gtkmarshalers.list', - command : [mkmarshal, glib_marshal, '_gtk_marshal', '@INPUT@', '@OUTPUT@'] -) +gtkmarshalers = gnome.genmarshal('gtkmarshalers', + sources: 'gtkmarshalers.list', + prefix: '_gtk_marshal', + valist_marshallers: true) -gtkmarshal_c = custom_target( - 'gtkmarshal_c', - output : 'gtkmarshalers.c', - input : 'gtkmarshalers.list', - command : [mkmarshal, glib_marshal, '_gtk_marshal', '@INPUT@', '@OUTPUT@'] -) +gtkmarshal_h = gtkmarshalers[1] + +gtktypebuiltins = gnome.mkenums('gtktypebuiltins', + sources: gtk_public_headers + gtk_deprecated_headers + a11y_headers, + c_template: 'gtktypebuiltins.c.template', + h_template: 'gtktypebuiltins.h.template', + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gtk'), + install_header: true) + +gtktypebuiltins_h = gtktypebuiltins[1] + +gtkprivatetypebuiltins = gnome.mkenums('gtkprivatetypebuiltins', + sources: gtk_private_type_headers, + c_template: 'gtkprivatetypebuiltins.c.template', + h_template: 'gtkprivatetypebuiltins.h.template') + +gtkprivatetypebuiltins_h = gtkprivatetypebuiltins[1] + +# Generate gtktypefuncs.inc +typefuncs = custom_target('gtktypefuncs.inc', + depends: [ gdkenum_h ], + output: 'gtktypefuncs.inc', + input: gdk_headers + + gtk_public_headers + + gtk_deprecated_headers + + [ gtktypebuiltins_h, gdkenum_h ], + command: [ + find_program('gentypefuncs.py'), + '@OUTPUT@', + '@INPUT@', + ], + install: false) +gtkversion_cdata = configuration_data() +gtkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version) +gtkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version) +gtkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version) +gtkversion_cdata.set('GTK_BINARY_AGE', gtk_binary_age) +gtkversion_cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) -gtktypebuiltins_h = custom_target( - 'gtkypebuiltins_h', - output : 'gtktypebuiltins.h', - input : gtk_public_h_sources + gtk_deprecated_type_headers, - command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtktypebuiltins.h.template', '@OUTPUT@', '@INPUT@'] -) +gtkversion = configure_file(input: 'gtkversion.h.in', + output: 'gtkversion.h', + configuration: gtkversion_cdata, + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gtk')) -gtktypebuiltins_c = custom_target( - 'gtkypebuiltins_c', - output : 'gtktypebuiltins.c', - input : gtk_public_h_sources + gtk_deprecated_type_headers, - depends : gtktypebuiltins_h, - command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtktypebuiltins.c.template', '@OUTPUT@', '@INPUT@'] -) - -gtkprivatetypebuiltins_h = custom_target( - 'gtkprivateypebuiltins_h', - output : 'gtkprivatetypebuiltins.h', - input : gtk_private_type_headers, - command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtkprivatetypebuiltins.h.template', '@OUTPUT@', '@INPUT@'] -) - -gtkprivatetypebuiltins_c = custom_target( - 'gtkprivateypebuiltins_c', - output : 'gtkprivatetypebuiltins.c', - input : gtk_private_type_headers, - depends : [gtkprivatetypebuiltins_h, gtktypebuiltins_h], - command : [mkenum, perl, glib_mkenums, meson.current_source_dir() + '/gtkprivatetypebuiltins.c.template', '@OUTPUT@', '@INPUT@'] -) - -gentypefuncs_prog = find_program('gentypefuncs.py') -# Generate gtktypefuncs.c -typefuncs = custom_target( - 'typefuncs', - depends: gdkenum_h, - output : 'gtktypefuncs.c', - input : gdk_headers + gtk_public_h_sources + gtk_deprecated_type_headers + gtk_private_h_sources + [gtktypebuiltins_h] + [gdkenum_h], - command: [gentypefuncs_prog, '@OUTPUT@', '@INPUT@'], - install: false, -) - -cdata = configuration_data() -cdata.set('GTK_MAJOR_VERSION', gtk_major_version) -cdata.set('GTK_MINOR_VERSION', gtk_minor_version) -cdata.set('GTK_MICRO_VERSION', gtk_micro_version) -cdata.set('GTK_BINARY_AGE', gtk_binary_age) -cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) - -gtkversion = configure_file( - input : 'gtkversion.h.in', - output : 'gtkversion.h', - configuration: cdata -) - -gtk_cargs = [ - '-DGTK_COMPILATION', - '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED', - '-DGTK_BINARY_VERSION="' + gtk_binary_version + '"', - '-DGTK_HOST="' + host_machine.system() + '"', - '-DGTK_SYSCONFDIR="' + get_option('prefix') + '/etc"', - '-DGTK_DATADIR="' + get_option('datadir') + '"', - '-DGTK_DATA_PREFIX="'+ get_option('prefix') + '"', - '-DGTK_PRINT_BACKENDS="null"', +gtk_gen_headers = [ + gtkmarshalers, + gtkprivatetypebuiltins, + gtktypebuiltins, + gtkversion, ] gtk_sources += [ gtk_dbus_src, - gtk_unix_sources, - gtk_deprecated_c_sources, - dnd_sources, + gtk_deprecated_sources, inspector_sources, a11y_sources, gtkresources, - gtkmarshal_c, - gtkprivatetypebuiltins_c, - gtktypebuiltins_c, + gtkmarshalers, + gtkprivatetypebuiltins, + gtktypebuiltins, ] gtk_deps = [ gmodule_dep, - giounix_dep, glib_dep, - atkbridge_dep, + gobject_dep, + platform_gio_dep, pangocairo_dep, pango_dep, cairogobj_dep, @@ -802,68 +817,194 @@ gtk_deps = [ pixbuf_dep, atk_dep, epoxy_dep, - mlib, + libm, ] if x11_enabled - runcmd = run_command('pkg-config', '--variable=prefix', 'x11') - if runcmd.returncode() == 0 - gtk_cargs += '-DX11_DATA_PREFIX="' + runcmd.stdout().strip() + '"' - else - error('Could not get x11 data prefix via pkg-config.') - endif + x11_data_prefix = dependency('x11').get_pkgconfig_variable('prefix') - gtk_sources += [ - gtk_x11_sources, - gtk_use_wayland_or_x11_c_sources - ] - gtk_deps += [ - xi_dep, - x11_dep, - pangoft_dep - ] + gtk_cargs += [ '-DX11_DATA_PREFIX="@0@"'.format(x11_data_prefix), ] + gtk_sources += gtk_use_x11_sources + gtk_deps += [ xi_dep, x11_dep, ] endif if wayland_enabled - gtk_sources += [ - gtk_wayland_sources, - gtk_use_wayland_or_x11_c_sources - ] - gtk_deps += [ - pangoft_dep - ] + gtk_sources += gtk_use_wayland_sources endif -gnome.compile_schemas() +if broadway_enabled + gtk_sources += ['gtkimcontextbroadway.c'] +endif -libgtk = shared_library('gtk', - gtk_sources, - gtkmarshal_h, - c_args: gtk_cargs, - include_directories: [confinc, gdkinc, gtkinc], - dependencies: [gtk_deps, libgdk_dep], - install: true -) +if win32_enabled + gtk_cargs += [] + gtk_sources += gtk_use_win32_sources + gtk_deps += [ giowin32_dep, pangowin32_dep ] +else + gtk_deps += [ atkbridge_dep, ] +endif -libgtk_dep = declare_dependency( - sources: [ - 'gtk.h', - gtkversion, - gtktypebuiltins_c, +if quartz_enabled + gtk_sources += gtk_use_quartz_sources + gtk_cargs += ['-xobjective-c'] # FIXME? maybe add_languages() instead? +endif + +# So we don't add these twice +if x11_enabled or wayland_enabled + gtk_sources += gtk_use_wayland_or_x11_sources + gtk_deps += pangoft_dep +endif + +if not (x11_enabled or win32_enabled or quartz_enabled) + gtk_sources += gtk_stub_sources +endif + +if cloudproviders_enabled + gtk_deps += cloudproviders_dep +endif + +# Unconditional. If libintl isn't found, +# the object just does nothing being in the deplist +gtk_deps += libintl_dep + +gtk_settings_schemas = [ + 'org.gtk.Settings.FileChooser.gschema.xml', + 'org.gtk.Settings.ColorChooser.gschema.xml', + 'org.gtk.Settings.EmojiChooser.gschema.xml', + 'org.gtk.Settings.Debug.gschema.xml', +] +install_data(gtk_settings_schemas, install_dir: gtk_schemasdir) +gnome.compile_schemas(depend_files: files(gtk_settings_schemas), + build_by_default: true) +gtk_schema_build_dir = meson.current_build_dir() + +# Check for more things +if cc.has_header('langinfo.h') + foreach nl_enum: [ '_NL_MEASUREMENT_MEASUREMENT', + '_NL_PAPER_HEIGHT', + '_NL_PAPER_WIDTH', + '_NL_TIME_FIRST_WEEKDAY', ] + cdata.set('HAVE_' + nl_enum, cc.has_header_symbol('langinfo.h', nl_enum)) + endforeach +endif + +# Library +libgtk = shared_library('gtk-3', + soversion: gtk_soversion, + sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h], + c_args: gtk_cargs + common_cflags, + include_directories: [confinc, gdkinc, gtkinc], + dependencies: gtk_deps + [libgdk_dep], + link_with: libgdk, + link_args: common_ldflags, + install: true) + +gtk_dep_sources = [gtkversion, gtktypebuiltins_h] +# Introspection +build_gir = get_option('introspection') +if build_gir + gir_args = [ + '--quiet', + ] + + # We may build some of the dependencies as sub-projects; this means + # that we need to depend on the built introspection data, instead of + # the installed one + gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', ] + + if pixbuf_dep.type_name() == 'internal' + gdk_gir_inc += subproject('gdk-pixbuf').get_variable('gdkpixbuf_gir').get(0) + else + gdk_gir_inc += 'GdkPixbuf-2.0' + endif + + if pango_dep.type_name() == 'internal' + gdk_gir_inc += subproject('pango').get_variable('pango_gir').get(0) + else + gdk_gir_inc += 'Pango-1.0' + endif + + gdk_gir = gnome.generate_gir(libgtk, + sources: gdk_public_headers + gdk_sources + [ gdkenum_h ], + namespace: 'Gdk', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gtk+-3.0', + includes: gdk_gir_inc, + header: 'gdk/gdk.h', + install: true, + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gdk_gir_dep = declare_dependency(sources: gdk_gir) + gtk_dep_sources += gdk_gir + + if x11_enabled + gdk_x11_gir = gnome.generate_gir(libgtk, + sources: gdk_x11_public_headers + gdk_x11_sources, + namespace: 'GdkX11', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gtk+-x11-3.0', + includes: [ gdk_gir[0], 'xlib-2.0', ], + install: true, + dependencies: gdk_gir_dep, + header: 'gdk/gdkx.h', + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gtk_dep_sources += gdk_x11_gir + endif + + gtk_introspection_sources = [ + gtk_public_headers, + gtk_sources, + a11y_headers, + a11y_sources, gtktypebuiltins_h, - ], - dependencies: gtk_deps, - link_with: [libgtk, libgdk], - link_args: ['-Bsymbolic'], - include_directories: [confinc, gtkinc] -) + gtkversion, + ] + gtk_gir = gnome.generate_gir(libgtk, + sources: gtk_introspection_sources, + namespace: 'Gtk', + nsversion: gtk_api_version, + identifier_prefix: 'Gtk', + symbol_prefix: 'gtk', + export_packages: 'gtk+-3.0', + includes: [ gdk_gir[0], 'Atk-1.0', ], + header: 'gtk/gtk.h', + install: true, + dependencies: gdk_gir_dep, + extra_args: gir_args + [ + '-DGTK_COMPILATION', + '--c-include=gtk/gtk-a11y.h', + ]) + gtk_dep_sources += gtk_gir +endif +libgtk_dep = declare_dependency(sources: gtk_dep_sources, + include_directories: [confinc, gtkinc], + dependencies: gtk_deps + [libgdk_dep], + link_with: libgtk, + link_args: common_ldflags) + +if quartz_enabled + # HACK: install_data() doesn't allow installing under a different name (#1487) + # FIXME: or maybe just rename it to gtk-keys.css in the src tree? + configure_file(input: 'gtk-keys.css.mac', + output: 'gtk-keys.css', + copy: true, + install_dir: join_paths(get_option('datadir'), 'themes/Mac/gtk-4.0')) +endif ####### Utils ###### gtk_query_settings = executable( 'gtk-query-settings', 'gtk-query-settings.c', + c_args: gtk_cargs, dependencies: libgtk_dep, install: true ) @@ -871,6 +1012,7 @@ gtk_query_settings = executable( gtk_builder_tool = executable( 'gtk-builder-tool', 'gtk-builder-tool.c', + c_args: gtk_cargs, dependencies: libgtk_dep, install: true ) @@ -878,21 +1020,24 @@ gtk_builder_tool = executable( gtk_update_icon_cache = executable( 'gtk-update-icon-cache', 'updateiconcache.c', + c_args: gtk_cargs, dependencies: libgtk_dep, install: true ) -# gtk_query_immodules = executable( - # 'gtk-query-immodules-3.0', - # 'queryimmodules.c', - # 'gtkutils.c', - # dependencies: libgtk_dep, - # install: true -# ) + gtk_query_immodules = executable( + 'gtk-query-immodules-3.0', + 'queryimmodules.c', + 'gtkutils.c', + c_args: gtk_cargs, + dependencies: libgtk_dep, + install: true +) gtk_encode_symbolic_svg = executable( 'gtk-encode-symbolic-svg', 'encodesymbolic.c', + c_args: gtk_cargs, dependencies: libgtk_dep, install: true ) @@ -900,6 +1045,7 @@ gtk_encode_symbolic_svg = executable( gtk_launch = executable( 'gtk-launch', 'gtk-launch.c', + c_args: gtk_cargs, dependencies: libgtk_dep, install: true ) diff --git a/gtk/theme/Adwaita/meson.build b/gtk/theme/Adwaita/meson.build new file mode 100644 index 0000000000..7a799f947d --- /dev/null +++ b/gtk/theme/Adwaita/meson.build @@ -0,0 +1,30 @@ +scss_files = files([ + '_colors-public.scss', + '_colors.scss', + '_common.scss', + '_drawing.scss', +]) + +theme_variants = [ + 'dark', +] + +theme_deps += custom_target('Adwaita', + input: 'gtk-contained.scss', + output: 'gtk-contained.css', + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) + +foreach variant: theme_variants + theme_deps += custom_target('Adwaita-' + variant, + input: 'gtk-contained-@0@.scss'.format(variant), + output: 'gtk-contained-@0@.css'.format(variant), + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) +endforeach diff --git a/gtk/theme/HighContrast/meson.build b/gtk/theme/HighContrast/meson.build new file mode 100644 index 0000000000..f3230353ef --- /dev/null +++ b/gtk/theme/HighContrast/meson.build @@ -0,0 +1,29 @@ +scss_files = files([ + '_colors.scss', + '_common.scss', + '_drawing.scss', +]) + +theme_variants = [ + 'inverse', +] + +theme_deps += custom_target('HighContrast', + input: 'gtk-contained.scss', + output: 'gtk-contained.css', + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) + +foreach variant: theme_variants + theme_deps += custom_target('HighContrast-' + variant, + input: 'gtk-contained-@0@.scss'.format(variant), + output: 'gtk-contained-@0@.css'.format(variant), + command: [ + sassc, sassc_opts, '@INPUT@', '@OUTPUT@', + ], + depend_files: scss_files, + build_by_default: true) +endforeach diff --git a/meson.build b/meson.build index e3d9ec4eca..a78876f884 100644 --- a/meson.build +++ b/meson.build @@ -1,24 +1,73 @@ project('gtk+-3.0', 'c', - version: '3.22.0', + version: '3.24.1', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu89', 'warning_level=1' ], + meson_version : '>= 0.43.0', license: 'LGPLv2.1+') +glib_major_req = 2 +glib_minor_req = 53 +glib_micro_req = 4 + +if glib_minor_req.is_odd() + glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req - 1) +else + glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req) +endif + +if glib_minor_req.is_odd() + glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req + 1) +else + glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req) +endif + +glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req) +pango_req = '>= 1.41.0' +atk_req = '>= 2.15.1' +cairo_req = '>= 1.14.0' +gdk_pixbuf_req = '>= 2.30.0' +introspection_req = '>= 1.39.0' +wayland_proto_req = '>= 1.12' +wayland_req = '>= 1.9.91' +epoxy_req = '>= 1.4' +cloudproviders_req = '>= 0.2.5' +xkbcommon_req = '>= 0.2.0' + gnome = import('gnome') -add_global_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c') -add_global_arguments('-DG_ENABLE_DEBUG', language: 'c') -add_global_arguments('-DG_ENABLE_CONSISTENCY_CHECKS', language: 'c') +add_project_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c') +add_project_arguments('-DGLIB_MIN_REQUIRED_VERSION=' + glib_min_required, language: 'c') +add_project_arguments('-DGLIB_MAX_ALLOWED_VERSION=' + glib_max_allowed, language: 'c') -gtk_version = meson.project_version().split('.') -gtk_major_version = gtk_version[0].to_int() -gtk_minor_version = gtk_version[1].to_int() -gtk_micro_version = gtk_version[2].to_int() +# Making releases: +# 1. gtk_micro_version += 1; +# 2. gtk_interface_age += 1; +# 3. if any functions have been added, set gtk_interface_age to 0. +# 4. if backwards compatibility has been broken, we're in trouble +gtk_version = meson.project_version() +gtk_major_version = gtk_version.split('.')[0].to_int() +gtk_minor_version = gtk_version.split('.')[1].to_int() +gtk_micro_version = gtk_version.split('.')[2].to_int() gtk_interface_age = 0 -add_global_arguments('-DGTK_VERSION="' + meson.project_version() + '"', language: 'c') +add_project_arguments('-DGTK_VERSION="@0@"'.format(meson.project_version()), language: 'c') + +add_project_arguments('-D_GNU_SOURCE', language: 'c') + +gtk_debug_cflags = [] +buildtype = get_option('buildtype') +if buildtype.startswith('debug') + gtk_debug_cflags += '-DG_ENABLE_DEBUG' + if buildtype == 'debug' + gtk_debug_cflags += '-DG_ENABLE_CONSISTENCY_CHECKS' + endif +elif buildtype == 'release' + gtk_debug_cflags += '-DG_DISABLE_CAST_CHECKS' +endif + +add_project_arguments(gtk_debug_cflags, language: 'c') # Define a string for the earliest version that this release has # backwards binary compatibility with for all interfaces a module @@ -28,167 +77,344 @@ add_global_arguments('-DGTK_VERSION="' + meson.project_version() + '"', language gtk_binary_version = '3.0.0' gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version + +gtk_soversion = '0.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk_interface_age) + gtk_api_version = '@0@.0'.format(gtk_major_version) -x11_enabled = get_option('enable-x11-backend') -wayland_enabled = get_option('enable-wayland-backend') -broadway_enabled = get_option('enable-broadway-backend') - - -mkmarshal = find_program('build_marshal.py') -glib_marshal = find_program('glib-genmarshal') -mkenum = find_program('build_enum.py') -perl = find_program('perl') -glib_mkenums = find_program('glib-mkenums') +x11_enabled = get_option('x11-backend') +wayland_enabled = get_option('wayland-backend') +broadway_enabled = get_option('broadway-backend') +quartz_enabled = get_option('quartz-backend') +win32_enabled = get_option('win32-backend') os_unix = false os_linux = false os_win32 = false os_darwin = false -if host_machine.system().contains('darwin') +# Some windowing system backends depend on the platform we're +# building for, so we need to ensure they are disabled; in other +# cases, they are the only windowing system available, so we need +# to ensure they are enabled +if host_machine.system() == 'darwin' os_darwin = true -elif host_machine.system().contains('mingw') +elif host_machine.system() == 'windows' os_win32 = true -elif host_machine.system().contains('linux') +elif host_machine.system() == 'linux' os_linux = true endif - os_unix = not os_win32 +if os_darwin + wayland_enabled = false +else + quartz_enabled = false +endif + +if os_win32 + wayland_enabled = false + x11_enabled = false +else + win32_enabled = false +endif + +gtk_prefix = get_option('prefix') +gtk_includedir = join_paths(gtk_prefix, get_option('includedir')) +gtk_libdir = join_paths(gtk_prefix, get_option('libdir')) +gtk_datadir = join_paths(gtk_prefix, get_option('datadir')) +gtk_localedir = join_paths(gtk_prefix, get_option('localedir')) +gtk_sysconfdir = join_paths(gtk_prefix, get_option('sysconfdir')) +gtk_applicationsdir = join_paths(gtk_datadir, 'applications') +gtk_schemasdir = join_paths(gtk_datadir, 'glib-2.0/schemas') +gtk_appdatadir = join_paths(gtk_datadir, 'metainfo') cc = meson.get_compiler('c') + cdata = configuration_data() -cdata.set('PACKAGE_VERSION', '"'+meson.project_version()+'"') -cdata.set('GTK_LOCALEDIR', '"'+get_option('localedir')+'"') -cdata.set('GTK_DATADIR', '"'+get_option('datadir')+'"') -cdata.set('GTK_LIBDIR', '"'+get_option('libdir')+'"') -cdata.set('GETTEXT_PACKAGE', '"gtk30"') +cdata.set_quoted('PACKAGE_VERSION', meson.project_version()) +cdata.set_quoted('GTK_LOCALEDIR', gtk_localedir) +cdata.set_quoted('GTK_DATADIR', gtk_datadir) +cdata.set_quoted('GTK_LIBDIR', gtk_libdir) +cdata.set_quoted('GTK_SYSCONFDIR', gtk_sysconfdir) +cdata.set_quoted('GETTEXT_PACKAGE', 'gtk30') cdata.set('GTK_MAJOR_VERSION', gtk_major_version) cdata.set('GTK_MINOR_VERSION', gtk_minor_version) cdata.set('GTK_MICRO_VERSION', gtk_micro_version) cdata.set('GTK_BINARY_AGE', gtk_binary_age) cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) + check_headers = [ - ['HAVE_CRT_EXTERNS_H', 'crt/externs.h'], - ['HAVE_DLFCN_H', 'dlfcn.h'], - ['HAVE_FTW_H', 'ftw.h'], - ['HAVE_INTTYPES_H', 'inttypes.h'], - ['HAVE_LOCALE_H', 'locale.h'], - ['HAVE_MEMORY_H', 'memory.h'], - ['HAVE_STDINT_H', 'stdint.h'], - ['HAVE_STDLIB_H', 'stdlib.h'], - ['HAVE_STRINGS_H', 'strings.h'], - ['HAVE_STRING_H', 'string.h'], - ['HAVE_SYS_MMAN_H', 'sys/mman.h'], - ['HAVE_SYS_PARAM_H', 'sys/param.h'], - ['HAVE_SYS_STAT_H', 'sys/stat.h'], - ['HAVE_SYS_SYSINFO_H', 'sys/sysinfo.h'], - ['HAVE_SYS_SYSTEMINFO_H', 'sys/systeminfo.h'], - ['HAVE_SYS_TIME_H', 'sys/time.h'], - ['HAVE_SYS_TYPES_H', 'sys/types.h'], - ['HAVE_UNISTD_H', 'unistd.h'], - ['HAVE_LINUX_MEMFD_H', 'linux/memfd.h'], + 'crt/externs.h', + 'dlfcn.h', + 'ftw.h', + 'inttypes.h', + 'linux/memfd.h', + 'linux/input.h', + 'dev/evdev/input.h', + 'locale.h', + 'memory.h', + 'stdint.h', + 'stdlib.h', + 'string.h', + 'strings.h', + 'sys/mman.h', + 'sys/param.h', + 'sys/stat.h', + 'sys/sysinfo.h', + 'sys/systeminfo.h', + 'sys/time.h', + 'sys/types.h', + 'unistd.h', ] foreach h : check_headers - if cc.has_header(h.get(1)) - cdata.set(h.get(0), 1) + if cc.has_header(h) + cdata.set('HAVE_' + h.underscorify().to_upper(), 1) endif endforeach +# Maths functions might be implemented in libm +libm = cc.find_library('m', required: false) + check_functions = [ -# check token HAVE_BIND_TEXTDOMAIN_CODESET -# check token HAVE_CUPS_API_1_6 - ['HAVE_DCGETTEXT', 'dcgettext', '#include'], - ['HAVE_DECL_ISINF', 'isinf', '#include'], - ['HAVE_DECL_ISNAN', 'isnan', '#include'], - ['HAVE_GETPAGESIZE', 'getpagesize', '#include'], - ['HAVE_GETRESUID', 'getresuid', '#include'], -# check token HAVE_GETTEXT -# check token HAVE_GIO_UNIX -# check token HAVE_GNU_FTW -# check token HAVE_HTTPGETAUTHSTRING -# check token HAVE_HTTP_AUTHSTRING -# check token HAVE_IPRINTDIALOGCALLBACK -# check token HAVE_LC_MESSAGES -# check token HAVE_LOCALTIME_R - ['HAVE_LSTAT', 'lstat', '#include'], - ['HAVE_MMAP', 'mmap', '#include'], - ['HAVE_NEARBYINT', 'nearbyint', '#include'], - ['HAVE_POSIX_FALLOCATE', 'posix_fallocate', '#include'], - ['HAVE__LOCK_FILE', '_lock_file', '#include'], - ['HAVE_FLOCKFILE', 'flockfile', '#include'], - ['HAVE_MKSTEMP', 'mkstemp', '#include'], - ['HAVE_MALLINFO', 'mallinfo', '#include'], - ['HAVE_ROUND', 'round', '#include'], - ['HAVE_RINT', 'rint', '#include'], - ['HAVE_LOG2', 'log2', '#include'], - ['HAVE_EXP2', 'exp2', '#include'], - ['HAVE_SINCOS', 'sincos', '#include'], - ['HAVE_XKB', 'XkbQueryExtension', '#include'], -# check token HAVE_SOCKADDR_UN_SUN_LEN -# check token HAVE_SOLARIS_XINERAMA -# check token HAVE_XFREE_XINERAMA -# check token HAVE_XINERAMA -# check token HAVE__NL_MEASUREMENT_MEASUREMENT -# check token HAVE__NL_PAPER_HEIGHT -# check token HAVE__NL_PAPER_WIDTH -# check token HAVE__NL_TIME_FIRST_WEEKDAY -# check token HAVE__NSGETENVIRON + 'dcgettext', + 'getpagesize', + 'getresuid', + 'lstat', + 'mmap', + 'nearbyint', + 'posix_fallocate', + '_lock_file', + 'flockfile', + 'mkstemp', + 'mallinfo', + 'round', + 'rint', + 'log2', + 'exp2', + 'sincos', + 'trunc', ] -if x11_enabled -check_functions += [ - ['HAVE_XGENERICEVENTS', 'XGetEventData', '#include'], - ['HAVE_XSYNC', 'XSyncQueryExtension', '#include\n#include'] -] -endif -foreach f : check_functions - if cc.has_function(f.get(1), prefix : f.get(2)) - cdata.set(f.get(0), 1) +foreach func : check_functions + if cc.has_function(func, dependencies: libm) + cdata.set('HAVE_' + func.underscorify().to_upper(), 1) endif endforeach -# +cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf')) +cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan')) + # Disable deprecation checks for all libraries we depend on on stable branches. # This is so newer versions of those libraries don't cause more warnings with # a stable GTK version. # We don't ever want to turn off deprecation warnings for master however, because # that's where we get rid of deprecated API we use. -if gtk_minor_version % 2 == 0 +if gtk_minor_version.is_even() cdata.set('GLIB_DISABLE_DEPRECATION_WARNINGS', 1) endif +# Compiler flags +if cc.get_id() == 'msvc' + # Compiler options taken from msvc_recommended_pragmas.h + # in GLib, based on _Win32_Programming_ by Rector and Newcomer + test_cflags = [] + add_project_arguments('-FImsvc_recommended_pragmas.h', language: 'c') + add_project_arguments('-D_USE_MATH_DEFINES', language: 'c') +elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' + test_cflags = [ + '-fno-strict-aliasing', + '-Wpointer-arith', + '-Wimplicit-function-declaration', + '-Wformat=2', + '-Wformat-security', + '-Wnested-externs', + '-Wold-style-definition', + '-Wundef', + '-Wunused', + '-Wcast-align', + '-Wmissing-noreturn', + '-Wmissing-format-attribute', + '-Wmissing-include-dirs', + '-Wlogical-op', + '-Wignored-qualifiers', + '-Werror=implicit', + '-Werror=nonnull', + '-Werror=init-self', + '-Werror=main', + '-Werror=missing-braces', + '-Werror=sequence-point', + '-Werror=return-type', + '-Werror=trigraphs', + '-Werror=array-bounds', + '-Werror=write-strings', + '-Werror=address', + '-Werror=int-to-pointer-cast', + '-Werror=pointer-to-int-cast', + '-Werror=empty-body', + '-Werror=write-strings', + ] +else + test_cflags = [] +endif + +common_cflags = cc.get_supported_arguments(test_cflags) + +# Symbol visibility +if get_option('default_library') != 'static' + if os_win32 + cdata.set('DLL_EXPORT', true) + cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern') + if cc.get_id() != 'msvc' + common_cflags += ['-fvisibility=hidden'] + endif + else + cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) extern') + common_cflags += ['-fvisibility=hidden'] + endif +endif + +common_ldflags = [] + +if os_unix and not os_darwin + foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] + if cc.links('int main () { return 0; }', name: ldflag, args: ldflag) + common_ldflags += [ ldflag ] + endif + endforeach +endif + +# Maintain compatibility with autotools +if os_darwin + common_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ] +endif + confinc = include_directories('.') gdkinc = include_directories('gdk') gtkinc = include_directories('gtk') +testinc = include_directories('tests') -glib_dep = dependency('glib-2.0', version: '>= 2.49.4') -giounix_dep = dependency('gio-unix-2.0', required : false) -pango_dep = dependency('pango', version: '>=1.37.3') -pangoft_dep = dependency('pangoft2', required: wayland_enabled or x11_enabled) -cairo_dep = dependency('cairo', version: '>= 1.14.0') -pangocairo_dep = dependency('pangocairo') -cairogobj_dep = dependency('cairo-gobject') -pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.30.0') -epoxy_dep = dependency('epoxy', version: '>= 1.0') -atk_dep = dependency('atk', version: '>= 2.15.1') -atkbridge_dep = dependency('atk-bridge-2.0') -gmodule_dep = dependency('gmodule-2.0') -colord_dep = dependency('colord', version: '>= 0.1.9', required: false) -fontconfig_dep = dependency('fontconfig') -harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false) -xkbdep = dependency('xkbcommon', version: '>= 0.2.0') +# Dependencies +glib_dep = dependency('glib-2.0', version: glib_req, + fallback : ['glib', 'libglib_dep']) +gobject_dep = dependency('gobject-2.0', version: glib_req, + fallback : ['glib', 'libgobject_dep']) +if os_win32 + giowin32_dep = dependency('gio-windows-2.0', version: glib_req, required: win32_enabled, + fallback : ['glib', 'libgio_dep']) +endif +if os_unix + giounix_dep = dependency('gio-unix-2.0', version: glib_req, required: false, + fallback : ['glib', 'libgio_dep']) +endif +gmodule_dep = dependency('gmodule-2.0', version: glib_req, + fallback : ['glib', 'libgmodule_dep']) +cairo_dep = dependency('cairo', version: cairo_req, required : cc.get_id() != 'msvc') +cairogobj_dep = dependency('cairo-gobject', version: cairo_req, required : cc.get_id() != 'msvc') +pango_dep = dependency('pango', version: pango_req, + fallback : ['pango', 'libpango_dep']) -if wayland_enabled - wlclientdep = dependency('wayland-client', version: '>= 1.9.91') - wlprotocolsdep = dependency('wayland-protocols', version: '>= 1.7') - wlcursordep = dependency('wayland-cursor', version: '>= 1.9.91') - wlegldep = dependency('wayland-egl') +# Require PangoFT2 if on X11 or wayland +require_pangoft2 = wayland_enabled or x11_enabled +pangoft_dep = dependency('pangoft2', required: require_pangoft2, + fallback : ['pango', 'libpangoft2_dep']) + +if pangoft_dep.found() + # Need at least 2.7.1 for FT_Get_Var_Design_Coordinates() + # We get the dependency itself from pango, but pango doesn't care + # about ft2 version, so an extra check is needed. + ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: require_pangoft2) endif +if win32_enabled + # for GTK_IM_CONTEXT_IME + pangowin32_dep = dependency('pangowin32') +endif + +pangocairo_dep = dependency('pangocairo', version: cairo_req, + fallback : ['pango', 'libpangocairo_dep']) +pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req, + fallback : ['gdk-pixbuf', 'gdkpixbuf_dep']) +epoxy_dep = dependency('epoxy', version: epoxy_req, + fallback: ['libepoxy', 'libepoxy_dep']) +atk_dep = dependency('atk', version: atk_req) +harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false, + fallback: ['harfbuzz', 'libharfbuzz_dep']) +xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled) +iso_codes_dep = dependency('iso-codes', required: false) + +fontconfig_dep = [] # only used in x11 backend +atkbridge_dep = [] # only used in x11 backend + +if os_win32 + platform_gio_dep = giowin32_dep +endif +if os_unix + platform_gio_dep = giounix_dep +endif + +if iso_codes_dep.found() + cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix')) +else + cdata.set_quoted('ISO_CODES_PREFIX', '/usr') +endif + +backend_immodules = [] + +pc_gdk_extra_libs = [] + +cairo_backends = [] +foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled], + ['cairo-win32', cairo_req, win32_enabled], + ['cairo-quartz', cairo_req, quartz_enabled], + ['cairo', cairo_req, broadway_enabled or wayland_enabled], ] + backend_enabled = backend.get(2) + cairo_backend_req = backend.get(1) + cairo_backend = backend.get(0) + if backend_enabled + if dependency(cairo_backend, version: cairo_backend_req, required : cc.get_id() != 'msvc').found() + cairo_backends += [ cairo_backend ] + endif + endif +endforeach + +cairo_pkg_found = false +cairogobj_pkg_found = false + +if cairo_dep.found() + cairo_pkg_found = true +endif +if cairogobj_dep.found() + cairogobj_pkg_found = true +endif + +cairo_libs = [] + +cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found()) +cdata.set('HAVE_PANGOFT', pangoft_dep.found()) + +atk_pkgs = ['atk'] + +wayland_pkgs = [] +if wayland_enabled + wlclientdep = dependency('wayland-client', version: wayland_req) + wlprotocolsdep = dependency('wayland-protocols', version: wayland_proto_req) + wlcursordep = dependency('wayland-cursor', version: wayland_req) + wlegldep = dependency('wayland-egl') + backend_immodules += ['wayland'] + + wayland_pkgs = [ + 'wayland-client', wayland_req, + 'wayland-protocols', wayland_proto_req, + 'xkbcommon', xkbcommon_req, + 'wayland-cursor', wayland_req, + 'wayland-egl', + ] +endif + +x11_pkgs = [] if x11_enabled xrandr_dep = dependency('xrandr', version: '>= 1.2.99') xrandr15_dep = dependency('xrandr', version: '>= 1.5', required: false) @@ -200,67 +426,275 @@ if x11_enabled xdamage_dep = dependency('xdamage', required: false) xfixes_dep = dependency('xfixes', required: false) xcomposite_dep = dependency('xcomposite', required: false) + fontconfig_dep = dependency('fontconfig') + atkbridge_dep = dependency('atk-bridge-2.0', version: atk_req) + backend_immodules += ['xim'] - if xdamage_dep.found() - cdata.set('HAVE_XDAMAGE', 1) - endif + x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr'] if xcursor_dep.found() - cdata.set('HAVE_XCURSOR', 1) + x11_pkgs += ['xcursor'] endif - - if xcomposite_dep.found() - cdata.set('HAVE_XCOMPOSITE', 1) - endif - if xfixes_dep.found() - cdata.set('HAVE_XFIXES', 1) + x11_pkgs += ['xfixes'] + endif + if xcomposite_dep.found() + x11_pkgs += ['xcomposite'] + endif + if xdamage_dep.found() + x11_pkgs += ['xdamage'] endif + atk_pkgs += ['atk-bridge-2.0'] + cdata.set('HAVE_XDAMAGE', xdamage_dep.found()) + cdata.set('HAVE_XCURSOR', xcursor_dep.found()) + cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found()) + cdata.set('HAVE_XFIXES', xfixes_dep.found()) - if xi_dep.found() and cc.has_header('X11/extensions/XInput2.h') + if cc.has_function('XkbQueryExtension', dependencies: x11_dep, + prefix : '#include ') + cdata.set('HAVE_XKB', 1) + endif + + if cc.has_function('XSyncQueryExtension', dependencies: xext_dep, + prefix: '''#include + #include ''') + cdata.set('HAVE_XSYNC', 1) + endif + + if cc.has_function('XGetEventData', dependencies: x11_dep) + cdata.set('HAVE_XGENERICEVENTS', 1) + endif + + if xi_dep.found() and cc.has_header('X11/extensions/XInput2.h', dependencies: xi_dep) cdata.set('XINPUT_2', 1) - prefix = '#include\n#include' - if cc.has_function('XIAllowTouchEvents', prefix: prefix) and cc.has_member('XIScrollClassInfo', 'number', prefix: prefix) + # Note that we also check that the XIScrollClassInfo struct is defined, + # because at least Ubuntu Oneiric seems to have XIAllowTouchEvents(), + # but not the XIScrollClassInfo struct + has_allow_touch_evens = cc.has_function('XIAllowTouchEvents', dependencies: xi_dep) + has_scroll_class_info = cc.has_member('XIScrollClassInfo', 'number', dependencies: xi_dep, + prefix: '''#include + #include ''') + if has_allow_touch_evens and has_scroll_class_info cdata.set('XINPUT_2_2', 1) endif endif - if xrandr_dep.found() - cdata.set('HAVE_RANDR', 1) + enable_xinerama = get_option('xinerama') + if enable_xinerama != 'no' + want_xinerama = enable_xinerama == 'yes' + xinerama_dep = dependency('xinerama', required: want_xinerama) + if xinerama_dep.found() and cc.has_header_symbol('X11/extensions/Xinerama.h', 'XineramaQueryExtension', dependencies: xinerama_dep) + cdata.set('HAVE_XFREE_XINERAMA', 1) + x11_pkgs += ['xinerama'] + endif + else + xinerama_dep = [] + endif - if xrandr15_dep.found() - cdata.set('HAVE_RANDR15', 1) + cdata.set('HAVE_RANDR', xrandr_dep.found()) + cdata.set('HAVE_RANDR15', xrandr15_dep.found()) +endif + +if broadway_enabled + pc_gdk_extra_libs += ['-lz'] + backend_immodules += ['broadway'] +endif + +if quartz_enabled + pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon'] + backend_immodules += ['quartz'] +endif + +extra_demo_ldflags = [] +if win32_enabled + pc_gdk_extra_libs += ['-lgdi32', '-limm32', '-lshell32', '-lole32'] + if cc.get_id() == 'msvc' + # Since the demo programs are now built as pure GUI programs, we + # need to pass in /entry:mainCRTStartup so that they will properly + # link on Visual Studio builds + extra_demo_ldflags = ['/entry:mainCRTStartup'] + else + pc_gdk_extra_libs += ['-Wl,-luuid'] + endif + pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32'] + backend_immodules += ['ime'] +endif + +# Check for bind_textdomain_codeset, including -lintl if GLib brings it in by +# doing the same check as glib. We can't check that by linking to glib because +# it might be a subproject and hence not built yet. +if cc.has_function('ngettext') + libintl_dep = [] + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) +else + libintl_dep = cc.find_library('intl', required : false) + if cc.has_function('bind_textdomain_codeset', dependencies: libintl_dep) + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) + else + # Don't use subproject('proxy-libintl').get_variable('intl_dep') because that + # makes the dependency unconditional. This way, people have the option of + # either not providing the subproject or disabling it entirely with + # --wrap-mode=nodownload or nofallback. + libintl_dep = dependency('', required : false, + fallback: ['proxy-libintl', 'intl_dep']) + if libintl_dep.found() + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) endif endif endif -mlib = cc.find_library('m', required: false) -shmlib = cc.find_library('rt') - -if giounix_dep.found() - cdata.set('HAVE_GIO_UNIX', 1) +if os_unix + cdata.set('HAVE_GIO_UNIX', giounix_dep.found()) endif -if colord_dep.found() - cdata.set('HAVE_COLORD', 1) +cloudproviders_enabled = get_option('cloudproviders') +if cloudproviders_enabled + cloudproviders_dep = dependency('cloudproviders', required: true) + if cloudproviders_dep.found() + cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found()) + else + error('Cloudproviders support not found, but was explicitly requested.') + endif endif -if mlib.found() - cdata.set('HAVE_LIBM', 1) -endif - -configure_file( - input : 'config.h.meson', - output: 'config.h', - configuration: cdata -) - subdir('gdk') subdir('gtk') -subdir('demos') -subdir('tests') -subdir('testsuite') -subdir('examples') +subdir('modules') +if get_option('demos') + subdir('demos') +endif +if get_option('build-tests') + subdir('tests') + subdir('testsuite') +endif +if get_option('build-examples') + subdir('examples') +endif + +# config.h +configure_file(input: 'config.h.meson', + output: 'config.h', + configuration: cdata) + +# pkg-config files - bit of a mess all of this +pkgconf = configuration_data() + +pkgconf.set('prefix', get_option('prefix')) +pkgconf.set('exec_prefix', '${prefix}') +pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir'))) +pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir'))) +pkgconf.set('GTK_API_VERSION', gtk_api_version) +pkgconf.set('VERSION', meson.project_version()) +pkgconf.set('GTK_BINARY_VERSION', gtk_binary_version) +pkgconf.set('host', '@0@-@1@'.format(host_machine.cpu_family(), host_machine.system())) # FIXME + +# Requires +pango_pkgname = win32_enabled ? 'pangowin32' : 'pango' +gdk_packages = ' '.join([ pango_pkgname, pango_req, + 'pangocairo', pango_req, + 'gdk-pixbuf-2.0', gdk_pixbuf_req ]) + +if cairo_pkg_found + gdk_packages += ' '.join([ ' cairo', cairo_req ]) +endif +if cairogobj_pkg_found + gdk_packages += ' '.join([ ' cairo-gobject', cairo_req ]) +endif + +pkgconf.set('GDK_PACKAGES', gdk_packages) +pkgconf.set('GTK_PACKAGES', + ' '.join([ 'atk', atk_req, + 'gio-2.0', glib_req ])) + +# Requires.private +pc_gdk_extra_libs += cairo_libs + +gio_pkgname = os_unix ? 'gio-unix-2.0' : 'gio-2.0' +pkgconf.set('GDK_PRIVATE_PACKAGES', + ' '.join([ gio_pkgname, glib_req, + 'epoxy', epoxy_req ] + x11_pkgs + wayland_pkgs + cairo_backends)) +pangoft2_pkgs = (wayland_enabled or x11_enabled) ? ['pangoft2'] : [] +pkgconf.set('GTK_PRIVATE_PACKAGES', ' '.join(atk_pkgs + pangoft2_pkgs)) + +pkgconf.set('GDK_EXTRA_LIBS', ' '.join(pc_gdk_extra_libs)) +pkgconf.set('GSK_EXTRA_LIBS', '') +pkgconf.set('GTK_EXTRA_LIBS', '') + +pkgconf.set('GDK_EXTRA_CFLAGS', '') +pkgconf.set('GSK_EXTRA_CFLAGS', '') +pkgconf.set('GTK_EXTRA_CFLAGS', '') + +pkg_install_dir = join_paths(get_option('libdir'), 'pkgconfig') + +pkgs = [ 'gtk+-3.0.pc' ] + +pkg_targets = '' +foreach backend: [ 'broadway', 'quartz', 'wayland', 'win32', 'x11', ] + if get_variable('@0@_enabled'.format(backend)) + pkgs += ['gtk+-@0@-3.0.pc'.format(backend)] + pkg_targets += ' ' + backend + endif +endforeach +pkgconf.set('GDK_BACKENDS', pkg_targets.strip()) + +configure_file(input: 'gdk-3.0.pc.in', + output: 'gdk-3.0.pc', + configuration: pkgconf, + install_dir: pkg_install_dir) + +foreach pkg: pkgs + configure_file(input: 'gtk+-3.0.pc.in', + output: pkg, + configuration: pkgconf, + install_dir: pkg_install_dir) +endforeach + +if os_unix + configure_file(input: 'gtk+-unix-print-3.0.pc.in', + output: 'gtk+-unix-print-3.0.pc', + configuration: pkgconf, + install_dir: pkg_install_dir) +endif + +# TODO +#subdir('po') +#subdir('po-properties') +#if get_option('documentation') +# subdir('docs/tools') +# subdir('docs/reference') +#endif + +# Keep this in sync with post-install.sh expected arguments +meson.add_install_script('build-aux/meson/post-install.sh', + gtk_api_version, + gtk_binary_version, + gtk_libdir, + gtk_datadir) + +summary = [ + '', + '------', + 'GTK+ @0@ (@1@)'.format(gtk_version, gtk_api_version), + '', + ' Display backends: @0@'.format(pkg_targets.strip()), + ' Print backends: @0@'.format(' '.join(print_backends)), + ' Cloud support: @0@'.format(get_option('cloudproviders')), + ' Colord support: @0@'.format(get_option('colord')), + ' Introspection: @0@'.format(get_option('introspection')), + ' Documentation: @0@'.format(get_option('documentation')), + ' Build tests: @0@'.format(get_option('build-tests')), + ' Demos: @0@'.format(get_option('demos')), + ' Examples: @0@'.format(get_option('build-examples')), + 'Directories:', + ' prefix: @0@'.format(gtk_prefix), + ' includedir: @0@'.format(gtk_includedir), + ' libdir: @0@'.format(gtk_libdir), + ' datadir: @0@'.format(gtk_datadir), + '------', + '' +] + +message('\n'.join(summary)) diff --git a/meson_options.txt b/meson_options.txt index e8f8ee60e9..79aca2aa66 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,39 @@ -option('enable-x11-backend', type: 'boolean', value: 'true') -option('enable-wayland-backend', type: 'boolean', value: 'true') -option('enable-broadway-backend', type: 'boolean', value: 'false') +# GDK backends +option('x11-backend', type: 'boolean', value: true, + description : 'Enable the X11 gdk backend (only when building on Unix)') +option('wayland-backend', type: 'boolean', value: true, + description : 'Enable the wayland gdk backend (only when building on Unix except for macOS)') +option('broadway-backend', type: 'boolean', value: false, + description : 'Enable the broadway (HTML5) gdk backend') +option('win32-backend', type: 'boolean', value: true, + description : 'Enable the Windows gdk backend (only when building on Windows)') +option('quartz-backend', type: 'boolean', value: true, + description : 'Enable the macOS gdk backend (only when building on macOS)') + +# Optional dependencies +option('xinerama', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', + description : 'Enable support for the Xinerama extension') +option('cloudproviders', type: 'boolean', value: false, + description : 'Enable the cloudproviders support') + +# Print backends +option('print-backends', type : 'string', value : 'cups,file', + description : 'Build the specified print backends (comma-separated list, "all", or "none")') +option('colord', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', + description : 'Build colord support for the CUPS printing backend') + +# Documentation and introspection +option('documentation', type: 'boolean', value: 'false', + description : 'Build API reference and tools documentation') +option('man-pages', type: 'boolean', value: 'false', + description : 'Build man pages for installed tools') +option('introspection', type: 'boolean', value: 'true', + description : 'Build introspection data (requires gobject-introspection)') + +# Demos and binaries +option('demos', type: 'boolean', value: 'true', + description : 'Build demo programs') +option('build-examples', type: 'boolean', value: 'true', + description : 'Build examples') +option('build-tests', type: 'boolean', value: 'true', + description : 'Build tests') diff --git a/modules/meson.build b/modules/meson.build new file mode 100644 index 0000000000..9779ee6ae8 --- /dev/null +++ b/modules/meson.build @@ -0,0 +1,8 @@ +# TODO +#if os_unix +# subdir('printbackends') +#else + print_backends = [] +#endif + +#subdir('input') diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build index 6c33c5e165..326c6545a8 100644 --- a/testsuite/gdk/meson.build +++ b/testsuite/gdk/meson.build @@ -1,24 +1,24 @@ -test_cairo = executable('cairo', 'cairo.c', dependencies: libgdk_dep) +test_cairo = executable('cairo', 'cairo.c', dependencies: libgtk_dep) test('gdk/cairo', test_cairo) -test_display = executable('display', 'display.c', dependencies: libgdk_dep) +test_display = executable('display', 'display.c', dependencies: libgtk_dep) test('gdk/display', test_display) -test_encoding = executable('encoding', 'encoding.c', dependencies: libgdk_dep) +test_encoding = executable('encoding', 'encoding.c', dependencies: libgtk_dep) test('gdk/encoding', test_encoding) -test_keysyms = executable('keysyms', 'keysyms.c', dependencies: libgdk_dep) +test_keysyms = executable('keysyms', 'keysyms.c', dependencies: libgtk_dep) test('gdk/keysyms', test_keysyms) -test_rectangle = executable('rectangle', 'rectangle.c', dependencies: libgdk_dep) +test_rectangle = executable('rectangle', 'rectangle.c', dependencies: libgtk_dep) test('gdk/rectangle', test_rectangle) -test_rgba = executable('rgba', 'rgba.c', dependencies: libgdk_dep) +test_rgba = executable('rgba', 'rgba.c', dependencies: libgtk_dep) test('gdk/rgba', test_rgba) -test_seat = executable('seat', 'seat.c', dependencies: libgdk_dep) +test_seat = executable('seat', 'seat.c', dependencies: libgtk_dep) test('gdk/seat', test_seat) -test_visual = executable('visual', 'visual.c', dependencies: libgdk_dep) +test_visual = executable('visual', 'visual.c', dependencies: libgtk_dep) test('gdk/visual', test_visual) diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index a11db7be76..ad1789c48c 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -1,150 +1,109 @@ -test_accel = executable('accel', 'accel.c', dependencies: libgtk_dep) -test('gtk/accel test', test_accel) +gtk_tests_export_dynamic_ldflag = [] -test_accessible = executable('accessible', 'accessible.c', dependencies: libgtk_dep) -test('gtk/accessible test', test_accessible) +if cc.get_id() != 'msvc' + gtk_tests_export_dynamic_ldflag = ['-Wl,--export-dynamic'] +endif -test_action = executable('action', 'action.c', dependencies: libgtk_dep) -test('gtk/action test', test_action) +tests = [ + ['accel'], + ['accessible'], + ['action'], + ['adjustment'], + ['bitmask', ['../../gtk/gtkallocatedbitmask.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']], + ['builder', [], [], gtk_tests_export_dynamic_ldflag], + ['builderparser'], + ['cellarea'], + ['check-icon-names'], + ['check-cursor-names'], + ['cssprovider'], + ['defaultvalue'], + ['entry'], + ['firefox-stylecontext'], + ['floating'], + ['focus'], + ['gestures'], + ['grid'], + ['gtkmenu'], + ['icontheme'], + ['keyhash', ['../../gtk/gtkkeyhash.c', gtkresources, '../../gtk/gtkprivate.c'], gtk_cargs], + ['listbox'], + ['notify'], + ['no-gtk-init'], + ['object'], + ['papersize'], + ['rbtree', ['../../gtk/gtkrbtree.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']], + ['recentmanager'], + ['regression-tests'], + ['scrolledwindow'], + ['spinbutton'], + ['stylecontext'], + ['templates'], + ['textbuffer'], + ['textiter'], + ['treemodel', ['treemodel.c', 'liststore.c', 'treestore.c', 'filtermodel.c', + 'modelrefcount.c', 'sortmodel.c', 'gtktreemodelrefcount.c']], + ['treepath'], + ['treeview'], + ['typename'], + ['window'], + ['displayclose'], + ['revealer-size'], +] +test_cargs = [] -test_adjustment = executable('adjustment', 'adjustment.c', dependencies: libgtk_dep) -test('gtk/adjustment test', test_adjustment) +if os_unix + # tests += [['defaultvalue']] # disabled in Makefile.am as well + test_cargs += ['-DHAVE_UNIX_PRINT_WIDGETS'] +endif -test_bitmask = executable('bitmask', 'bitmask.c', dependencies: libgtk_dep) -test('gtk/bitmask test', test_bitmask) - -test_builder = executable('builder', 'builder.c', dependencies: libgtk_dep) -test('gtk/builder test', test_builder) - -test_builderparser = executable( - 'builderparser', - 'builderparser.c', - dependencies: libgtk_dep, - link_with: libgtk, - -) -test( - 'gtk/builderparser test', - test_builderparser, - env: [ - 'G_TEST_SRCDIR='+meson.source_root(), - 'G_TEST_BUILDDIR='+meson.build_root() +if x11_enabled + tests += [ + ['clipboard'], + ['objects-finalize', ['../../gdk/x11/gdkdisplaymanager-x11.c'], ['-DGDK_COMPILATION', '-UG_ENABLE_DEBUG']], ] -) +endif -test_cellarea = executable('cellarea', 'cellarea.c', dependencies: libgtk_dep) -test('gtk/cellarea test', test_cellarea) +foreach t : tests + test_name = t.get(0) + test_srcs = ['@0@.c'.format(test_name)] + t.get(1, []) + test_extra_cargs = t.get(2, []) + test_extra_ldflags = t.get(3, []) -test_check_icon_names = executable('check_icon_names', 'check-icon-names.c', dependencies: libgtk_dep) -test('gtk/check_icon_names test', test_check_icon_names) + test_exe = executable(test_name, test_srcs, + c_args : test_cargs + test_extra_cargs, + link_args : test_extra_ldflags, + dependencies : libgtk_dep) -test_check_cursor_names = executable('check_cursor_names', 'check-cursor-names.c', dependencies: libgtk_dep) -test('gtk/check_cursor_names test', test_check_cursor_names) + test(test_name, test_exe, + args: [ '--tap', '-k' ], + env: [ 'GIO_USE_VOLUME_MONITOR=unix', + 'GSETTINGS_BACKEND=memory', + 'GTK_CSD=1', + 'G_ENABLE_DIAGNOSTIC=0', + 'GSK_RENDERER=cairo', + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), + 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), + ], + suite: 'gtk') +endforeach -test_clipboard = executable('clipboard', 'clipboard.c', dependencies: libgtk_dep) -test('gtk/clipboard test', test_clipboard) - -test_cssprovider = executable('cssprovider', 'cssprovider.c', dependencies: libgtk_dep) -test('gtk/cssprovider test', test_cssprovider) - -test_defaultvalue = executable('defaultvalue', 'defaultvalue.c', dependencies: libgtk_dep) -test('gtk/defaultvalue test', test_defaultvalue) - -test_entry = executable('entry', 'entry.c', dependencies: libgtk_dep) -test('gtk/entry test', test_entry) - -test_firefox_stylecontext = executable('firefox_stylecontext', 'firefox-stylecontext.c', dependencies: libgtk_dep) -test('gtk/firefox_stylecontext test', test_firefox_stylecontext) - -test_floating = executable('floating', 'floating.c', dependencies: libgtk_dep) -test('gtk/floating test', test_floating) - -test_focus = executable('focus', 'focus.c', dependencies: libgtk_dep) -test('gtk/focus test', test_focus) - -test_gestures = executable('gestures', 'gestures.c', dependencies: libgtk_dep) -test('gtk/gestures test', test_gestures) - -test_grid = executable('grid', 'grid.c', dependencies: libgtk_dep) -test('gtk/grid test', test_grid) - -test_gtkmenu = executable('gtkmenu', 'gtkmenu.c', dependencies: libgtk_dep) -test('gtk/gtkmenu test', test_gtkmenu) - -test_icontheme = executable('icontheme', 'icontheme.c', dependencies: libgtk_dep) -test('gtk/icontheme test', test_icontheme) - -test_keyhash = executable('keyhash', 'keyhash.c', dependencies: libgtk_dep) -test('gtk/keyhash test', test_keyhash) - -test_listbox = executable('listbox', 'listbox.c', dependencies: libgtk_dep) -test('gtk/listbox test', test_listbox) - -test_notify = executable('notify', 'notify.c', dependencies: libgtk_dep) -test('gtk/notify test', test_notify) - -test_no_gtk_init = executable('no_gtk_init', 'no-gtk-init.c', dependencies: libgtk_dep) -test('gtk/no_gtk_init test', test_no_gtk_init) - -test_object = executable('object', 'object.c', dependencies: libgtk_dep) -test('gtk/object test', test_object) - -test_objects_finalize = executable('objects_finalize', 'objects-finalize.c', dependencies: libgtk_dep) -test('gtk/objects_finalize test', test_objects_finalize) - -test_papersize = executable('papersize', 'papersize.c', dependencies: libgtk_dep) -test('gtk/papersize test', test_papersize) - -test_rbtree = executable('rbtree', 'rbtree.c', dependencies: libgtk_dep) -test('gtk/rbtree test', test_rbtree) - -test_recentmanager = executable('recentmanager', 'recentmanager.c', dependencies: libgtk_dep) -test('gtk/recentmanager test', test_recentmanager) - -test_regression_tests = executable('regression_tests', 'regression-tests.c', dependencies: libgtk_dep) -test('gtk/regression_tests test', test_regression_tests) - -test_scrolledwindow = executable('scrolledwindow', 'scrolledwindow.c', dependencies: libgtk_dep) -test('gtk/scrolledwindow test', test_scrolledwindow) - -test_spinbutton = executable('spinbutton', 'spinbutton.c', dependencies: libgtk_dep) -test('gtk/spinbutton test', test_spinbutton) - -test_stylecontext = executable('stylecontext', 'stylecontext.c', dependencies: libgtk_dep) -test('gtk/stylecontext test', test_stylecontext) - -test_templates = executable('templates', 'templates.c', dependencies: libgtk_dep) -test('gtk/templates test', test_templates) - -test_textbuffer = executable('textbuffer', 'textbuffer.c', dependencies: libgtk_dep) -test('gtk/textbuffer test', test_textbuffer) - -test_textiter = executable('textiter', 'textiter.c', dependencies: libgtk_dep) -test('gtk/textiter test', test_textiter) - -test_treemodel = executable( - 'treemodel', - 'treemodel.c', 'liststore.c', 'treestore.c', 'filtermodel.c', - 'modelrefcount.c', 'sortmodel.c', 'gtktreemodelrefcount.c', - dependencies: libgtk_dep -) -test('gtk/treemodel test', test_treemodel) - -test_treepath = executable('treepath', 'treepath.c', dependencies: libgtk_dep) -test('gtk/treepath test', test_treepath) - -test_treeview = executable('treeview', 'treeview.c', dependencies: libgtk_dep) -test('gtk/treeview test', test_treeview) - -test_typename = executable('typename', 'typename.c', dependencies: libgtk_dep) -test('gtk/typename test', test_typename) - -test_window = executable('window', 'window.c', dependencies: libgtk_dep) -test('gtk/window test', test_window) - -test_displayclose = executable('displayclose', 'displayclose.c', dependencies: libgtk_dep) -test('gtk/displayclose test', test_displayclose) - -test_revealer_size = executable('revealer_size', 'revealer-size.c', dependencies: libgtk_dep) -test('gtk/revealer_size test', test_revealer_size) +# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++ +if add_languages('cpp', required: false) + test_exe = executable('autotestkeywords', + 'autotestkeywords.cc', + c_args : test_cargs + ['-Idummy-headers'], + dependencies : libgtk_dep) + test('c++ keywords', test_exe, + args: [ '--tap', '-k' ], + env: [ 'GIO_USE_VOLUME_MONITOR=unix', + 'GSETTINGS_BACKEND=memory', + 'GTK_CSD=1', + 'G_ENABLE_DIAGNOSTIC=0', + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), + 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), + ], + suite: 'gtk') +endif From 00842f4d4e121c419d702cb8a3cb1abc7fcd3cb0 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 20 Nov 2018 16:08:02 +0530 Subject: [PATCH 04/89] gtk-launch: Fix compilation with MSVC --- gtk/gtk-launch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/gtk-launch.c b/gtk/gtk-launch.c index ccf1bd8d4b..87b351bf2a 100644 --- a/gtk/gtk-launch.c +++ b/gtk/gtk-launch.c @@ -21,7 +21,9 @@ #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include @@ -136,7 +138,9 @@ main (int argc, char *argv[]) info = G_APP_INFO (g_desktop_app_info_new (desktop_file_name)); g_free (desktop_file_name); #else -#warning Please add support for creating AppInfo from id for your OS + #ifndef _MSC_VER + #warning Please add support for creating AppInfo from id for your OS + #endif g_printerr (_("Creating AppInfo from id not supported on non unix operating systems")); #endif args++; From ea6e3b3ddf46e5f2e65d525b4ea9d6025e31f084 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 20 Nov 2018 16:12:48 +0530 Subject: [PATCH 05/89] meson_options.txt: Disable introspection by default It's broken. Fix later. --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 79aca2aa66..782f7153f4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -27,7 +27,7 @@ option('documentation', type: 'boolean', value: 'false', description : 'Build API reference and tools documentation') option('man-pages', type: 'boolean', value: 'false', description : 'Build man pages for installed tools') -option('introspection', type: 'boolean', value: 'true', +option('introspection', type: 'boolean', value: 'false', description : 'Build introspection data (requires gobject-introspection)') # Demos and binaries From 9109efb19e4bc92a81ad972f938856c6d6bf01f8 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 25 Nov 2018 17:20:54 +0000 Subject: [PATCH 06/89] meson: Disable X11 support on Darwin The Quartz backend should fulfill most requirements anyway. --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index a78876f884..94ed7e155a 100644 --- a/meson.build +++ b/meson.build @@ -108,6 +108,7 @@ os_unix = not os_win32 if os_darwin wayland_enabled = false + x11_enabled = false else quartz_enabled = false endif From cde5a3f4b43263076a8c0fefbaf22b38417e0fa3 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 25 Nov 2018 17:22:30 +0000 Subject: [PATCH 07/89] gtk: Fix paste/clipboard usage on macOS In Mojave the build fails because declareTypes is nil. Instead use the clearContents method, although I'm not really sure this is the same. --- gtk/gtkdnd-quartz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index f4ee86982e..072b7e4e12 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -1588,7 +1588,7 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info) * info->context after it has been destroyed. */ pasteboard = [NSPasteboard pasteboardWithName: NSDragPboard]; - [pasteboard declareTypes: nil owner: nil]; + [pasteboard clearContents]; [pool release]; From 89d5c543accd910fc00e604c328cc7a1e72d476f Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 25 Nov 2018 17:25:32 +0000 Subject: [PATCH 08/89] meson: Build fixes for macOS --- gdk/meson.build | 3 +++ gdk/quartz/meson.build | 12 +++++++++--- gtk/meson.build | 2 +- meson.build | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gdk/meson.build b/gdk/meson.build index e9e7b8a819..6a75a9fed5 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -249,6 +249,9 @@ foreach backend : ['broadway', 'quartz', 'wayland', 'win32', 'x11'] if backend == 'wayland' gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend)) endif + if backend == 'quartz' + common_cflags += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c'] + endif endif endforeach diff --git a/gdk/quartz/meson.build b/gdk/quartz/meson.build index 8c1b8d1795..1f137d18f8 100644 --- a/gdk/quartz/meson.build +++ b/gdk/quartz/meson.build @@ -1,4 +1,6 @@ -# FIXME: do we need to do an add_language() for objective-c here? + +add_languages(['objc']) + gdk_quartz_sources = files( 'GdkQuartzView.c', 'GdkQuartzNSWindow.c', @@ -41,8 +43,12 @@ gdk_quartz_public_headers = files( install_headers(gdk_quartz_public_headers, subdir: 'gtk-3.0/gdk/quartz') install_headers('gdkquartz.h', subdir: 'gtk-3.0/gdk') -gdk_quartz_deps = [ # FIXME -] +core_graphics_dep = dependency('appleframeworks', modules : 'CoreGraphics', required : true) +appkit_dep = dependency('appleframeworks', modules : 'AppKit', required : true) +cocoa_dep = dependency('appleframeworks', modules : 'Cocoa', required : true) +carbon_dep = dependency('appleframeworks', modules : 'Carbon', required : true) + +gdk_quartz_deps = [ core_graphics_dep, appkit_dep, cocoa_dep, carbon_dep ] libgdk_quartz = static_library('gdk-quartz', gdk_quartz_sources, gdkconfig, gdkenum_h, diff --git a/gtk/meson.build b/gtk/meson.build index 9526c049f7..b527f136f0 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -846,7 +846,7 @@ endif if quartz_enabled gtk_sources += gtk_use_quartz_sources - gtk_cargs += ['-xobjective-c'] # FIXME? maybe add_languages() instead? + gtk_cargs += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c'] # FIXME? maybe add_languages() instead? endif # So we don't add these twice diff --git a/meson.build b/meson.build index 94ed7e155a..06cf577d47 100644 --- a/meson.build +++ b/meson.build @@ -505,7 +505,7 @@ if broadway_enabled endif if quartz_enabled - pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon'] + pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon', '-framework CoreGraphics'] backend_immodules += ['quartz'] endif From 4eb2f297f1647a2bf6a3c2a391ed69bc6a8569f4 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 25 Nov 2018 17:24:41 +0000 Subject: [PATCH 09/89] meson: Disable --export-dynamic for clang It doesn't seem to be supported, at least when compiling on macOS. --- testsuite/gtk/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index ad1789c48c..67863593a4 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -1,6 +1,6 @@ gtk_tests_export_dynamic_ldflag = [] -if cc.get_id() != 'msvc' +if cc.get_id() != 'msvc' and cc.get_id() != 'clang' gtk_tests_export_dynamic_ldflag = ['-Wl,--export-dynamic'] endif From 215c2be76fe4efa15c9fb4f49b185e5dca05b79b Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 25 Nov 2018 17:17:29 +0000 Subject: [PATCH 10/89] meson: Set the compatibility version correctly on macOS And bump to Meson 0.48 as this feature requires it. --- gdk/meson.build | 1 + gtk/meson.build | 1 + meson.build | 9 ++------- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/gdk/meson.build b/gdk/meson.build index 6a75a9fed5..0d88e8e45a 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -269,6 +269,7 @@ libgdk = shared_library('gdk-3', ] + common_cflags, link_whole: gdk_backends, link_args: common_ldflags, + darwin_versions : gtk_osxversions, install: true) libgdk_dep = declare_dependency( diff --git a/gtk/meson.build b/gtk/meson.build index b527f136f0..531f2e962f 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -897,6 +897,7 @@ libgtk = shared_library('gtk-3', dependencies: gtk_deps + [libgdk_dep], link_with: libgdk, link_args: common_ldflags, + darwin_versions : gtk_osxversions, install: true) gtk_dep_sources = [gtkversion, gtktypebuiltins_h] diff --git a/meson.build b/meson.build index 06cf577d47..f0ed6216a3 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('gtk+-3.0', 'c', 'c_std=gnu89', 'warning_level=1' ], - meson_version : '>= 0.43.0', + meson_version : '>= 0.48.0', license: 'LGPLv2.1+') glib_major_req = 2 @@ -79,6 +79,7 @@ gtk_binary_version = '3.0.0' gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version gtk_soversion = '0.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk_interface_age) +gtk_osxversions = [(100 * gtk_minor_version) + 1, '@0@.@1@.0'.format((100 * gtk_minor_version) + 1, gtk_micro_version)] gtk_api_version = '@0@.0'.format(gtk_major_version) @@ -286,12 +287,6 @@ if os_unix and not os_darwin endforeach endif -# Maintain compatibility with autotools -if os_darwin - common_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ] -endif - - confinc = include_directories('.') gdkinc = include_directories('gdk') gtkinc = include_directories('gtk') From ca63c9844771f58686c1f05a8178737cecf6ba6a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 30 Nov 2018 16:28:37 +0530 Subject: [PATCH 11/89] meson: Add fallback subprojects for more dependencies --- meson.build | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index f0ed6216a3..9a9537589d 100644 --- a/meson.build +++ b/meson.build @@ -307,8 +307,10 @@ if os_unix endif gmodule_dep = dependency('gmodule-2.0', version: glib_req, fallback : ['glib', 'libgmodule_dep']) -cairo_dep = dependency('cairo', version: cairo_req, required : cc.get_id() != 'msvc') -cairogobj_dep = dependency('cairo-gobject', version: cairo_req, required : cc.get_id() != 'msvc') +cairo_dep = dependency('cairo', version: cairo_req, + fallback : ['cairo', 'libcairo_dep']) +cairogobj_dep = dependency('cairo-gobject', version: cairo_req, + fallback : ['cairo', 'libcairogobject_dep']) pango_dep = dependency('pango', version: pango_req, fallback : ['pango', 'libpango_dep']) @@ -321,12 +323,13 @@ if pangoft_dep.found() # Need at least 2.7.1 for FT_Get_Var_Design_Coordinates() # We get the dependency itself from pango, but pango doesn't care # about ft2 version, so an extra check is needed. - ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: require_pangoft2) + ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: require_pangoft2, + fallback : ['freetype2', 'freetype_dep']) endif if win32_enabled # for GTK_IM_CONTEXT_IME - pangowin32_dep = dependency('pangowin32') + pangowin32_dep = dependency('pangowin32', fallback : ['pango', 'libpangowin32_dep']) endif pangocairo_dep = dependency('pangocairo', version: cairo_req, @@ -335,7 +338,8 @@ pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req, fallback : ['gdk-pixbuf', 'gdkpixbuf_dep']) epoxy_dep = dependency('epoxy', version: epoxy_req, fallback: ['libepoxy', 'libepoxy_dep']) -atk_dep = dependency('atk', version: atk_req) +atk_dep = dependency('atk', version: atk_req, + fallback : ['atk', 'libatk_dep']) harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false, fallback: ['harfbuzz', 'libharfbuzz_dep']) xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled) @@ -361,19 +365,32 @@ backend_immodules = [] pc_gdk_extra_libs = [] +cairo_found_type = cairo_dep.type_name() +if cairo_found_type == 'internal' + cairo_features = subproject('cairo').get_variable('built_features') +endif + cairo_backends = [] foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled], ['cairo-win32', cairo_req, win32_enabled], ['cairo-quartz', cairo_req, quartz_enabled], ['cairo', cairo_req, broadway_enabled or wayland_enabled], ] - backend_enabled = backend.get(2) - cairo_backend_req = backend.get(1) - cairo_backend = backend.get(0) - if backend_enabled - if dependency(cairo_backend, version: cairo_backend_req, required : cc.get_id() != 'msvc').found() - cairo_backends += [ cairo_backend ] - endif - endif + backend_enabled = backend.get(2) + cairo_backend_req = backend.get(1) + cairo_backend = backend.get(0) + if backend_enabled + if cairo_found_type == 'pkgconfig' + if dependency(cairo_backend, version: cairo_backend_req, required : cc.get_id() != 'msvc').found() + cairo_backends += cairo_backend + endif + else + foreach f: cairo_features + if f['name'] == cairo_backend + cairo_backends += cairo_backend + endif + endforeach + endif + endif endforeach cairo_pkg_found = false @@ -422,7 +439,7 @@ if x11_enabled xdamage_dep = dependency('xdamage', required: false) xfixes_dep = dependency('xfixes', required: false) xcomposite_dep = dependency('xcomposite', required: false) - fontconfig_dep = dependency('fontconfig') + fontconfig_dep = dependency('fontconfig', fallback: ['fontconfig', 'fontconfig_dep']) atkbridge_dep = dependency('atk-bridge-2.0', version: atk_req) backend_immodules += ['xim'] From 3b246fbc56c918ea8ad3fea6ec8aa58be0433db6 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 1 Dec 2018 03:01:58 +0530 Subject: [PATCH 12/89] gtk: Fix compiler warning about deprecated declaration --- gtk/gtkpixelcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c index 07695336c1..ffed591ca5 100644 --- a/gtk/gtkpixelcache.c +++ b/gtk/gtkpixelcache.c @@ -58,7 +58,7 @@ struct _GtkPixelCache { }; GtkPixelCache * -_gtk_pixel_cache_new () +_gtk_pixel_cache_new (void) { GtkPixelCache *cache; From d9000a07408c8685e4a37190eea24b0305227f20 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 1 Dec 2018 03:03:25 +0530 Subject: [PATCH 13/89] meson: Disable discarded-qualifiers warning This branch is not going to receive the reworks required fix warnings about discarding of const qualifiers, so disable that warning instead. --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 9a9537589d..2bf1532a06 100644 --- a/meson.build +++ b/meson.build @@ -241,6 +241,7 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' '-Wmissing-include-dirs', '-Wlogical-op', '-Wignored-qualifiers', + '-Wno-discarded-qualifiers', '-Werror=implicit', '-Werror=nonnull', '-Werror=init-self', From a8ffb4273968924943fd4a4d5d6c5d9ea2cc95cb Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 1 Dec 2018 03:04:16 +0530 Subject: [PATCH 14/89] meson: Don't target gnu89 as the c_std Meson propagates c_std to all subprojects, including those that require gnu99 or c11, etc. https://github.com/mesonbuild/meson/issues/1889 --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index 2bf1532a06..c280049568 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,6 @@ project('gtk+-3.0', 'c', version: '3.24.1', default_options: [ 'buildtype=debugoptimized', - 'c_std=gnu89', 'warning_level=1' ], meson_version : '>= 0.48.0', From 20c29fd8c0f5af9667c52f3236eef4b8b567c890 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 3 Dec 2018 18:39:41 +0530 Subject: [PATCH 15/89] meson: Fix introspection generation on Linux --- gdk/meson.build | 86 ++++++++++++++++++++++++++++++++++++++++++--- gdk/x11/meson.build | 1 - gtk/meson.build | 75 +++++++-------------------------------- meson.build | 1 + meson_options.txt | 2 +- 5 files changed, 96 insertions(+), 69 deletions(-) diff --git a/gdk/meson.build b/gdk/meson.build index 0d88e8e45a..e76d7f9285 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -39,7 +39,7 @@ gdk_sources = files( 'gdkmonitor.c' ) -gdk_public_headers = files( +gdk_gir_public_headers = files( 'gdk.h', 'gdk-autocleanup.h', 'gdkapplaunchcontext.h', @@ -58,7 +58,6 @@ gdk_public_headers = files( 'gdkglcontext.h', 'gdkkeys.h', 'gdkkeysyms.h', - 'gdkkeysyms-compat.h', 'gdkmain.h', 'gdkmonitor.h', 'gdkpango.h', @@ -77,6 +76,8 @@ gdk_public_headers = files( 'gdkvisual.h', 'gdkwindow.h', ) +gdk_nogir_public_headers = [files('gdkkeysyms-compat.h')] +gdk_public_headers = gdk_gir_public_headers + gdk_nogir_public_headers install_headers(gdk_public_headers, subdir : 'gtk-3.0/gdk') deprecated_h_sources = files('deprecated/gdkcolor.h') @@ -142,8 +143,6 @@ gdkresources = gnome.compile_resources('gdkresources', extra_args: '--manual-register' ) -gdk_headers = gdk_public_headers - gdk_enums = gnome.mkenums('gdkenumtypes', sources: gdk_public_headers, c_template : 'gdkenumtypes.c.template', @@ -272,8 +271,85 @@ libgdk = shared_library('gdk-3', darwin_versions : gtk_osxversions, install: true) +gdk_dep_sources = [gdkconfig, gdkenum_h] +# Introspection +if build_gir + gir_args = ['--quiet'] + + # We may build some of the dependencies as sub-projects; this means + # that we need to depend on the built introspection data, instead of + # the installed one + gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', ] + + if pixbuf_dep.type_name() == 'internal' + gdk_gir_inc += subproject('gdk-pixbuf').get_variable('gdkpixbuf_gir').get(0) + else + gdk_gir_inc += 'GdkPixbuf-2.0' + endif + + if pango_dep.type_name() == 'internal' + gdk_gir_inc += subproject('pango').get_variable('pango_gir').get(0) + else + gdk_gir_inc += 'Pango-1.0' + endif + + gdk_gir_sources = gdk_gir_public_headers + deprecated_h_sources + gdk_gir_sources += gdk_sources + gdk_enums + [gdkconfig] + gdk_gir = gnome.generate_gir(libgdk, + sources: gdk_gir_sources, + namespace: 'Gdk', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gdk-3.0', + includes: gdk_gir_inc, + header: 'gdk/gdk.h', + install: true, + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gdk_gir_dep = declare_dependency(sources: gdk_gir) + gdk_dep_sources += gdk_gir + + if x11_enabled + gdk_x11_gir = gnome.generate_gir(libgdk, + sources: gdk_x11_public_headers + gdk_x11_sources, + namespace: 'GdkX11', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gdk-x11-3.0', + includes: gdk_gir_inc + [ gdk_gir[0], 'xlib-2.0', ], + install: true, + dependencies: gdk_gir_dep, + header: 'gdk/gdkx.h', + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gdk_dep_sources += gdk_x11_gir + endif + + if win32_enabled + gdk_win32_gir = gnome.generate_gir(libgdk, + sources: gdk_win32_public_headers + gdk_win32_sources, + namespace: 'GdkWin32', + nsversion: gtk_api_version, + identifier_prefix: 'Gdk', + symbol_prefix: 'gdk', + export_packages: 'gdk-win32-3.0', + includes: gdk_gir_inc + [gdk_gir[0]], + install: true, + dependencies: gdk_gir_dep, + header: 'gdk/gdkwin32.h', + extra_args: gir_args + [ + '-DGDK_COMPILATION', + ]) + gdk_dep_sources += gdk_x11_gir + endif +endif + libgdk_dep = declare_dependency( link_with: libgdk, - sources: ['gdk.h', gdkconfig, gdkenum_h], + sources: gdk_dep_sources, include_directories: [confinc, gdkx11_inc, wlinc], dependencies: gdk_deps) diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build index c31a682d69..754ae0a615 100644 --- a/gdk/x11/meson.build +++ b/gdk/x11/meson.build @@ -19,7 +19,6 @@ gdk_x11_sources = files( 'gdkmain-x11.c', 'gdkproperty-x11.c', 'gdkscreen-x11.c', - 'gdkscreen-x11.h', 'gdkselection-x11.c', 'gdktestutils-x11.c', 'gdkvisual-x11.c', diff --git a/gtk/meson.build b/gtk/meson.build index 531f2e962f..bb4f179149 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -394,10 +394,9 @@ gtk_private_type_headers = files( 'gtktexthandleprivate.h', ) -gtk_public_headers = files( +gtk_gir_public_headers = files( 'gtk.h', 'gtk-autocleanups.h', - 'gtkx.h', 'gtkx-autocleanups.h', 'gtk-a11y.h', 'gtkaboutdialog.h', @@ -589,7 +588,6 @@ gtk_public_headers = files( 'gtktextbuffer.h', 'gtktextbufferrichtext.h', 'gtktextchild.h', - 'gtktextdisplay.h', 'gtktextiter.h', 'gtktextmark.h', 'gtktexttag.h', @@ -622,9 +620,14 @@ gtk_public_headers = files( 'gtkwindowgroup.h', ) +gtk_nogir_public_headers = files( + 'gtkx.h', + 'gtktextdisplay.h', +) + # Installed headers without compatibility guarantees that are not included in gtk/gtk.h gtk_semi_private_headers = files('gtktextlayout.h') - +gtk_public_headers = gtk_gir_public_headers + gtk_nogir_public_headers install_headers(gtk_public_headers + gtk_semi_private_headers, subdir: 'gtk-3.0/gtk') gtk_unix_sources = files( @@ -654,6 +657,7 @@ gtk_win32_sources = files( ) if os_win32 + # FIXME these sources should not be added to generate_gir? gtk_sources += gtk_win32_sources endif @@ -762,7 +766,7 @@ gtkprivatetypebuiltins_h = gtkprivatetypebuiltins[1] typefuncs = custom_target('gtktypefuncs.inc', depends: [ gdkenum_h ], output: 'gtktypefuncs.inc', - input: gdk_headers + + input: gdk_public_headers + gtk_public_headers + gtk_deprecated_headers + [ gtktypebuiltins_h, gdkenum_h ], @@ -846,7 +850,7 @@ endif if quartz_enabled gtk_sources += gtk_use_quartz_sources - gtk_cargs += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c'] # FIXME? maybe add_languages() instead? + gtk_cargs += ['-DGDK_WINDOWING_QUARTZ', '-xobjective-c'] endif # So we don't add these twice @@ -902,65 +906,12 @@ libgtk = shared_library('gtk-3', gtk_dep_sources = [gtkversion, gtktypebuiltins_h] # Introspection -build_gir = get_option('introspection') if build_gir - gir_args = [ - '--quiet', - ] - - # We may build some of the dependencies as sub-projects; this means - # that we need to depend on the built introspection data, instead of - # the installed one - gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', ] - - if pixbuf_dep.type_name() == 'internal' - gdk_gir_inc += subproject('gdk-pixbuf').get_variable('gdkpixbuf_gir').get(0) - else - gdk_gir_inc += 'GdkPixbuf-2.0' - endif - - if pango_dep.type_name() == 'internal' - gdk_gir_inc += subproject('pango').get_variable('pango_gir').get(0) - else - gdk_gir_inc += 'Pango-1.0' - endif - - gdk_gir = gnome.generate_gir(libgtk, - sources: gdk_public_headers + gdk_sources + [ gdkenum_h ], - namespace: 'Gdk', - nsversion: gtk_api_version, - identifier_prefix: 'Gdk', - symbol_prefix: 'gdk', - export_packages: 'gtk+-3.0', - includes: gdk_gir_inc, - header: 'gdk/gdk.h', - install: true, - extra_args: gir_args + [ - '-DGDK_COMPILATION', - ]) - gdk_gir_dep = declare_dependency(sources: gdk_gir) - gtk_dep_sources += gdk_gir - - if x11_enabled - gdk_x11_gir = gnome.generate_gir(libgtk, - sources: gdk_x11_public_headers + gdk_x11_sources, - namespace: 'GdkX11', - nsversion: gtk_api_version, - identifier_prefix: 'Gdk', - symbol_prefix: 'gdk', - export_packages: 'gtk+-x11-3.0', - includes: [ gdk_gir[0], 'xlib-2.0', ], - install: true, - dependencies: gdk_gir_dep, - header: 'gdk/gdkx.h', - extra_args: gir_args + [ - '-DGDK_COMPILATION', - ]) - gtk_dep_sources += gdk_x11_gir - endif + gir_args = ['--quiet'] gtk_introspection_sources = [ - gtk_public_headers, + gtk_gir_public_headers, + gtk_deprecated_headers, gtk_sources, a11y_headers, a11y_sources, diff --git a/meson.build b/meson.build index c280049568..8ff261545f 100644 --- a/meson.build +++ b/meson.build @@ -573,6 +573,7 @@ if cloudproviders_enabled endif endif +build_gir = get_option('introspection') subdir('gdk') subdir('gtk') subdir('modules') diff --git a/meson_options.txt b/meson_options.txt index 782f7153f4..79aca2aa66 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -27,7 +27,7 @@ option('documentation', type: 'boolean', value: 'false', description : 'Build API reference and tools documentation') option('man-pages', type: 'boolean', value: 'false', description : 'Build man pages for installed tools') -option('introspection', type: 'boolean', value: 'false', +option('introspection', type: 'boolean', value: 'true', description : 'Build introspection data (requires gobject-introspection)') # Demos and binaries From ead77a4628b84d30e9c9c3dfacd3f58eed25da85 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 4 Dec 2018 13:45:28 +0530 Subject: [PATCH 16/89] meson: Cleanup tests and gdk testsuite --- tests/meson.build | 350 ++++++++++++++++---------------------- testsuite/gdk/meson.build | 46 ++--- 2 files changed, 171 insertions(+), 225 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 2fdc5ebd5d..586fe2f45e 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,212 +1,156 @@ - -test_animated_resizing = executable('animated-resizing', - 'animated-resizing.c', - 'frame-stats.c', - 'frame-stats.h', - 'variable.c', - 'variable.h', - dependencies: libgtk_dep -) -test_animted_revealing = executable('animated-revealing', - 'animated-revealing.c', - 'frame-stats.c', - 'frame-stats.h', - 'variable.c', - 'variable.h', - dependencies: libgtk_dep -) -test_scrolling_performance = executable('scrolling-performance', - 'scrolling-performance.c', - 'frame-stats.c', - 'frame-stats.h', - 'variable.c', - 'variable.h', - dependencies: libgtk_dep -) -test_blur_performance = executable('blur-performance', - 'blur-performance.c', - '../gtk/gtkcairoblur.c', - dependencies: libgtk_dep -) -test_video_timer = executable('video-timer', - 'video-timer.c', - 'variable.c', - 'variable.h', - dependencies: libgtk_dep -) -test_print = executable('testprint', - 'testprint.c', - 'testprintfileoperation.c', - 'testprintfileoperation.h', - dependencies: libgtk_dep -) - -test_offscren = executable('testoffscreen', - 'testoffscreen.c', - 'gtkoffscreenbox.c', - 'gtkoffscreenbox.h', - dependencies: libgtk_dep -) -test_gdkgears = executable('gdkgears', - 'gdkgears.c', - 'gtkgears.c', - 'gtkgears.h', - dependencies: libgtk_dep -) -test_glblending = executable('testglblending', - 'testglblending.c', - 'gtkgears.c', - 'gtkgears.h', - dependencies: libgtk_dep -) - -test_boxcss = executable('testboxcss', 'testboxcss.c', dependencies: libgtk_dep) -test_entrycompletion = executable('testentrycompletion', 'testentrycompletion.c', dependencies: libgtk_dep) -test_entryicons = executable('testentryicons', 'testentryicons.c', dependencies: libgtk_dep) -test_filechooser = executable('testfilechooser', 'testfilechooser.c', dependencies: libgtk_dep) -test_filechooserbutton = executable('testfilechooserbutton', 'testfilechooserbutton.c', dependencies: libgtk_dep) -test_flowbox = executable('testflowbox', 'testflowbox.c', dependencies: libgtk_dep) -test_fontselection = executable('testfontselection', 'testfontselection.c', dependencies: libgtk_dep) -test_fontselectiondialog = executable('testfontselectiondialog', 'testfontselectiondialog.c', dependencies: libgtk_dep) -test_fontchooser = executable('testfontchooser', 'testfontchooser.c', dependencies: libgtk_dep) -test_fontoptions = executable('testfontoptions', 'testfontoptions.c', dependencies: libgtk_dep) -test_grid = executable('testgrid', 'testgrid.c', dependencies: libgtk_dep) -# TODO: Can't find the x11/gdkx.h -#test_gtk = executable('testgtk', 'testgtk.c', dependencies: libgtk_dep) -test_treechanging = executable('testtreechanging', 'testtreechanging.c', dependencies: libgtk_dep) -test_treednd = executable('testtreednd', 'testtreednd.c', dependencies: libgtk_dep) -test_treeedit = executable('testtreeedit', 'testtreeedit.c', dependencies: libgtk_dep) -test_treemodel = executable('testtreemodel', 'testtreemodel.c', dependencies: libgtk_dep) -test_treeview = executable('testtreeview', 'testtreeview.c', dependencies: libgtk_dep) -test_treefocus = executable('testtreefocus', 'testtreefocus.c', dependencies: libgtk_dep) -test_treeflow = executable('testtreeflow', 'testtreeflow.c', dependencies: libgtk_dep) -test_treecolumns = executable('testtreecolumns', 'testtreecolumns.c', dependencies: libgtk_dep) -test_treecolumnsizing = executable('testtreecolumnsizing', 'testtreecolumnsizing.c', dependencies: libgtk_dep) -test_treesort = executable('testtreesort', 'testtreesort.c', dependencies: libgtk_dep) -test_toolbar = executable('testtoolbar', 'testtoolbar.c', dependencies: libgtk_dep) -test_toolbar2 = executable('testtoolbar2', 'testtoolbar2.c', dependencies: libgtk_dep) -test_menubutton = executable('testmenubutton', 'testmenubutton.c', dependencies: libgtk_dep) -test_spinbutton = executable('testspinbutton', 'testspinbutton.c', dependencies: libgtk_dep) -test_statusicon = executable('teststatusicon', 'teststatusicon.c', dependencies: libgtk_dep) -test_merge = executable('testmerge', 'testmerge.c', dependencies: libgtk_dep) -test_actions = executable('testactions', 'testactions.c', dependencies: libgtk_dep) -test_baseline = executable('testbaseline', 'testbaseline.c', dependencies: libgtk_dep) -test_bbox = executable('testbbox', 'testbbox.c', dependencies: libgtk_dep) -test_buttons = executable('testbuttons', 'testbuttons.c', dependencies: libgtk_dep) -test_frame = executable('testframe', 'testframe.c', dependencies: libgtk_dep) -test_geometry = executable('testgeometry', 'testgeometry.c', dependencies: libgtk_dep) -test_giconpixbuf = executable('testgiconpixbuf', 'testgiconpixbuf.c', dependencies: libgtk_dep) -test_iconview = executable('testiconview', 'testiconview.c', dependencies: libgtk_dep) -test_iconview_keynav = executable('testiconview_keynav', 'testiconview-keynav.c', dependencies: libgtk_dep) -test_numerableicon = executable('testnumerableicon', 'testnumerableicon.c', dependencies: libgtk_dep) -test_recentchooser = executable('testrecentchooser', 'testrecentchooser.c', dependencies: libgtk_dep) -test_grouping = executable('testgrouping', 'testgrouping.c', dependencies: libgtk_dep) -test_tooltips = executable('testtooltips', 'testtooltips.c', dependencies: libgtk_dep) -test_recentchoosermenu = executable('testrecentchoosermenu', 'testrecentchoosermenu.c', dependencies: libgtk_dep) -test_volumebutton = executable('testvolumebutton', 'testvolumebutton.c', dependencies: libgtk_dep) -test_scrolledwindow = executable('testscrolledwindow', 'testscrolledwindow.c', dependencies: libgtk_dep) -test_cellarea = executable('testcellarea', 'testcellarea.c', dependencies: libgtk_dep) -test_treemenu = executable('testtreemenu', 'testtreemenu.c', dependencies: libgtk_dep) -test_offscreenwindow = executable('testoffscreenwindow', 'testoffscreenwindow.c', dependencies: libgtk_dep) -test_overlay = executable('testoverlay', 'testoverlay.c', dependencies: libgtk_dep) -test_overlaystyleclass = executable('testoverlaystyleclass', 'testoverlaystyleclass.c', dependencies: libgtk_dep) -test_appchooser = executable('testappchooser', 'testappchooser.c', dependencies: libgtk_dep) -test_windows = executable('testwindows', 'testwindows.c', dependencies: libgtk_dep) -test_expand = executable('testexpand', 'testexpand.c', dependencies: libgtk_dep) -test_expander = executable('testexpander', 'testexpander.c', dependencies: libgtk_dep) -test_switch = executable('testswitch', 'testswitch.c', dependencies: libgtk_dep) -test_styleexamples = executable('styleexamples', 'styleexamples.c', dependencies: libgtk_dep) -test_toplevelembed = executable('testtoplevelembed', 'testtoplevelembed.c', dependencies: libgtk_dep) -test_textview = executable('testtextview', 'testtextview.c', dependencies: libgtk_dep) -test_animation = executable('testanimation', 'testanimation.c', dependencies: libgtk_dep) -test_pixbuf_scale = executable('testpixbuf_scale', 'testpixbuf-scale.c', dependencies: libgtk_dep) -test_pixbuf_color = executable('testpixbuf_color', 'testpixbuf-color.c', dependencies: libgtk_dep) -test_pixbuf_save = executable('testpixbuf_save', 'testpixbuf-save.c', dependencies: libgtk_dep) -test_colorchooser = executable('testcolorchooser', 'testcolorchooser.c', dependencies: libgtk_dep) -test_colorchooser2 = executable('testcolorchooser2', 'testcolorchooser2.c', dependencies: libgtk_dep) -test_kineticscrolling = executable('testkineticscrolling', 'testkineticscrolling.c', dependencies: libgtk_dep) -test_stack = executable('teststack', 'teststack.c', dependencies: libgtk_dep) -test_revealer = executable('testrevealer', 'testrevealer.c', dependencies: libgtk_dep) -test_revealer2 = executable('testrevealer2', 'testrevealer2.c', dependencies: libgtk_dep) -test_titlebar = executable('testtitlebar', 'testtitlebar.c', dependencies: libgtk_dep) -test_windowsize = executable('testwindowsize', 'testwindowsize.c', dependencies: libgtk_dep) -test_listmodel = executable('listmodel', 'listmodel.c', dependencies: libgtk_dep) -test_popover = executable('testpopover', 'testpopover.c', dependencies: libgtk_dep) -test_cairo = executable('testcairo', 'testcairo.c', dependencies: libgtk_dep) -test_overlayscroll = executable('overlayscroll', 'overlayscroll.c', dependencies: libgtk_dep) -test_syncscroll = executable('syncscroll', 'syncscroll.c', dependencies: libgtk_dep) -test_subsurface = executable('subsurface', 'subsurface.c', dependencies: libgtk_dep) -test_motion_compression = executable('motion-compression', 'motion-compression.c', dependencies: libgtk_dep) -test_simple = executable('simple', 'simple.c', dependencies: libgtk_dep) -test_flicker = executable('flicker', 'flicker.c', dependencies: libgtk_dep) -test_print_editor = executable('print-editor', 'print-editor.c', dependencies: libgtk_dep) -test_accel = executable('testaccel', 'testaccel.c', dependencies: libgtk_dep) -test_adjustsize = executable('testadjustsize', 'testadjustsize.c', dependencies: libgtk_dep) -test_appchooserbutton = executable('testappchooserbutton', 'testappchooserbutton.c', dependencies: libgtk_dep) -test_assistant = executable('testassistant', 'testassistant.c', dependencies: libgtk_dep) -test_box = executable('testbox', 'testbox.c', dependencies: libgtk_dep) -test_calendar = executable('testcalendar', 'testcalendar.c', dependencies: libgtk_dep) -test_clipboard = executable('testclipboard', 'testclipboard.c', dependencies: libgtk_dep) -test_combo = executable('testcombo', 'testcombo.c', dependencies: libgtk_dep) -test_combochange = executable('testcombochange', 'testcombochange.c', dependencies: libgtk_dep) -test_cellrenderertext = executable('testcellrenderertext', 'testcellrenderertext.c', dependencies: libgtk_dep) -test_dialog = executable('testdialog', 'testdialog.c', dependencies: libgtk_dep) -test_dnd = executable('testdnd', 'testdnd.c', dependencies: libgtk_dep) -test_dnd2 = executable('testdnd2', 'testdnd2.c', dependencies: libgtk_dep) -test_ellipsise = executable('testellipsise', 'testellipsise.c', dependencies: libgtk_dep) -test_emblems = executable('testemblems', 'testemblems.c', dependencies: libgtk_dep) -test_fullscreen = executable('testfullscreen', 'testfullscreen.c', dependencies: libgtk_dep) -test_headerbar = executable('testheaderbar', 'testheaderbar.c', dependencies: libgtk_dep) -test_heightforwidth = executable('testheightforwidth', 'testheightforwidth.c', dependencies: libgtk_dep) -test_icontheme = executable('testicontheme', 'testicontheme.c', dependencies: libgtk_dep) -test_image = executable('testimage', 'testimage.c', dependencies: libgtk_dep) -test_input = executable('testinput', 'testinput.c', dependencies: libgtk_dep) -test_list = executable('testlist', 'testlist.c', dependencies: libgtk_dep) -test_list2 = executable('testlist2', 'testlist2.c', dependencies: libgtk_dep) -test_list3 = executable('testlist3', 'testlist3.c', dependencies: libgtk_dep) -test_levelbar = executable('testlevelbar', 'testlevelbar.c', dependencies: libgtk_dep) -test_lockbutton = executable('testlockbutton', 'testlockbutton.c', dependencies: libgtk_dep) -test_mountoperation = executable('testmountoperation', 'testmountoperation.c', dependencies: libgtk_dep) -test_multidisplay = executable('testmultidisplay', 'testmultidisplay.c', dependencies: libgtk_dep) -test_notebookdnd = executable('testnotebookdnd', 'testnotebookdnd.c', dependencies: libgtk_dep) -test_nouiprint = executable('testnouiprint', 'testnouiprint.c', dependencies: libgtk_dep) -test_orientable = executable('testorientable', 'testorientable.c', dependencies: libgtk_dep) -test_richtext = executable('testrichtext', 'testrichtext.c', dependencies: libgtk_dep) -test_scale = executable('testscale', 'testscale.c', dependencies: libgtk_dep) -test_selection = executable('testselection', 'testselection.c', dependencies: libgtk_dep) -test_selectionmode = executable('testselectionmode', 'testselectionmode.c', dependencies: libgtk_dep) -test_stockbuttonmenu = executable('teststockbuttonmenu', 'teststockbuttonmenu.c', dependencies: libgtk_dep) -test_stresstest_toolbar = executable('stresstest-oolbar', 'stresstest-toolbar.c', dependencies: libgtk_dep) -test_verticalcells = executable('testverticalcells', 'testverticalcells.c', dependencies: libgtk_dep) -test_treestoretest = executable('treestoretest', 'treestoretest.c', dependencies: libgtk_dep) -test_xinerama = executable('testxinerama', 'testxinerama.c', dependencies: libgtk_dep) -test_scrolledge = executable('testscrolledge', 'testscrolledge.c', dependencies: libgtk_dep) -test_noscreen = executable('testnoscreen', 'testnoscreen.c', dependencies: libgtk_dep) -test_treepos = executable('testtreepos', 'testtreepos.c', dependencies: libgtk_dep) -test_sensitive = executable('testsensitive', 'testsensitive.c', dependencies: libgtk_dep) -test_gmenu = executable('testgmenu', 'testgmenu.c', dependencies: libgtk_dep) -test_logout = executable('testlogout', 'testlogout.c', dependencies: libgtk_dep) -test_splitheaders = executable('testsplitheaders', 'testsplitheaders.c', dependencies: libgtk_dep) -test_actionbar = executable('testactionbar', 'testactionbar.c', dependencies: libgtk_dep) -test_popup = executable('testpopup', 'testpopup.c', dependencies: libgtk_dep) -test_popupat = executable('testpopupat', 'testpopupat.c', dependencies: libgtk_dep) +gtk_tests = [ + # testname, optional extra sources + ['animated-resizing', ['frame-stats.c', 'variable.c']], + ['animated-revealing', ['frame-stats.c', 'variable.c']], + ['scrolling-performance', ['frame-stats.c', 'variable.c']], + ['blur-performance', ['../gtk/gtkcairoblur.c']], + ['flicker'], + ['gdkgears', ['gtkgears.c']], + ['listmodel'], + ['motion-compression'], + ['styleexamples'], + ['overlayscroll'], + ['print-editor'], + ['simple'], + ['subsurface'], + ['syncscroll'], + ['testaccel'], + ['testactionbar'], + ['testactions'], + ['testadjustsize'], + ['testanimation'], + ['testappchooserbutton'], + ['testappchooser'], + ['testassistant'], + ['testbaseline'], + ['testbbox'], + ['testbox'], + ['testboxcss'], + ['testbuttons'], + ['testcairo'], + ['testcalendar'], + ['testcellarea'], + ['testcellrenderertext'], + ['testclipboard'], + ['testcolorchooser'], + ['testcombo'], + ['testcombochange'], + ['testdialog'], + ['testdnd'], + ['testellipsise'], + ['testemblems'], + ['testentrycompletion'], + ['testentryicons'], + ['testexpand'], + ['testexpander'], + ['testfilechooserbutton'], + ['testfilechooser'], + ['testflowbox'], + ['testfontchooser'], + ['testfontoptions'], + ['testfontselection'], + ['testfontselectiondialog'], + ['testframe'], + ['testfullscreen'], + ['testgeometry'], + ['testgiconpixbuf'], + ['testglblending', ['gtkgears.c']], + ['testgmenu'], + ['testgrid'], + ['testgrouping'], + ['testgtk'], + ['testheaderbar'], + ['testheightforwidth'], + ['testicontheme'], + ['testiconview'], + ['testimage'], + ['testinput'], + ['testkineticscrolling'], + ['testlevelbar'], + ['testlist'], + ['testlockbutton'], + ['testlogout'], + ['testmenubutton'], + ['testmerge'], + ['testmountoperation'], + ['testmultidisplay'], + ['testnoscreen'], + ['testnotebookdnd'], + ['testnouiprint'], + ['testnumerableicon'], + ['testoffscreen', ['gtkoffscreenbox.c']], + ['testoffscreenwindow'], + ['testorientable'], + ['testoverlay'], + ['testoverlaystyleclass'], + ['testpopover'], + ['testpopupat'], + ['testpopup'], + ['testprint', ['testprintfileoperation.c']], + ['testrecentchooser'], + ['testrecentchoosermenu'], + ['testrevealer'], + ['testrichtext'], + ['testscale'], + ['testscrolledge'], + ['testscrolledwindow'], + ['testselection'], + ['testselectionmode'], + ['testsensitive'], + ['testspinbutton'], + ['testsplitheaders'], + ['teststack'], + ['teststatusicon'], + ['teststockbuttonmenu'], + ['testswitch'], + ['testtextview'], + ['testtitlebar'], + ['testtoolbar'], + ['testtooltips'], + ['testtoplevelembed'], + ['testtreechanging'], + ['testtreecolumns'], + ['testtreecolumnsizing'], + ['testtreednd'], + ['testtreeedit'], + ['testtreeflow'], + ['testtreefocus'], + ['testtreemenu'], + ['testtreemodel'], + ['testtreepos'], + ['testtreesort'], + ['testtreeview'], + ['testverticalcells'], + ['testvolumebutton'], + ['testwindows'], + ['testwindowsize'], + ['testxinerama'], + ['treestoretest'], + ['video-timer', ['variable.c']], +] # Conditionally compiled tests if x11_enabled - test_socket = executable('testsocket', - 'testsocket.c', - 'testsocket_common.c', - dependencies: libgtk_dep - ) - test_socket_child = executable('testsocket_child', - 'testsocket_child.c', - 'testsocket_common.c', - dependencies: libgtk_dep - ) + gtk_tests += [ + ['testsocket', ['testsocket_common.c']], + ['testsocket_child', ['testsocket_common.c']], + ] endif if os_linux - test_fontchooserdialog = executable('testfontchooserdialog', 'testfontchooserdialog.c', dependencies: libgtk_dep) + gtk_tests += [['testfontchooserdialog']] endif +# Pass the source dir here so programs can change into the source directory +# and find .ui files and .png files and such that they load at runtime +test_args = ['-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir())] + +foreach t: gtk_tests + test_name = t.get(0) + test_srcs = ['@0@.c'.format(test_name), t.get(1, [])] + executable(test_name, test_srcs, + c_args: test_args, + dependencies: [libgtk_dep, libm]) +endforeach + subdir('visuals') diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build index 326c6545a8..ca84758e4f 100644 --- a/testsuite/gdk/meson.build +++ b/testsuite/gdk/meson.build @@ -1,24 +1,26 @@ +tests = [ + 'cairo', + 'display', + 'encoding', + 'keysyms', + 'rectangle', + 'rgba', + 'seat', + 'visual', +] -test_cairo = executable('cairo', 'cairo.c', dependencies: libgtk_dep) -test('gdk/cairo', test_cairo) +foreach t : tests + test_exe = executable(t, '@0@.c'.format(t), + dependencies: libgtk_dep) -test_display = executable('display', 'display.c', dependencies: libgtk_dep) -test('gdk/display', test_display) - -test_encoding = executable('encoding', 'encoding.c', dependencies: libgtk_dep) -test('gdk/encoding', test_encoding) - -test_keysyms = executable('keysyms', 'keysyms.c', dependencies: libgtk_dep) -test('gdk/keysyms', test_keysyms) - -test_rectangle = executable('rectangle', 'rectangle.c', dependencies: libgtk_dep) -test('gdk/rectangle', test_rectangle) - -test_rgba = executable('rgba', 'rgba.c', dependencies: libgtk_dep) -test('gdk/rgba', test_rgba) - -test_seat = executable('seat', 'seat.c', dependencies: libgtk_dep) -test('gdk/seat', test_seat) - -test_visual = executable('visual', 'visual.c', dependencies: libgtk_dep) -test('gdk/visual', test_visual) + test(t, test_exe, + args: [ '--tap', '-k' ], + env: [ 'GIO_USE_VOLUME_MONITOR=unix', + 'GSETTINGS_BACKEND=memory', + 'GTK_CSD=1', + 'G_ENABLE_DIAGNOSTIC=0', + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()) + ], + suite: 'gdk') +endforeach From dbce9ee870dbd16a554e6cbb9a51d2911ed893a6 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 4 Dec 2018 14:04:00 +0530 Subject: [PATCH 17/89] meson: Add wrap files for building with subprojects --- subprojects/atk.wrap | 5 +++++ subprojects/cairo.wrap | 5 +++++ subprojects/expat.wrap | 10 ++++++++++ subprojects/fontconfig.wrap | 5 +++++ subprojects/freetype2.wrap | 5 +++++ subprojects/fribidi.wrap | 5 +++++ subprojects/gdk-pixbuf.wrap | 5 +++++ subprojects/glib.wrap | 5 +++++ subprojects/harfbuzz.wrap | 5 +++++ subprojects/libcroco.wrap | 5 +++++ subprojects/libepoxy.wrap | 5 +++++ subprojects/libffi.wrap | 5 +++++ subprojects/libpng.wrap | 10 ++++++++++ subprojects/librsvg.wrap | 5 +++++ subprojects/libxml2.wrap | 9 +++++++++ subprojects/pango.wrap | 5 +++++ subprojects/pixman.wrap | 5 +++++ subprojects/proxy-libintl.wrap | 4 ++++ subprojects/zlib.wrap | 10 ++++++++++ 19 files changed, 113 insertions(+) create mode 100644 subprojects/atk.wrap create mode 100644 subprojects/cairo.wrap create mode 100644 subprojects/expat.wrap create mode 100644 subprojects/fontconfig.wrap create mode 100644 subprojects/freetype2.wrap create mode 100644 subprojects/fribidi.wrap create mode 100644 subprojects/gdk-pixbuf.wrap create mode 100644 subprojects/glib.wrap create mode 100644 subprojects/harfbuzz.wrap create mode 100644 subprojects/libcroco.wrap create mode 100644 subprojects/libepoxy.wrap create mode 100644 subprojects/libffi.wrap create mode 100644 subprojects/libpng.wrap create mode 100644 subprojects/librsvg.wrap create mode 100644 subprojects/libxml2.wrap create mode 100644 subprojects/pango.wrap create mode 100644 subprojects/pixman.wrap create mode 100644 subprojects/proxy-libintl.wrap create mode 100644 subprojects/zlib.wrap diff --git a/subprojects/atk.wrap b/subprojects/atk.wrap new file mode 100644 index 0000000000..8666a3a1ab --- /dev/null +++ b/subprojects/atk.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=atk +url=https://gitlab.gnome.org/GNOME/atk.git +push-url=git@gitlab.gnome.org:GNOME/atk.git +revision=master diff --git a/subprojects/cairo.wrap b/subprojects/cairo.wrap new file mode 100644 index 0000000000..26d5ade52b --- /dev/null +++ b/subprojects/cairo.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=cairo +url=https://github.com/centricular/cairo.git +push-url=git@github.com:centricular/cairo.git +revision=meson diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap new file mode 100644 index 0000000000..dbe23cbc85 --- /dev/null +++ b/subprojects/expat.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = expat-2.2.5 + +source_url = https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2 +source_filename = expat-2.2.5.tar.bz2 +source_hash = d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/expat/2.2.5/5/get_zip +patch_filename = expat-2.2.5-5-wrap.zip +patch_hash = 95e02942b13ebe237494419c0f7d56d99b8b4e0a2dc04002e055b2325c960e11 diff --git a/subprojects/fontconfig.wrap b/subprojects/fontconfig.wrap new file mode 100644 index 0000000000..083a49d6ad --- /dev/null +++ b/subprojects/fontconfig.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=fontconfig +url=https://github.com/centricular/fontconfig.git +push-url=git@github.com:centricular/fontconfig.git +revision=meson diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap new file mode 100644 index 0000000000..3151539c8b --- /dev/null +++ b/subprojects/freetype2.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=freetype2 +url=https://github.com/centricular/freetype2.git +push-url=git@github.com:centricular/freetype2.git +revision=meson diff --git a/subprojects/fribidi.wrap b/subprojects/fribidi.wrap new file mode 100644 index 0000000000..8d4e4bf437 --- /dev/null +++ b/subprojects/fribidi.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=fribidi +url=https://github.com/fribidi/fribidi.git +push-url=git@github.com:fribidi/fribidi.git +revision=master diff --git a/subprojects/gdk-pixbuf.wrap b/subprojects/gdk-pixbuf.wrap new file mode 100644 index 0000000000..a0d4a40c92 --- /dev/null +++ b/subprojects/gdk-pixbuf.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=gdk-pixbuf +url=https://gitlab.gnome.org/GNOME/gdk-pixbuf.git +push-url=git@gitlab.gnome.org:GNOME/gdk-pixbuf.git +revision=master diff --git a/subprojects/glib.wrap b/subprojects/glib.wrap new file mode 100644 index 0000000000..87021ae4d9 --- /dev/null +++ b/subprojects/glib.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=glib +url=https://gitlab.gnome.org/GNOME/glib.git +push-url=git@gitlab.gnome.org:GNOME/glib.git +revision=master diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap new file mode 100644 index 0000000000..cc0a89d699 --- /dev/null +++ b/subprojects/harfbuzz.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=harfbuzz +url=https://github.com/centricular/harfbuzz.git +push-url=git@github.com:centricular/harfbuzz.git +revision=meson diff --git a/subprojects/libcroco.wrap b/subprojects/libcroco.wrap new file mode 100644 index 0000000000..fb70ac0833 --- /dev/null +++ b/subprojects/libcroco.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=libcroco +url=https://gitlab.gnome.org/GNOME/libcroco.git +push-url=git@gitlab.gnome.org:GNOME/libcroco.git +revision=wip/meson diff --git a/subprojects/libepoxy.wrap b/subprojects/libepoxy.wrap new file mode 100644 index 0000000000..e8b082e7e0 --- /dev/null +++ b/subprojects/libepoxy.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=libepoxy +url=https://github.com/anholt/libepoxy.git +push-url=git@github.com:anholt/libepoxy.git +revision=meson diff --git a/subprojects/libffi.wrap b/subprojects/libffi.wrap new file mode 100644 index 0000000000..876491c7da --- /dev/null +++ b/subprojects/libffi.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=libffi +url=https://github.com/centricular/libffi.git +push-url=git@github.com:centricular/libffi.git +revision=meson diff --git a/subprojects/libpng.wrap b/subprojects/libpng.wrap new file mode 100644 index 0000000000..519b1170a2 --- /dev/null +++ b/subprojects/libpng.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = libpng-1.6.34 + +source_url = ftp://ftp-osl.osuosl.org/pub/libpng/src/libpng16/libpng-1.6.34.tar.xz +source_filename = libpng-1.6.34.tar.xz +source_hash = 2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.35/4/get_zip +patch_filename = libpng-1.6.35-4-wrap.zip +patch_hash = 0cd6ca9e8959b9c720c25d67bbf9315ec115bfc74ea4d34ea569619f4cff986f diff --git a/subprojects/librsvg.wrap b/subprojects/librsvg.wrap new file mode 100644 index 0000000000..384d2b3687 --- /dev/null +++ b/subprojects/librsvg.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=librsvg +url=https://gitlab.gnome.org/nirbheek/librsvg.git +push-url=git@gitlab.gnome.org:nirbheek/librsvg.git +revision=wip/meson-2-40 diff --git a/subprojects/libxml2.wrap b/subprojects/libxml2.wrap new file mode 100644 index 0000000000..486912dabd --- /dev/null +++ b/subprojects/libxml2.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = libxml2-2.9.7 + +source_url = ftp://xmlsoft.org/libxml2/libxml2-2.9.7.tar.gz +source_filename = libxml2-2.9.7.tar.gz +source_hash = f63c5e7d30362ed28b38bfa1ac6313f9a80230720b7fb6c80575eeab3ff5900c +patch_url = https://wrapdb.mesonbuild.com/v1/projects/libxml2/2.9.7/5/get_zip +patch_filename = libxml2-2.9.7-5-wrap.zip +patch_hash = aed5d6719eb96da0fb3cf284d88c4af486fd6b7754aec40b2be9a5ffd9ecadab diff --git a/subprojects/pango.wrap b/subprojects/pango.wrap new file mode 100644 index 0000000000..1de4db3c14 --- /dev/null +++ b/subprojects/pango.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=pango +url=https://gitlab.gnome.org/GNOME/pango.git +push-url=git@gitlab.gnome.org:GNOME/pango.git +revision=master diff --git a/subprojects/pixman.wrap b/subprojects/pixman.wrap new file mode 100644 index 0000000000..5e9d2f4caa --- /dev/null +++ b/subprojects/pixman.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory=pixman +url=https://github.com/centricular/pixman.git +push-url=git@github.com:centricular/pixman.git +revision=meson diff --git a/subprojects/proxy-libintl.wrap b/subprojects/proxy-libintl.wrap new file mode 100644 index 0000000000..b53c8f7c39 --- /dev/null +++ b/subprojects/proxy-libintl.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory=proxy-libintl +url=https://github.com/frida/proxy-libintl.git +revision=0.1 diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap new file mode 100644 index 0000000000..6aff13ff3f --- /dev/null +++ b/subprojects/zlib.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = zlib-1.2.11 + +source_url = https://zlib.net/fossils/zlib-1.2.11.tar.gz +source_filename = zlib-1.2.11.tar.gz +source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/3/get_zip +patch_filename = zlib-1.2.11-3-wrap.zip +patch_hash = f07dc491ab3d05daf00632a0591e2ae61b470615b5b73bcf9b3f061fff65cff0 From 8dc95560e2ba8abab32462e99ae53733c991f214 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 13:13:17 +0800 Subject: [PATCH 18/89] meson.build: Bump version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8ff261545f..f8b94f2548 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gtk+-3.0', 'c', - version: '3.24.1', + version: '3.24.7', default_options: [ 'buildtype=debugoptimized', 'warning_level=1' From 2d2ad0a997470607c0478337382c62d74c08cdb5 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 12:13:22 +0800 Subject: [PATCH 19/89] meson: Only use cairo fallbacks when needed On Visual Studio builds, since Cairo builds tend not to generate pkg-config files for us, look for the headers and .lib's, before attempting to download the Cairo repo (which is quite large) and building it. We can simplify this process when Meson gains the ability to check for the dependencies in a declarative fashion, but before that, this is what must be done. --- meson.build | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index f8b94f2548..ecfbc38d05 100644 --- a/meson.build +++ b/meson.build @@ -307,10 +307,35 @@ if os_unix endif gmodule_dep = dependency('gmodule-2.0', version: glib_req, fallback : ['glib', 'libgmodule_dep']) -cairo_dep = dependency('cairo', version: cairo_req, - fallback : ['cairo', 'libcairo_dep']) -cairogobj_dep = dependency('cairo-gobject', version: cairo_req, - fallback : ['cairo', 'libcairogobject_dep']) + +# Update when we can find depedencies in a declarative manner +cairo_dep = dependency('cairo', version: cairo_req, required: cc.get_id() != 'msvc') +cairogobj_dep = dependency('cairo-gobject', version: cairo_req, required: cc.get_id() != 'msvc') + +# Remove when we can find depedencies in a declarative manner +if not cairo_dep.found() and cc.get_id() == 'msvc' + if cc.has_header('cairo.h') and cc.has_header('cairo-win32.h') + cairo_dep = cc.find_library('cairo', required: false) + endif +endif + +if not cairo_dep.found() + cairo_dep = dependency('cairo', version: cairo_req, + fallback : ['cairo', 'libcairo_dep']) +endif + +# Remove when we can find depedencies in a declarative manner +if not cairogobj_dep.found() and cc.get_id() == 'msvc' + if cc.has_header('cairo-gobject.h') + cairogobj_dep = cc.find_library('cairo-gobject', required: false) + endif +endif + +if not cairogobj_dep.found() + cairogobj_dep = dependency('cairo-gobject', version: cairo_req, + fallback : ['cairo', 'libcairogobject_dep']) +endif + pango_dep = dependency('pango', version: pango_req, fallback : ['pango', 'libpango_dep']) @@ -370,6 +395,8 @@ if cairo_found_type == 'internal' cairo_features = subproject('cairo').get_variable('built_features') endif +cairogobj_found_type = cairogobj_dep.type_name() + cairo_backends = [] foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled], ['cairo-win32', cairo_req, win32_enabled], @@ -383,12 +410,14 @@ foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled], if dependency(cairo_backend, version: cairo_backend_req, required : cc.get_id() != 'msvc').found() cairo_backends += cairo_backend endif - else + elif cairo_found_type == 'internal' foreach f: cairo_features if f['name'] == cairo_backend cairo_backends += cairo_backend endif endforeach + elif cc.get_id() == 'msvc' and cairo_dep.found() + cairo_backends += 'cairo-win32' endif endif endforeach @@ -396,10 +425,10 @@ endforeach cairo_pkg_found = false cairogobj_pkg_found = false -if cairo_dep.found() +if cairo_found_type == 'internal' or cairo_found_type == 'pkgconfig' cairo_pkg_found = true endif -if cairogobj_dep.found() +if cairogobj_found_type == 'internal' or cairogobj_found_type == 'pkgconfig' cairogobj_pkg_found = true endif @@ -613,9 +642,13 @@ gdk_packages = ' '.join([ pango_pkgname, pango_req, if cairo_pkg_found gdk_packages += ' '.join([ ' cairo', cairo_req ]) +elif cc.get_id() == 'msvc' and cairo_dep.found() + gdk_packages += ' '.join([ ' -lcairo' ]) endif if cairogobj_pkg_found gdk_packages += ' '.join([ ' cairo-gobject', cairo_req ]) +elif cc.get_id() == 'msvc' and cairogobj_dep.found() + gdk_packages += ' '.join([ ' -lcairo-gobject' ]) endif pkgconf.set('GDK_PACKAGES', gdk_packages) From 1e7988531a58a66671ea8583bfabd20ba4a822a5 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 12:37:40 +0800 Subject: [PATCH 20/89] meson: Only use fallbacks for PangoFT2 and FreeType when needed PangoFT2 is optional on Windows, so we only really need the fallback if when it is required. Along with that, since FreeType does not typically ship with pkg-config files in its CMake builds, check for the needed headers, .lib and function and then use the fallback when they could not be found and PangoFT2 is used. --- meson.build | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index ecfbc38d05..67d386a74b 100644 --- a/meson.build +++ b/meson.build @@ -341,15 +341,36 @@ pango_dep = dependency('pango', version: pango_req, # Require PangoFT2 if on X11 or wayland require_pangoft2 = wayland_enabled or x11_enabled -pangoft_dep = dependency('pangoft2', required: require_pangoft2, - fallback : ['pango', 'libpangoft2_dep']) +if require_pangoft2 + pangoft_dep = dependency('pangoft2', fallback : ['pango', 'libpangoft2_dep']) +else + pangoft_dep = dependency('pangoft2', required: false) +endif if pangoft_dep.found() # Need at least 2.7.1 for FT_Get_Var_Design_Coordinates() # We get the dependency itself from pango, but pango doesn't care # about ft2 version, so an extra check is needed. - ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: require_pangoft2, - fallback : ['freetype2', 'freetype_dep']) + + # Update once Meson can have deps declared in a declarative manner + ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: false) + + if not ft2_dep.found() and cc.get_id() == 'msvc' + if cc.has_header('ft2build.h') and cc.has_header('freetype/ftmm.h') + ft_lib = cc.find_library('freetype', required: false) + if ft_lib.found() + if cc.has_function('FT_Get_Var_Design_Coordinates', dependencies: ft_lib, + prefix: '''#include + #include FT_MULTIPLE_MASTERS_H''') + ft2_dep = ft_lib + endif + endif + endif + endif + + if not ft2_dep.found() + ft2_dep = dependency('freetype2', version: '>= 2.7.1', fallback : ['freetype2', 'freetype_dep']) + endif endif if win32_enabled From 29123631041696a367704d0231eec9adccb23273 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 12:46:38 +0800 Subject: [PATCH 21/89] gdk/meson.build: Fix typo for GdkWin32 Introspection It is gdk_win32_gir, not gdk_x11_gir... --- gdk/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/meson.build b/gdk/meson.build index e76d7f9285..dfe91ef16e 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -344,7 +344,7 @@ if build_gir extra_args: gir_args + [ '-DGDK_COMPILATION', ]) - gdk_dep_sources += gdk_x11_gir + gdk_dep_sources += gdk_win32_gir endif endif From ac1f66a35bbc4fac8e9ffa1206d472bcfd5f159b Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 12:52:25 +0800 Subject: [PATCH 22/89] gdk/meson.build: Force-export gdk_win32_display_manager_get_type() ...on Visual Studio builds, as it seems that the linker is optimizing that symbol out (hence it is not exported in the DLL). This is to ensure that the introspection files for GdkWin32 build. --- gdk/meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gdk/meson.build b/gdk/meson.build index dfe91ef16e..8d296a6343 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -258,6 +258,14 @@ if gdk_backends.length() == 0 error('No backends enabled') endif +gdk_link_args = common_ldflags + +# Somehow gdk_win32_display_manager_get_type is not being exported as it +# seems that it was optimized out by the MSVC linker. Force-export it here. +if cc.get_id() == 'msvc' + gdk_link_args += [ '-export:gdk_win32_display_manager_get_type' ] +endif + libgdk = shared_library('gdk-3', sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig], dependencies: gdk_deps, @@ -267,7 +275,7 @@ libgdk = shared_library('gdk-3', '-DG_LOG_DOMAIN="Gdk"', ] + common_cflags, link_whole: gdk_backends, - link_args: common_ldflags, + link_args: gdk_link_args, darwin_versions : gtk_osxversions, install: true) From 4da82356bc71dd87e25041779b5fbe15da07e892 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 15:32:14 +0800 Subject: [PATCH 23/89] meson: Enable GLES Windows builds via libANGLE Check whether the libepoxy library is built on Windows with support for GLES. If so, enable GLES/EGL support on Windows as well. --- gdk/win32/meson.build | 9 ++++++++- meson.build | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build index 343a9ff402..15043a9a1d 100644 --- a/gdk/win32/meson.build +++ b/gdk/win32/meson.build @@ -35,6 +35,13 @@ gdk_win32_public_headers = files( 'gdkwin32window.h', ) +GDK_WIN32_CFLAGS = ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'] + +if win32_has_egl + GDK_WIN32_CFLAGS += '-DGDK_WIN32_ENABLE_EGL' +endif + + install_headers(gdk_win32_public_headers, subdir: 'gtk-3.0/gdk/win32') install_headers('gdkwin32.h', subdir: 'gtk-3.0/gdk') @@ -44,5 +51,5 @@ gdk_win32_deps = [ # FIXME libgdk_win32 = static_library('gdk-win32', gdk_win32_sources, gdkconfig, gdkenum_h, include_directories: [confinc, gdkinc], - c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'], + c_args: GDK_WIN32_CFLAGS, dependencies: [gdk_deps, gdk_win32_deps]) diff --git a/meson.build b/meson.build index 67d386a74b..4b902f276e 100644 --- a/meson.build +++ b/meson.build @@ -584,6 +584,20 @@ if win32_enabled endif pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32'] backend_immodules += ['ime'] + +# Check whether libepoxy is built with EGL support on Windows + win32_has_egl = cc.links( + ''' + #include + + int main(int argc, char *argv[]) { + return epoxy_egl_version (EGL_NO_DISPLAY); + } + ''', + dependencies : epoxy_dep, + name : 'libepoxy supports EGL on Windows' + ) + endif # Check for bind_textdomain_codeset, including -lintl if GLib brings it in by From b0a31fefd7be8fa167cff87f472fd7ddbd8c9257 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 16:27:36 +0800 Subject: [PATCH 24/89] meson: Fix Broadway builds Make sure the source files are in line with GTK+-3.x Broadway backend sources. --- gdk/broadway/gen-c-array.py | 21 +++++++++++++++++++++ gdk/broadway/meson.build | 7 ++++--- gtk/meson.build | 4 ---- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 gdk/broadway/gen-c-array.py diff --git a/gdk/broadway/gen-c-array.py b/gdk/broadway/gen-c-array.py new file mode 100644 index 0000000000..afffda34e5 --- /dev/null +++ b/gdk/broadway/gen-c-array.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +import argparse +import sys + +parser = argparse.ArgumentParser() +parser.add_argument('--array-name', help='The name of the array variable') +parser.add_argument('--output', metavar='FILE', help='Output file', + type=argparse.FileType('w'), + default=sys.stdout) +parser.add_argument('input', metavar='FILE', help='The input file', + type=argparse.FileType('r')) + +args = parser.parse_args() + +args.output.write('static const char {}[] = {{\n'.format(args.array_name)) +for line in args.input: + for ch in line: + args.output.write(' 0x{:02x},\n'.format(ord(ch))) + +args.output.write('};') diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build index 57e3488786..1e2e3044af 100644 --- a/gdk/broadway/meson.build +++ b/gdk/broadway/meson.build @@ -19,9 +19,10 @@ gdk_broadway_sources = files( gdk_broadway_public_headers = files( 'gdkbroadwaydisplay.h', - 'gdkbroadwaysurface.h', + 'gdkbroadwaywindow.h', 'gdkbroadwaycursor.h', 'gdkbroadwaymonitor.h', + 'gdkbroadwayvisual.h', ) # Broadway backend headers aren't installed it seems @@ -67,11 +68,11 @@ libgdk_broadway = static_library('gdk-broadway', # gtk4-broadwayd -broadwayd_syslib = os_win32 ? find_library('ws2_32') : shmlib +broadwayd_syslib = os_win32 ? cc.find_library('ws2_32') : shmlib executable('broadwayd', clienthtml_h, broadwayjs_h, - 'broadwayd.c', 'broadway-server.c', 'broadway-output.c', + 'broadwayd.c', 'broadway-server.c', 'broadway-buffer.c', 'broadway-output.c', include_directories: [confinc, gdkinc, include_directories('.')], c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ], dependencies : [broadwayd_syslib, gdk_deps], diff --git a/gtk/meson.build b/gtk/meson.build index bb4f179149..f392b20db9 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -836,10 +836,6 @@ if wayland_enabled gtk_sources += gtk_use_wayland_sources endif -if broadway_enabled - gtk_sources += ['gtkimcontextbroadway.c'] -endif - if win32_enabled gtk_cargs += [] gtk_sources += gtk_use_win32_sources From 397471d604efd35c53e16753c87357dd67148095 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 13:13:43 +0800 Subject: [PATCH 25/89] demos/gtk-demo/meson.build: Build gtk3-demo-application This should also get built as well. --- demos/gtk-demo/meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build index 4a4489231a..77992ade4e 100644 --- a/demos/gtk-demo/meson.build +++ b/demos/gtk-demo/meson.build @@ -110,3 +110,13 @@ gtkdemo = executable( include_directories : confinc, install: true ) + +gtkapplicationdemo = executable( + 'gtk3-demo-application', + 'application.c', + demos_h, + gtkdemo_resources, + dependencies: gtkdemo_deps, + include_directories : confinc, + install: true +) From 988d2dd077629f3d29c9100e362c4c49dd7d51f4 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 13:03:21 +0800 Subject: [PATCH 26/89] examples/bp/bloatpad.c: Declare variables at top-of-block This is to ensure that the code will build on pre-C99 compilers. --- examples/bp/bloatpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c index 13efdcb7eb..d89db89a73 100644 --- a/examples/bp/bloatpad.c +++ b/examples/bp/bloatpad.c @@ -537,6 +537,7 @@ bloat_pad_startup (GApplication *application) { "win.justify::center", { "m", NULL } }, { "win.justify::right", { "r", NULL } } }; + const gchar *new_accels[] = { "n", "t", NULL }; G_APPLICATION_CLASS (bloat_pad_parent_class) ->startup (application); @@ -604,7 +605,6 @@ bloat_pad_startup (GApplication *application) g_object_unref (item); g_object_unref (icon); - const gchar *new_accels[] = { "n", "t", NULL }; gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels); dump_accels (GTK_APPLICATION (application)); From 7d0364a1273e63292602a9444f21d200f4914ede Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 13:04:06 +0800 Subject: [PATCH 27/89] testsuite/gtk/stylecontext.c: Declare variables at top-of-block This will ensure the code builds on pre-C99 compilers. --- testsuite/gtk/stylecontext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c index 6ae7ff9c61..83fde7c5b4 100644 --- a/testsuite/gtk/stylecontext.c +++ b/testsuite/gtk/stylecontext.c @@ -374,11 +374,12 @@ test_style_priorities_setup (PrioritiesFixture *f, gconstpointer unused) { GError *error = NULL; + GtkWidgetPath *path; f->blue_provider = gtk_css_provider_new (); f->red_provider = gtk_css_provider_new (); f->green_provider = gtk_css_provider_new (); f->context = gtk_style_context_new (); - GtkWidgetPath *path = gtk_widget_path_new (); + path = gtk_widget_path_new (); gtk_css_provider_load_from_data (f->blue_provider, "* { color: blue; }", -1, &error); g_assert_no_error (error); From 92206fe23b6e47acd6834a2b7a17bd76705db469 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 13:05:08 +0800 Subject: [PATCH 28/89] tests/animated-resizing.c: Include gtk/fallback-c89.c This is to ensure that compilers that do not have round() in math.h can still build the code. --- tests/animated-resizing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/animated-resizing.c b/tests/animated-resizing.c index d11d6e0dee..fbafe97c6d 100644 --- a/tests/animated-resizing.c +++ b/tests/animated-resizing.c @@ -1,9 +1,9 @@ /* -*- mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ #include -#include #include +#include "gtk/fallback-c89.c" #include "frame-stats.h" #define RADIUS 64 From 0e24d35e3b631345e34bca042fc771f17e0a1fce Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 13:06:04 +0800 Subject: [PATCH 29/89] tests/: Declare variables at the top-of-block This will ensure that the code will build for pre-C99 compilers. --- tests/testbaseline.c | 6 +++--- tests/testspinbutton.c | 3 ++- tests/video-timer.c | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/testbaseline.c b/tests/testbaseline.c index 3e6965bfaa..a9581f727a 100644 --- a/tests/testbaseline.c +++ b/tests/testbaseline.c @@ -99,12 +99,12 @@ main (int argc, for (j = 0; j < 2; j++) { - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 5); - char *aligns_names[] = { "FILL", "BASELINE" }; GtkAlign aligns[] = { GTK_ALIGN_FILL, GTK_ALIGN_BASELINE}; + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 5); + label = gtk_label_new (aligns_names[j]); gtk_container_add (GTK_CONTAINER (hbox), label); diff --git a/tests/testspinbutton.c b/tests/testspinbutton.c index 14eafdff47..d0925335d0 100644 --- a/tests/testspinbutton.c +++ b/tests/testspinbutton.c @@ -56,12 +56,13 @@ prepare_window_for_orientation (GtkOrientation orientation) 0.0); GtkWidget *spin = gtk_spin_button_new (adj, 1.0, 0); + GtkWidget *hbox; gtk_orientable_set_orientation (GTK_ORIENTABLE (spin), orientation); gtk_widget_set_halign (GTK_WIDGET (spin), GTK_ALIGN_CENTER); g_object_bind_property (wrap_button, "active", spin, "wrap", G_BINDING_SYNC_CREATE); - GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 2); gtk_container_add (GTK_CONTAINER (mainbox), hbox); } diff --git a/tests/video-timer.c b/tests/video-timer.c index bc5de1e5fe..cd137eec60 100644 --- a/tests/video-timer.c +++ b/tests/video-timer.c @@ -237,11 +237,12 @@ collect_old_frames (void) for (l = past_frames; l; l = l_next) { FrameData *frame_data = l->data; + GdkFrameTimings *timings; gboolean remove = FALSE; l_next = l->next; - GdkFrameTimings *timings = gdk_frame_clock_get_timings (frame_clock, - frame_data->frame_counter); + timings = gdk_frame_clock_get_timings (frame_clock, + frame_data->frame_counter); if (timings == NULL) { remove = TRUE; From 1cd99d63d1a055c8435b6fa1a92aed8ca7766383 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 13 Mar 2019 14:01:13 +0800 Subject: [PATCH 30/89] meson: Build the .rc files on Windows This will ensure that the version info is easily visible from the GDK/GTK+ DLLs, and ensure that the print dialogs will have a more modern look and feel. --- gdk/meson.build | 11 +++++++++++ gdk/win32/rc/gdk.rc.in | 2 +- gtk/gen-rc.py | 21 +++++++++++++++++++++ gtk/gtk-win32.rc.body.in | 2 +- gtk/meson.build | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 gtk/gen-rc.py diff --git a/gdk/meson.build b/gdk/meson.build index 8d296a6343..9bf99b81a2 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -177,6 +177,9 @@ gdkversion_cdata = configuration_data() gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version) gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version) gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version) +gdkversion_cdata.set('GTK_API_VERSION', gtk_api_version) +gdkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version) +gdkversion_cdata.set('GTK_VERSION', meson.project_version()) gdkversionmacros = configure_file( input : 'gdkversionmacros.h.in', @@ -212,6 +215,14 @@ if win32_enabled cc.find_library('imm32'), cc.find_library('setupapi'), cc.find_library('winmm')] + + gdk_rc = configure_file( + input: 'win32/rc/gdk.rc.in', + output: 'gdk.rc', + configuration: gdkversion_cdata, + ) + gdk_res = import('windows').compile_resources(gdk_rc, include_directories: include_directories('win32/rc')) + gdk_sources += gdk_res endif gdk_sources = [ diff --git a/gdk/win32/rc/gdk.rc.in b/gdk/win32/rc/gdk.rc.in index 07ab1b4553..f9b57f5197 100644 --- a/gdk/win32/rc/gdk.rc.in +++ b/gdk/win32/rc/gdk.rc.in @@ -19,7 +19,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", "GIMP Drawing Kit" VALUE "FileVersion", "@GTK_VERSION@.0" VALUE "InternalName", "libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@" - VALUE "LegalCopyright", "Copyright © 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." VALUE "OriginalFilename", "libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll" VALUE "ProductName", "GTK+" VALUE "ProductVersion", "@GTK_VERSION@" diff --git a/gtk/gen-rc.py b/gtk/gen-rc.py new file mode 100644 index 0000000000..2c24fa5f6e --- /dev/null +++ b/gtk/gen-rc.py @@ -0,0 +1,21 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +import os + +out_file = sys.argv[1] +in_file = sys.argv[2] +old_msvc = sys.argv[3] + +with open(out_file, 'w') as o: + if old_msvc is not None and old_msvc == "1": + o.write("#define ISOLATION_AWARE_ENABLED 1\n") + o.write('#include \n') + + with open(in_file, 'r') as f: + for line in f: + o.write(line) + + o.write('\n') + o.write('ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST libgtk3.manifest') \ No newline at end of file diff --git a/gtk/gtk-win32.rc.body.in b/gtk/gtk-win32.rc.body.in index 4a42d5a666..3834e16efc 100644 --- a/gtk/gtk-win32.rc.body.in +++ b/gtk/gtk-win32.rc.body.in @@ -17,7 +17,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", "GIMP Toolkit" VALUE "FileVersion", "@GTK_VERSION@.0" VALUE "InternalName", "libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@" - VALUE "LegalCopyright", "Copyright © 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2011." VALUE "OriginalFilename", "libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll" VALUE "ProductName", "GTK+" VALUE "ProductVersion", "@GTK_VERSION@" diff --git a/gtk/meson.build b/gtk/meson.build index f392b20db9..3b5fa43a92 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -784,6 +784,10 @@ gtkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version) gtkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version) gtkversion_cdata.set('GTK_BINARY_AGE', gtk_binary_age) gtkversion_cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) +gtkversion_cdata.set('GTK_API_VERSION', gtk_api_version) +gtkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version) +gtkversion_cdata.set('GTK_VERSION', meson.project_version()) +gtkversion_cdata.set('EXE_MANIFEST_ARCHITECTURE', '*') gtkversion = configure_file(input: 'gtkversion.h.in', output: 'gtkversion.h', @@ -840,6 +844,41 @@ if win32_enabled gtk_cargs += [] gtk_sources += gtk_use_win32_sources gtk_deps += [ giowin32_dep, pangowin32_dep ] + + gtk_rc_body = configure_file( + input: 'gtk-win32.rc.body.in', + output: 'gtk-win32.rc.body', + configuration: gtkversion_cdata, + ) + gtk_rc_manifest = configure_file( + input: 'libgtk3.manifest.in', + output: 'libgtk3.manifest', + configuration: gtkversion_cdata, + ) + + # Unfortunately, an extra directive in the .rc file is required for earlier + # Visual Studio for embedding manifests via .rc files (2010 [v16] and earlier) + # using ISOLATIONAWARE_MANIFEST_RESOURCE_ID to really work. Somehow for + # Visual Studio 2008 builds, this does not yet work. + old_msvc = false + + if cc.get_id() == 'msvc' and cc.version().split('.')[0].to_int() < 17 + old_msvc = true + endif + + gtk_rc = custom_target( + 'gtk.rc', + output: 'gtk.rc', + input: gtk_rc_body, + command: [find_program('gen-rc.py'), + '@OUTPUT@', + '@INPUT@', + old_msvc ? '1' : '' + ], + install: false, + ) + gtk_res = import('windows').compile_resources(gtk_rc) + gtk_sources += gtk_res else gtk_deps += [ atkbridge_dep, ] endif From e24e0dd8a551e310e730a9b38ec66471b27c3f8a Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 22 Mar 2019 17:31:02 +0800 Subject: [PATCH 31/89] meson: Make post-install script a Python script This is so that the post install script will work on environments where *NIX shell scripts are not supported, such as on Windows cmd.exe for Visual Studio builds. --- build-aux/meson/post-install.py | 36 +++++++++++++++++++++++++++++++++ build-aux/meson/post-install.sh | 26 ------------------------ meson.build | 5 +++-- 3 files changed, 39 insertions(+), 28 deletions(-) create mode 100644 build-aux/meson/post-install.py delete mode 100755 build-aux/meson/post-install.sh diff --git a/build-aux/meson/post-install.py b/build-aux/meson/post-install.py new file mode 100644 index 0000000000..f526bc81bf --- /dev/null +++ b/build-aux/meson/post-install.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +import os +import sys +import subprocess + +if 'DESTDIR' not in os.environ: + gtk_api_version = sys.argv[1] + gtk_abi_version = sys.argv[2] + gtk_bindir = sys.argv[3] + gtk_libdir = sys.argv[4] + gtk_datadir = sys.argv[5] + gtk_query_immodules = os.path.join(gtk_bindir, 'gtk-query-immodules-' + gtk_api_version) + + gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version) + gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules') + gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends') + + print('Compiling GSettings schemas...') + subprocess.call(['glib-compile-schemas', + os.path.join(gtk_datadir, 'glib-2.0', 'schemas')]) + + print('Updating icon cache...') + subprocess.call(['gtk-update-icon-cache', '-q', '-t' ,'-f', + os.path.join(gtk_datadir, 'icons', 'hicolor')]) + + print('Updating module cache for input methods...') + os.makedirs(gtk_immodule_dir, exist_ok=True) + immodule_cache_file = open(os.path.join(gtk_moduledir, 'immodules.cache'), 'w') + subprocess.call([gtk_query_immodules], stdout=immodule_cache_file) + immodule_cache_file.close() + + # Untested! + print('Updating module cache for print backends...') + os.makedirs(gtk_printmodule_dir, exist_ok=True) + subprocess.call(['gio-querymodules', gtk_printmodule_dir]) diff --git a/build-aux/meson/post-install.sh b/build-aux/meson/post-install.sh deleted file mode 100755 index 3471336bdb..0000000000 --- a/build-aux/meson/post-install.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -gtk_api_version=$1 -gtk_abi_version=$2 -gtk_libdir=$3 -gtk_datadir=$4 - -# Package managers set this so we don't need to run -if [ -z "$DESTDIR" ]; then - echo Compiling GSettings schemas... - glib-compile-schemas ${gtk_datadir}/glib-2.0/schemas - - echo Updating desktop database... - update-desktop-database -q ${gtk_datadir}/applications - - echo Updating icon cache... - gtk-update-icon-cache -q -t -f ${gtk_datadir}/icons/hicolor - - echo Updating module cache for print backends... - mkdir -p ${gtk_libdir}/gtk-3.0/3.0.0/printbackends - gio-querymodules ${gtk_libdir}/gtk-3.0/3.0.0/printbackends - - echo Updating module cache for input methods... - mkdir -p ${gtk_libdir}/gtk-3.0/3.0.0/immodules - gio-querymodules ${gtk_libdir}/gtk-3.0/3.0.0/immodules -fi diff --git a/meson.build b/meson.build index 4b902f276e..167689ec85 100644 --- a/meson.build +++ b/meson.build @@ -749,10 +749,11 @@ endif # subdir('docs/reference') #endif -# Keep this in sync with post-install.sh expected arguments -meson.add_install_script('build-aux/meson/post-install.sh', +# Keep this in sync with post-install.py expected arguments +meson.add_install_script('build-aux/meson/post-install.py', gtk_api_version, gtk_binary_version, + join_paths(gtk_prefix, get_option('bindir')), gtk_libdir, gtk_datadir) From 6b079afa0a6da583ce7918614cbb3b94724ae0e7 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 25 Mar 2019 15:21:51 +0800 Subject: [PATCH 32/89] meson: Fix GDK-Win32 build We have a new source file that we must build, gdkwin32langnotification.c. --- gdk/win32/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build index 15043a9a1d..103a7fa82b 100644 --- a/gdk/win32/meson.build +++ b/gdk/win32/meson.build @@ -19,6 +19,7 @@ gdk_win32_sources = files( 'gdkselection-win32.c', 'gdktestutils-win32.c', 'gdkwin32id.c', + 'gdkwin32langnotification.c', 'gdkwindow-win32.c', ) From 5e8edec25434f475dbca04eba84fc621810e7c37 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 25 Mar 2019 17:33:03 +0800 Subject: [PATCH 33/89] meson: Build the input modules Build the input modules for GTK+, either as modules or built directly into GTK. Also provide a configure option to build the specified immodules, or all, or the backend immodule(s) or none of the immodules into GTK. Note that for Visual Studio all immodules are built into the GTK DLL by default, like what is done in the Visual Studio projects. Note that building the backend immodules for Quartz, X11 and Wayland are currently untested. --- gtk/meson.build | 4 +- meson.build | 81 +++++++++++++++++++++++++++++++++++++++ meson_options.txt | 4 ++ modules/input/meson.build | 27 +++++++++++++ modules/meson.build | 2 +- 5 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 modules/input/meson.build diff --git a/gtk/meson.build b/gtk/meson.build index 3b5fa43a92..cd64955e2a 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -931,9 +931,9 @@ endif libgtk = shared_library('gtk-3', soversion: gtk_soversion, sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h], - c_args: gtk_cargs + common_cflags, + c_args: gtk_cargs + common_cflags + gtk_included_im_cflags, include_directories: [confinc, gdkinc, gtkinc], - dependencies: gtk_deps + [libgdk_dep], + dependencies: gtk_deps + [libgdk_dep] + gtk_included_im_deps, link_with: libgdk, link_args: common_ldflags, darwin_versions : gtk_osxversions, diff --git a/meson.build b/meson.build index 167689ec85..7466347d3f 100644 --- a/meson.build +++ b/meson.build @@ -130,6 +130,9 @@ gtk_applicationsdir = join_paths(gtk_datadir, 'applications') gtk_schemasdir = join_paths(gtk_datadir, 'glib-2.0/schemas') gtk_appdatadir = join_paths(gtk_datadir, 'metainfo') +# multipress: is mplocaledir defined somewhere? +gtk_mplocaledir = join_paths(gtk_prefix, get_option('localedir')) + cc = meson.get_compiler('c') cdata = configuration_data() @@ -600,6 +603,84 @@ if win32_enabled endif +# IMModules stuff-unfortunately we need to put items here +# as they can be built as modules or built directly into GTK +builtin_all_immodules = false + +builtin_modules_opt = get_option('builtin_immodules') +builtin_immodules = [] + +if builtin_modules_opt == '' + if cc.get_id() == 'msvc' + # Current MSVC projects build all immodules directly into GTK by default + message('IMModules are built into GTK for MSVC builds by default') + builtin_immodules = ['all'] + else + builtin_immodules = ['none'] + endif +else + builtin_immodules = builtin_modules_opt.split(',') +endif + +if builtin_immodules.contains('none') + builtin_immodules = [] +elif builtin_immodules.contains('all') + builtin_all_immodules = true +elif builtin_immodules.contains('backend') + builtin_immodules += backend_immodules +endif + +# Unfortunately it seems that we need to include the input module sources here, and build +# them in $(buildrootdir) if we are to build them included in GTK... +# Make sure the source listings are the same as in modules/input/Makefile.am +immodule_srcdir = 'modules/input/' +immodules = [ + [ 'am-et', [ immodule_srcdir + 'imam-et.c' ] ], + [ 'cedilla', [ immodule_srcdir + 'imcedilla.c' ] ], + [ 'cyrillic-translit', [ immodule_srcdir + 'imcyrillic-translit.c' ] ], + [ 'inuktitut', [ immodule_srcdir + 'iminuktitut.c' ] ], + [ 'ipa', [ immodule_srcdir + 'imipa.c' ] ], + [ 'multipress', [ immodule_srcdir + 'gtkimcontextmultipress.c', immodule_srcdir + 'immultipress.c' ], true, + ['-DMULTIPRESS_LOCALEDIR="\"@0@\""'.format(gtk_mplocaledir), + '-DMULTIPRESS_CONFDIR="\"@0@/gtk-3.0\""'.format(gtk_sysconfdir)] ], + [ 'thai', [ immodule_srcdir + 'thai-charprop.c', immodule_srcdir + 'gtkimcontextthai.c', immodule_srcdir + 'imthai.c' ] ], + [ 'ti-er', [ immodule_srcdir + 'imti-er.c' ] ], + [ 'ti-et', [ immodule_srcdir + 'imti-et.c' ] ], + [ 'viqr', [ immodule_srcdir + 'imviqr.c' ] ], + [ 'broadway', [ immodule_srcdir + 'imbroadway.c' ], broadway_enabled ], + [ 'ime', [ immodule_srcdir + 'gtkimcontextime.c', immodule_srcdir + 'imime.c' ], win32_enabled ], + # anything below this line is untested! + [ 'quartz', [ immodule_srcdir + 'imquartz.c' ], quartz_enabled, '-xobjective-c' ], + [ 'wayland', [ immodule_srcdir + immodule_srcdir + 'imwayland.c', immodule_srcdir + 'text-input-unstable-v3-protocol.c' ], wayland_enabled ], + [ 'waylandgtk', [ immodule_srcdir + 'imwaylandgtk.c', immodule_srcdir + 'gtk-text-input-protocol.c' ], wayland_enabled ], + [ 'xim', [ immodule_srcdir + 'gtkimcontextxim.c', immodule_srcdir + 'imxim.c' ], x11_enabled ], +] + +gtk_included_im_cflags = [] +gtk_included_im_deps = [] +immodules_cflags = [ '-DGTK_COMPILATION' ] +included_immodules_cflags = immodules_cflags + +foreach l: immodules + name = l[0] + sources = l[1] + cond = l.get(2, true) + cflags = l.get(3, []) + + if cond and (builtin_immodules.contains(name) or builtin_all_immodules) + cflag_for_included_immodule = ['-DINCLUDE_IM_@0@'.format(name)] + gtk_included_im_cflags += cflag_for_included_immodule + included_immodules_cflags += immodules_cflags + cflag_for_included_immodule + cflags + + mod = static_library('staticimmodule-@0@'.format(name), + sources, + c_args: common_cflags + included_immodules_cflags, + include_directories: [confinc, gtkinc]) + + gtk_included_im_deps += declare_dependency(link_with: mod) + endif +endforeach + # Check for bind_textdomain_codeset, including -lintl if GLib brings it in by # doing the same check as glib. We can't check that by linking to glib because # it might be a subproject and hence not built yet. diff --git a/meson_options.txt b/meson_options.txt index 79aca2aa66..683fff669a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -37,3 +37,7 @@ option('build-examples', type: 'boolean', value: 'true', description : 'Build examples') option('build-tests', type: 'boolean', value: 'true', description : 'Build tests') + +# input modules +option('builtin_immodules', type: 'string', + value: '', description: 'Build specified immodules into GTK so/DLL (comma-separated list), "all", "none" or "backend"') diff --git a/modules/input/meson.build b/modules/input/meson.build new file mode 100644 index 0000000000..5d9fd5529b --- /dev/null +++ b/modules/input/meson.build @@ -0,0 +1,27 @@ + +# Note: the list of immodules is in $(srcroot)/meson.build! + +foreach l: immodules + name = l[0] + sources = l[1] + cond = l.get(2, true) + cflags = l.get(3, []) + immod_sources = [] + + # Only get the filename without modules/input + foreach s: sources + immod_sources += s.split('/')[2] + endforeach + + if cond and not (builtin_immodules.contains(name) or builtin_all_immodules) + immodules_cflags += cflags + + shared_module('im-@0@'.format(name), + immod_sources, + c_args: common_cflags + immodules_cflags, + dependencies: [ libgtk_dep ], + install_dir: '@0@/gtk-@1@/@2@/immodules/'.format(gtk_libdir, gtk_api_version, gtk_binary_version), + include_directories: [confinc, gtkinc], + install : true) + endif +endforeach \ No newline at end of file diff --git a/modules/meson.build b/modules/meson.build index 9779ee6ae8..e4b4b7905b 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -5,4 +5,4 @@ print_backends = [] #endif -#subdir('input') +subdir('input') From 7586e8820446b72af57ef0838abf3cc49d840084 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 25 Mar 2019 18:01:24 +0800 Subject: [PATCH 34/89] meson: Build libgail-util This adds libgail-util to the build process. --- libgail-util/meson.build | 29 +++++++++++++++++++++++++++++ meson.build | 1 + 2 files changed, 30 insertions(+) create mode 100644 libgail-util/meson.build diff --git a/libgail-util/meson.build b/libgail-util/meson.build new file mode 100644 index 0000000000..2b7828e724 --- /dev/null +++ b/libgail-util/meson.build @@ -0,0 +1,29 @@ +gailutil_sources = files( + 'gailmisc.c', + 'gailtextutil.c', +) + +gailutil_public_headers = files( + 'gailmisc.h', + 'gailtextutil.h', + 'gail-util.h', + ) + +install_headers(gailutil_public_headers, subdir : 'gail-3.0/libgail-util') + +gailutil_link_args = common_ldflags + +if cc.get_id() == 'msvc' + gailutil_link_args += '-def:@0@/gailutil.def'.format(meson.current_source_dir()) +endif + +libgailutil = shared_library('gailutil-3', + sources: [gailutil_sources], + dependencies: libgtk_dep, + include_directories: [confinc, gtkinc], + c_args: [ + '-DGDK_DISABLE_DEPRECATED', + '-DGTK_DISABLE_DEPRECATED', + ] + common_cflags, + link_args: gailutil_link_args, + install: true) \ No newline at end of file diff --git a/meson.build b/meson.build index 7466347d3f..8646f8f9a7 100644 --- a/meson.build +++ b/meson.build @@ -722,6 +722,7 @@ build_gir = get_option('introspection') subdir('gdk') subdir('gtk') subdir('modules') +subdir('libgail-util') if get_option('demos') subdir('demos') endif From c1e40a5fbd54843df0a4d8d826c5c5c47c83583f Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 26 Mar 2019 16:53:20 +0800 Subject: [PATCH 35/89] meson: Really fix Broadway builds We must also feed rawinflate.min.js into gen-c-array.py, so that the windows really show up in the browser when running GTK programs using broadway. --- gdk/broadway/gen-c-array.py | 9 +++++---- gdk/broadway/meson.build | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gdk/broadway/gen-c-array.py b/gdk/broadway/gen-c-array.py index afffda34e5..70c0dc9fca 100644 --- a/gdk/broadway/gen-c-array.py +++ b/gdk/broadway/gen-c-array.py @@ -9,13 +9,14 @@ parser.add_argument('--output', metavar='FILE', help='Output file', type=argparse.FileType('w'), default=sys.stdout) parser.add_argument('input', metavar='FILE', help='The input file', - type=argparse.FileType('r')) + type=argparse.FileType('r'), nargs='+') args = parser.parse_args() args.output.write('static const char {}[] = {{\n'.format(args.array_name)) -for line in args.input: - for ch in line: - args.output.write(' 0x{:02x},\n'.format(ord(ch))) +for input in args.input: + for line in input: + for ch in line: + args.output.write(' 0x{:02x},\n'.format(ord(ch))) args.output.write('};') diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build index 1e2e3044af..27dc52a872 100644 --- a/gdk/broadway/meson.build +++ b/gdk/broadway/meson.build @@ -45,13 +45,13 @@ clienthtml_h = custom_target('clienthtml.h', ) broadwayjs_h = custom_target('broadwayjs.h', - input : ['broadway.js'], + input : ['broadway.js', 'rawinflate.min.js'], output : 'broadwayjs.h', command : [ gen_c_array, '--array-name=broadway_js', '--output=@OUTPUT@', - '@INPUT0@', + '@INPUT0@','@INPUT1@', ], ) From 6db8e62ae7978ad44fa6caa163c632df38617e6a Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 26 Mar 2019 17:24:03 +0800 Subject: [PATCH 36/89] meson: Install the icons for the demo programs Those should be installed as well, and will also eliminate the error that gtk-update-icon-cache failed during the post install. --- demos/gtk-demo/meson.build | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build index 77992ade4e..1f8e348f6a 100644 --- a/demos/gtk-demo/meson.build +++ b/demos/gtk-demo/meson.build @@ -120,3 +120,17 @@ gtkapplicationdemo = executable( include_directories : confinc, install: true ) + +gtk_settings_schemas = [ + 'org.gtk.Settings.FileChooser.gschema.xml', + 'org.gtk.Settings.ColorChooser.gschema.xml', + 'org.gtk.Settings.EmojiChooser.gschema.xml', + 'org.gtk.Settings.Debug.gschema.xml', +] + +foreach s: [ '16', '22', '24', '32', '48', '256', '512'] + icon_destdir = join_paths(gtk_datadir, 'icons', 'hicolor', '@0@x@0@'.format(s), 'apps') + icons = [join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo.png'), + join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo-symbolic.symbolic.png')] + install_data(icons, install_dir: icon_destdir) +endforeach From 74f68320010c64bd5759d141f37cc821adad5872 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 22 Mar 2019 12:15:48 +0100 Subject: [PATCH 37/89] meson: add fribidi dep --- gdk/meson.build | 1 + gtk/meson.build | 1 + meson.build | 3 +++ 3 files changed, 5 insertions(+) diff --git a/gdk/meson.build b/gdk/meson.build index 9bf99b81a2..d9830de992 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -200,6 +200,7 @@ gdk_deps = [ pixbuf_dep, cairo_dep, pango_dep, + fribidi_dep, cairogobj_dep, glib_dep, epoxy_dep, diff --git a/gtk/meson.build b/gtk/meson.build index cd64955e2a..0ce6c11de9 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -819,6 +819,7 @@ gtk_deps = [ platform_gio_dep, pangocairo_dep, pango_dep, + fribidi_dep, cairogobj_dep, cairo_dep, fontconfig_dep, diff --git a/meson.build b/meson.build index 8646f8f9a7..a90c93fb8e 100644 --- a/meson.build +++ b/meson.build @@ -25,6 +25,7 @@ endif glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req) pango_req = '>= 1.41.0' +fribidi_req = '>= 0.19.7' atk_req = '>= 2.15.1' cairo_req = '>= 1.14.0' gdk_pixbuf_req = '>= 2.30.0' @@ -341,6 +342,8 @@ endif pango_dep = dependency('pango', version: pango_req, fallback : ['pango', 'libpango_dep']) +fribidi_dep = dependency('fribidi', version: fribidi_req, + fallback : ['fribidi', 'libfribidi_dep']) # Require PangoFT2 if on X11 or wayland require_pangoft2 = wayland_enabled or x11_enabled From ca3385579332add78553e287d4239e5401ae66a7 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 22 Mar 2019 15:15:46 +0100 Subject: [PATCH 38/89] meson: gdk: add missing pangowin32 dep --- gdk/win32/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build index 103a7fa82b..f28bd92b99 100644 --- a/gdk/win32/meson.build +++ b/gdk/win32/meson.build @@ -47,6 +47,7 @@ install_headers(gdk_win32_public_headers, subdir: 'gtk-3.0/gdk/win32') install_headers('gdkwin32.h', subdir: 'gtk-3.0/gdk') gdk_win32_deps = [ # FIXME + pangowin32_dep ] libgdk_win32 = static_library('gdk-win32', From b185f69334382820fa3675bb5925d2f6455fc5df Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 22 Mar 2019 15:16:14 +0100 Subject: [PATCH 39/89] meson: check for and set HAVE_IPRINTDIALOGCALLBACK It's needed under mingw in the print backend --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index a90c93fb8e..54c3a4304a 100644 --- a/meson.build +++ b/meson.build @@ -707,6 +707,12 @@ else endif endif +if os_win32 + if cc.has_header_symbol('windows.h', 'IPrintDialogCallback') + cdata.set('HAVE_IPRINTDIALOGCALLBACK', 1) + endif +endif + if os_unix cdata.set('HAVE_GIO_UNIX', giounix_dep.found()) endif From dc5698ad55a78bb1df93315a151c7773343c37ed Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 22 Mar 2019 10:57:33 +0100 Subject: [PATCH 40/89] CI: add meson build jobs for Fedora and MSYS2 --- .gitlab-ci.yml | 26 ++++++++--- .gitlab-ci/Dockerfile | 9 +++- .gitlab-ci/run-docker.sh | 2 +- ...est-docker.sh => test-docker-autotools.sh} | 0 .gitlab-ci/test-docker-meson.sh | 13 ++++++ ...{test-msys2.sh => test-msys2-autotools.sh} | 1 - .gitlab-ci/test-msys2-meson.sh | 44 +++++++++++++++++++ 7 files changed, 86 insertions(+), 9 deletions(-) rename .gitlab-ci/{test-docker.sh => test-docker-autotools.sh} (100%) create mode 100755 .gitlab-ci/test-docker-meson.sh rename .gitlab-ci/{test-msys2.sh => test-msys2-autotools.sh} (99%) create mode 100644 .gitlab-ci/test-msys2-meson.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe678aa2ea..ac8a628ab0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v1 +image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2 stages: - build @@ -7,12 +7,28 @@ cache: paths: - _ccache/ -build: +fedora-autotools: stage: build script: - - bash -x ./.gitlab-ci/test-docker.sh + - bash -x ./.gitlab-ci/test-docker-autotools.sh -msys2-mingw32: +fedora-meson: + stage: build + script: + - bash -x ./.gitlab-ci/test-docker-meson.sh + +msys2-mingw32-meson: + variables: + MSYSTEM: "MINGW32" + CHERE_INVOKING: "yes" + stage: build + tags: + - win32 + script: + - C:\msys64\usr\bin\pacman --noconfirm -Syyuu + - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-meson.sh" + +msys2-mingw32-autotools: when: manual variables: MSYSTEM: "MINGW32" @@ -22,4 +38,4 @@ msys2-mingw32: - win32 script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu - - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh" + - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-autotools.sh" diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile index a635411ad5..6258a39602 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/Dockerfile @@ -1,4 +1,4 @@ -FROM fedora:28 +FROM fedora:29 RUN dnf -y install \ adwaita-icon-theme \ @@ -42,12 +42,17 @@ RUN dnf -y install \ mesa-libEGL-devel \ mesa-libwayland-egl-devel \ meson \ + ninja-build \ pango-devel \ + python3 \ + python3-pip \ + python3-wheel \ redhat-rpm-config \ vulkan-devel \ wayland-devel \ wayland-protocols-devel \ - xorg-x11-server-Xvfb + xorg-x11-server-Xvfb \ + && dnf clean all ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh index bd9ddeef05..789284130f 100755 --- a/.gitlab-ci/run-docker.sh +++ b/.gitlab-ci/run-docker.sh @@ -8,7 +8,7 @@ set -e -TAG="registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v1" +TAG="registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2" # HOST_USER_ID gets used to create a user with the same ID so that files # created in the mounted volume have the same owner diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker-autotools.sh similarity index 100% rename from .gitlab-ci/test-docker.sh rename to .gitlab-ci/test-docker-autotools.sh diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh new file mode 100755 index 0000000000..c3cbdf56a1 --- /dev/null +++ b/.gitlab-ci/test-docker-meson.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +mkdir -p _ccache +export CCACHE_BASEDIR="$(pwd)" +export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" + +export PATH="${HOME}/.local/bin:${PATH}" +python3 -m pip install --user meson==0.49.2 + +meson _build +ninja -C _build diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2-autotools.sh similarity index 99% rename from .gitlab-ci/test-msys2.sh rename to .gitlab-ci/test-msys2-autotools.sh index 393d15c685..656bac26bd 100644 --- a/.gitlab-ci/test-msys2.sh +++ b/.gitlab-ci/test-msys2-autotools.sh @@ -14,7 +14,6 @@ pacman --noconfirm -Suy # Install the required packages pacman --noconfirm -S --needed \ base-devel \ - git \ mingw-w64-$MSYS2_ARCH-toolchain \ mingw-w64-$MSYS2_ARCH-ccache \ mingw-w64-$MSYS2_ARCH-pkg-config \ diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh new file mode 100644 index 0000000000..2759c0b417 --- /dev/null +++ b/.gitlab-ci/test-msys2-meson.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -e + +if [[ "$MSYSTEM" == "MINGW32" ]]; then + export MSYS2_ARCH="i686" +else + export MSYS2_ARCH="x86_64" +fi + +# Update everything +pacman --noconfirm -Suy + +# Install the required packages +pacman --noconfirm -S --needed \ + mingw-w64-$MSYS2_ARCH-toolchain \ + mingw-w64-$MSYS2_ARCH-ccache \ + mingw-w64-$MSYS2_ARCH-pkg-config \ + mingw-w64-$MSYS2_ARCH-gobject-introspection \ + mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \ + mingw-w64-$MSYS2_ARCH-atk \ + mingw-w64-$MSYS2_ARCH-cairo \ + mingw-w64-$MSYS2_ARCH-gdk-pixbuf2 \ + mingw-w64-$MSYS2_ARCH-glib2 \ + mingw-w64-$MSYS2_ARCH-json-glib \ + mingw-w64-$MSYS2_ARCH-libepoxy \ + mingw-w64-$MSYS2_ARCH-pango \ + mingw-w64-$MSYS2_ARCH-shared-mime-info \ + mingw-w64-$MSYS2_ARCH-meson \ + mingw-w64-$MSYS2_ARCH-ninja \ + mingw-w64-$MSYS2_ARCH-gtk-doc + +mkdir -p _ccache +export CCACHE_BASEDIR="$(pwd)" +export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" + +# Build +ccache --zero-stats +ccache --show-stats + +meson _build +ninja -C _build + +ccache --show-stats From 857b9a55a481cb979dffbf82abbad1031c19cead Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 28 Mar 2019 17:41:36 +0100 Subject: [PATCH 41/89] meson: fix build of immultipress.c with mingw There is no need to escape the quotes since we are not in a shell here and things get passed to the compiler as is. --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 54c3a4304a..eeded30ea7 100644 --- a/meson.build +++ b/meson.build @@ -644,8 +644,8 @@ immodules = [ [ 'inuktitut', [ immodule_srcdir + 'iminuktitut.c' ] ], [ 'ipa', [ immodule_srcdir + 'imipa.c' ] ], [ 'multipress', [ immodule_srcdir + 'gtkimcontextmultipress.c', immodule_srcdir + 'immultipress.c' ], true, - ['-DMULTIPRESS_LOCALEDIR="\"@0@\""'.format(gtk_mplocaledir), - '-DMULTIPRESS_CONFDIR="\"@0@/gtk-3.0\""'.format(gtk_sysconfdir)] ], + ['-DMULTIPRESS_LOCALEDIR="@0@"'.format(gtk_mplocaledir), + '-DMULTIPRESS_CONFDIR="@0@/gtk-3.0"'.format(gtk_sysconfdir)] ], [ 'thai', [ immodule_srcdir + 'thai-charprop.c', immodule_srcdir + 'gtkimcontextthai.c', immodule_srcdir + 'imthai.c' ] ], [ 'ti-er', [ immodule_srcdir + 'imti-er.c' ] ], [ 'ti-et', [ immodule_srcdir + 'imti-et.c' ] ], From 09fe0b0edc758708a6f4c3006f160d28d39c49c7 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 28 Mar 2019 19:51:35 +0100 Subject: [PATCH 42/89] meson: disable some broken immodules for now To fix the build. We need to port the source generation logic from gtk4 for this. --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index eeded30ea7..0d11495c42 100644 --- a/meson.build +++ b/meson.build @@ -652,10 +652,10 @@ immodules = [ [ 'viqr', [ immodule_srcdir + 'imviqr.c' ] ], [ 'broadway', [ immodule_srcdir + 'imbroadway.c' ], broadway_enabled ], [ 'ime', [ immodule_srcdir + 'gtkimcontextime.c', immodule_srcdir + 'imime.c' ], win32_enabled ], - # anything below this line is untested! [ 'quartz', [ immodule_srcdir + 'imquartz.c' ], quartz_enabled, '-xobjective-c' ], - [ 'wayland', [ immodule_srcdir + immodule_srcdir + 'imwayland.c', immodule_srcdir + 'text-input-unstable-v3-protocol.c' ], wayland_enabled ], - [ 'waylandgtk', [ immodule_srcdir + 'imwaylandgtk.c', immodule_srcdir + 'gtk-text-input-protocol.c' ], wayland_enabled ], + # FIXME: needs to be ported from gtk4 + # [ 'wayland', [ immodule_srcdir + 'imwayland.c', immodule_srcdir + 'text-input-unstable-v3-protocol.c' ], wayland_enabled ], + # [ 'waylandgtk', [ immodule_srcdir + 'imwaylandgtk.c', immodule_srcdir + 'gtk-text-input-protocol.c' ], wayland_enabled ], [ 'xim', [ immodule_srcdir + 'gtkimcontextxim.c', immodule_srcdir + 'imxim.c' ], x11_enabled ], ] From fb083b6de28f8651af20ccbac1f20d7704859366 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 28 Mar 2019 22:08:04 +0100 Subject: [PATCH 43/89] tests: don't overwrite GSETTINGS_SCHEMA_DIR when running under meson Under autotools the compiled schemas are in the build directory and with meson they are in the root build dir. Avoid changing the autotools build for now and add a special GTK_TEST_MESON env var which we can use to differentiate the two. See 1253e7bfcbc80f88 for a similar fix on master. --- testsuite/gtk/defaultvalue.c | 3 ++- testsuite/gtk/meson.build | 1 + testsuite/gtk/notify.c | 3 ++- testsuite/gtk/object.c | 3 ++- testsuite/gtk/objects-finalize.c | 3 ++- testsuite/gtk/templates.c | 3 ++- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c index 0cb3073ce7..a82788b7e4 100644 --- a/testsuite/gtk/defaultvalue.c +++ b/testsuite/gtk/defaultvalue.c @@ -472,7 +472,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* Create one test bus for all tests, as we have a lot of very small * and quick tests. diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index 67863593a4..7cf67be39d 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -85,6 +85,7 @@ foreach t : tests 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), + 'GTK_TEST_MESON=1', ], suite: 'gtk') endforeach diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c index 201a44e17b..c7e8a69387 100644 --- a/testsuite/gtk/notify.c +++ b/testsuite/gtk/notify.c @@ -713,7 +713,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); otypes = gtk_test_list_all_types (NULL); for (i = 0; otypes[i]; i++) diff --git a/testsuite/gtk/object.c b/testsuite/gtk/object.c index 6bdcd73864..b561aa9a52 100644 --- a/testsuite/gtk/object.c +++ b/testsuite/gtk/object.c @@ -336,7 +336,8 @@ main (int argc, /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* install a property test for each widget type */ otypes = gtk_test_list_all_types (NULL); diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c index 0b3a5198dc..24540e313f 100644 --- a/testsuite/gtk/objects-finalize.c +++ b/testsuite/gtk/objects-finalize.c @@ -92,7 +92,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* Create one test bus for all tests, as we have a lot of very small * and quick tests. diff --git a/testsuite/gtk/templates.c b/testsuite/gtk/templates.c index 316dc1539d..1827c5a060 100644 --- a/testsuite/gtk/templates.c +++ b/testsuite/gtk/templates.c @@ -353,7 +353,8 @@ main (int argc, char **argv) /* g_test_build_filename must be called after gtk_test_init */ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL); - g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); + if (g_getenv ("GTK_TEST_MESON") == NULL) + g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE); /* This environment variable cooperates with gtk_widget_destroy() * to assert that all automated compoenents are properly finalized From 73fcf0d3d4e6019905660bee353472eca405850c Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 28 Mar 2019 21:14:14 +0100 Subject: [PATCH 44/89] CI: save meson build logs --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac8a628ab0..20d7737e44 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,11 @@ fedora-meson: stage: build script: - bash -x ./.gitlab-ci/test-docker-meson.sh + artifacts: + when: always + name: "gtk3-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" + paths: + - "_build/meson-logs" msys2-mingw32-meson: variables: @@ -27,6 +32,11 @@ msys2-mingw32-meson: script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-meson.sh" + artifacts: + when: always + name: "gtk3-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%" + paths: + - "_build/meson-logs" msys2-mingw32-autotools: when: manual From 7bc1aeef8e56f4e230f335e05b5f87367469e805 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 28 Mar 2019 19:54:13 +0100 Subject: [PATCH 45/89] CI: run the tests with meson Not all are ported I think, but this is a start. --- .gitlab-ci/test-docker-meson.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh index c3cbdf56a1..ab1f8cd50d 100755 --- a/.gitlab-ci/test-docker-meson.sh +++ b/.gitlab-ci/test-docker-meson.sh @@ -10,4 +10,11 @@ export PATH="${HOME}/.local/bin:${PATH}" python3 -m pip install --user meson==0.49.2 meson _build -ninja -C _build +cd _build +ninja + +xvfb-run -a -s "-screen 0 1024x768x24" \ + meson test \ + --timeout-multiplier 4 \ + --print-errorlogs \ + --suite=gtk+-3.0 \ From 9709d7eb6161d4b29df9417fc35f7bfdd98dca85 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 09:27:40 +0100 Subject: [PATCH 46/89] meson: Install key themes --- gtk/meson.build | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gtk/meson.build b/gtk/meson.build index 0ce6c11de9..bc9ea4b865 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -980,14 +980,19 @@ libgtk_dep = declare_dependency(sources: gtk_dep_sources, link_args: common_ldflags) if quartz_enabled - # HACK: install_data() doesn't allow installing under a different name (#1487) - # FIXME: or maybe just rename it to gtk-keys.css in the src tree? - configure_file(input: 'gtk-keys.css.mac', - output: 'gtk-keys.css', - copy: true, - install_dir: join_paths(get_option('datadir'), 'themes/Mac/gtk-4.0')) + install_data(['gtk-keys.css.mac'], + install_dir: join_paths(get_option('datadir'), 'themes/Mac/gtk-3.0'), + rename: ['gtk-keys.css']) endif +install_data(['gtk-keys.css.default'], + install_dir: join_paths(get_option('datadir'), 'themes/Default/gtk-3.0'), + rename: ['gtk-keys.css']) + +install_data(['gtk-keys.css.emacs'], + install_dir: join_paths(get_option('datadir'), 'themes/Emacs/gtk-3.0'), + rename: ['gtk-keys.css']) + ####### Utils ###### gtk_query_settings = executable( 'gtk-query-settings', From 1ee995fd0f8258831a8ae342c063f5d11e84feb1 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 09:44:02 +0100 Subject: [PATCH 47/89] meson: Install im-multipress.conf --- modules/input/meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/input/meson.build b/modules/input/meson.build index 5d9fd5529b..31b2657beb 100644 --- a/modules/input/meson.build +++ b/modules/input/meson.build @@ -16,6 +16,11 @@ foreach l: immodules if cond and not (builtin_immodules.contains(name) or builtin_all_immodules) immodules_cflags += cflags + if name == 'multipress' + install_data('im-multipress.conf', + install_dir: join_paths(gtk_sysconfdir, 'gtk-3.0')) + endif + shared_module('im-@0@'.format(name), immod_sources, c_args: common_cflags + immodules_cflags, @@ -24,4 +29,4 @@ foreach l: immodules include_directories: [confinc, gtkinc], install : true) endif -endforeach \ No newline at end of file +endforeach From 5a84730b4a33bc964f723117aa77ff0839f0e56e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 11:10:46 +0100 Subject: [PATCH 48/89] meson: build and install translations --- meson.build | 4 ++-- po-properties/meson.build | 3 +++ po/meson.build | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 po-properties/meson.build create mode 100644 po/meson.build diff --git a/meson.build b/meson.build index 0d11495c42..9693318a9f 100644 --- a/meson.build +++ b/meson.build @@ -833,8 +833,8 @@ if os_unix endif # TODO -#subdir('po') -#subdir('po-properties') +subdir('po') +subdir('po-properties') #if get_option('documentation') # subdir('docs/tools') # subdir('docs/reference') diff --git a/po-properties/meson.build b/po-properties/meson.build new file mode 100644 index 0000000000..4029453cea --- /dev/null +++ b/po-properties/meson.build @@ -0,0 +1,3 @@ +i18n = import('i18n') + +i18n.gettext('gtk30-properties', preset : 'glib') diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000000..ed71667aa6 --- /dev/null +++ b/po/meson.build @@ -0,0 +1,3 @@ +i18n = import('i18n') + +i18n.gettext('gtk30', preset : 'glib') From 212efbdd81ff1abef57332de4513b4ffef1eea6b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 17:29:36 +0100 Subject: [PATCH 49/89] meson: build docs and man pages Lots of warnings, so something is probably still missing. --- .gitlab-ci/test-docker-meson.sh | 4 +- docs/reference/gdk/meson.build | 177 ++++++++ docs/reference/gtk/meson.build | 535 ++++++++++++++++++++++++ docs/reference/libgail-util/meson.build | 19 + docs/reference/meson.build | 20 + docs/tools/meson.build | 12 + meson.build | 10 +- 7 files changed, 771 insertions(+), 6 deletions(-) create mode 100644 docs/reference/gdk/meson.build create mode 100644 docs/reference/gtk/meson.build create mode 100644 docs/reference/libgail-util/meson.build create mode 100644 docs/reference/meson.build create mode 100644 docs/tools/meson.build diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh index ab1f8cd50d..b24c866c08 100755 --- a/.gitlab-ci/test-docker-meson.sh +++ b/.gitlab-ci/test-docker-meson.sh @@ -9,7 +9,7 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" export PATH="${HOME}/.local/bin:${PATH}" python3 -m pip install --user meson==0.49.2 -meson _build +meson -Ddocumentation=true -Dman-pages=true _build cd _build ninja @@ -18,3 +18,5 @@ xvfb-run -a -s "-screen 0 1024x768x24" \ --timeout-multiplier 4 \ --print-errorlogs \ --suite=gtk+-3.0 \ + +ninja gail-libgail-util3-doc gdk3-doc gtk3-doc diff --git a/docs/reference/gdk/meson.build b/docs/reference/gdk/meson.build new file mode 100644 index 0000000000..e84fac07a4 --- /dev/null +++ b/docs/reference/gdk/meson.build @@ -0,0 +1,177 @@ +private_headers = [ + 'gdkintl.h', + 'gdkmarshalers.h', + 'gdkkeysyms.h', + 'gdkinternals.h', + 'gdkprivate.h', + 'gdk-private.h', + 'gdkapplaunchcontextprivate.h', + 'gdkcursorprivate.h', + 'gdkdevicemanagerprivate.h', + 'gdkdeviceprivate.h', + 'gdkdisplaymanagerprivate.h', + 'gdkdisplayprivate.h', + 'gdkdndprivate.h', + 'gdkframeclockprivate.h', + 'gdkglcontextprivate.h', + 'gdkkeysprivate.h', + 'gdkscreenprivate.h', + 'gdkseatdefaultprivate.h', + 'gdkseatprivate.h', + 'gdkvisualprivate.h', + 'keyname-table.h', + 'win32', + 'x11', + 'quartz', + 'broadway', + 'wayland', +] + +images = [ + 'images/rotated-text.png', + 'images/X_cursor.png', + 'images/arrow.png', + 'images/based_arrow_down.png', + 'images/based_arrow_up.png', + 'images/boat.png', + 'images/bogosity.png', + 'images/bottom_left_corner.png', + 'images/bottom_right_corner.png', + 'images/bottom_side.png', + 'images/bottom_tee.png', + 'images/box_spiral.png', + 'images/center_ptr.png', + 'images/circle.png', + 'images/clock.png', + 'images/coffee_mug.png', + 'images/cross.png', + 'images/cross_reverse.png', + 'images/crosshair.png', + 'images/diamond_cross.png', + 'images/dot.png', + 'images/dotbox.png', + 'images/double_arrow.png', + 'images/draft_large.png', + 'images/draft_small.png', + 'images/draped_box.png', + 'images/exchange.png', + 'images/fleur.png', + 'images/gobbler.png', + 'images/gumby.png', + 'images/hand1.png', + 'images/hand2.png', + 'images/heart.png', + 'images/icon.png', + 'images/iron_cross.png', + 'images/left_ptr.png', + 'images/left_side.png', + 'images/left_tee.png', + 'images/leftbutton.png', + 'images/ll_angle.png', + 'images/lr_angle.png', + 'images/man.png', + 'images/middlebutton.png', + 'images/mouse.png', + 'images/pencil.png', + 'images/pirate.png', + 'images/plus.png', + 'images/question_arrow.png', + 'images/right_ptr.png', + 'images/right_side.png', + 'images/right_tee.png', + 'images/rightbutton.png', + 'images/rtl_logo.png', + 'images/sailboat.png', + 'images/sb_down_arrow.png', + 'images/sb_h_double_arrow.png', + 'images/sb_left_arrow.png', + 'images/sb_right_arrow.png', + 'images/sb_up_arrow.png', + 'images/sb_v_double_arrow.png', + 'images/shuttle.png', + 'images/sizing.png', + 'images/spider.png', + 'images/spraycan.png', + 'images/star.png', + 'images/target.png', + 'images/tcross.png', + 'images/top_left_arrow.png', + 'images/top_left_corner.png', + 'images/top_right_corner.png', + 'images/top_side.png', + 'images/top_tee.png', + 'images/trek.png', + 'images/ul_angle.png', + 'images/umbrella.png', + 'images/ur_angle.png', + 'images/watch.png', + 'images/xterm.png', + 'images/alias_cursor.png', + 'images/all_scroll_cursor.png', + 'images/cell_cursor.png', + 'images/col_resize_cursor.png', + 'images/copy_cursor.png', + 'images/crosshair_cursor.png', + 'images/default_cursor.png', + 'images/e_resize_cursor.png', + 'images/ew_resize_cursor.png', + 'images/grabbing_cursor.png', + 'images/grab_cursor.png', + 'images/hand_cursor.png', + 'images/context_menu_cursor.png', + 'images/help_cursor.png', + 'images/move_cursor.png', + 'images/ne_resize_cursor.png', + 'images/nesw_resize_cursor.png', + 'images/no_drop_cursor.png', + 'images/not_allowed_cursor.png', + 'images/n_resize_cursor.png', + 'images/ns_resize_cursor.png', + 'images/nw_resize_cursor.png', + 'images/nwse_resize_cursor.png', + 'images/pointer_cursor.png', + 'images/progress_cursor.png', + 'images/row_resize_cursor.png', + 'images/se_resize_cursor.png', + 'images/s_resize_cursor.png', + 'images/sw_resize_cursor.png', + 'images/text_cursor.png', + 'images/vertical_text_cursor.png', + 'images/wait_cursor.png', + 'images/w_resize_cursor.png', + 'images/X_cursor.png', + 'images/zoom_in_cursor.png', + 'images/zoom_out_cursor.png', +] + +src_dir = [ gdkinc ] + +if x11_enabled + src_dir += [ gdkx11_inc ] +endif + +if wayland_enabled + src_dir += [ gdkwayland_inc ] +endif + +configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + +gnome.gtkdoc('gdk3', + mode: 'none', + main_xml: 'gdk-docs.sgml', + src_dir: src_dir, + dependencies: libgdk_dep, + gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk3.types'), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + '--ignore-headers=' + ' '.join(private_headers), + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=@0@'.format(cairo_docpath), + ], + html_assets: images, + install: true) diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build new file mode 100644 index 0000000000..d179dac518 --- /dev/null +++ b/docs/reference/gtk/meson.build @@ -0,0 +1,535 @@ +private_headers = [ + 'inspector', + 'a11y', + 'gtkaccelgroupprivate.h', + 'gtkaccelmapprivate.h', + 'gtkadjustmentprivate.h', + 'gtkallocatedbitmaskprivate.h', + 'gtkappchooserprivate.h', + 'gtkapplicationaccelsprivate.h', + 'gtkapplicationprivate.h', + 'gtkbindingsprivate.h', + 'gtkbitmaskprivate.h', + 'gtkboxprivate.h', + 'gtkbuilderprivate.h', + 'gtkbuttonprivate.h', + 'gtkcairoblurprivate.h', + 'gtkcellareaboxcontextprivate.h', + 'gtkclipboardprivate.h', + 'gtkcolorchooserprivate.h', + 'gtkcoloreditorprivate.h', + 'gtkcolorplaneprivate.h', + 'gtkcolorscaleprivate.h', + 'gtkcolorswatchprivate.h', + 'gtkcomboboxprivate.h', + 'gtkcontainerprivate.h', + 'gtkcssanimatedstyleprivate.h', + 'gtkcssanimationprivate.h', + 'gtkcssarrayvalueprivate.h', + 'gtkcssbgsizevalueprivate.h', + 'gtkcssbordervalueprivate.h', + 'gtkcsscolorvalueprivate.h', + 'gtkcsscornervalueprivate.h', + 'gtkcsscustompropertyprivate.h', + 'gtkcsseasevalueprivate.h', + 'gtkcssenginevalueprivate.h', + 'gtkcssenumvalueprivate.h', + 'gtkcssiconthemevalueprivate.h', + 'gtkcssimagebuiltinprivate.h', + 'gtkcssimagecrossfadeprivate.h', + 'gtkcssimagegradientprivate.h', + 'gtkcssimageiconthemeprivate.h', + 'gtkcssimagelinearprivate.h', + 'gtkcssimageprivate.h', + 'gtkcssimagescaledprivate.h', + 'gtkcssimagesurfaceprivate.h', + 'gtkcssimageurlprivate.h', + 'gtkcssimagevalueprivate.h', + 'gtkcssimagewin32private.h', + 'gtkcssinheritvalueprivate.h', + 'gtkcssinitialvalueprivate.h', + 'gtkcsskeyframesprivate.h', + 'gtkcsslookupprivate.h', + 'gtkcssmatcherprivate.h', + 'gtkcssnodeprivate.h', + 'gtkcssnodedeclarationprivate.h', + 'gtkcssnumbervalueprivate.h', + 'gtkcsspathnodeprivate.h', + 'gtkcssparserprivate.h', + 'gtkcsspositionvalueprivate.h', + 'gtkcssproviderprivate.h', + 'gtkcssrepeatvalueprivate.h', + 'gtkcssrgbavalueprivate.h', + 'gtkcsssectionprivate.h', + 'gtkcssselectorprivate.h', + 'gtkcssshadowsvalueprivate.h', + 'gtkcssshadowvalueprivate.h', + 'gtkcssshorthandpropertyprivate.h', + 'gtkcssstaticstyleprivate.h', + 'gtkcssstringvalueprivate.h', + 'gtkcssstylefuncsprivate.h', + 'gtkcssstyleprivate.h', + 'gtkcssstylepropertyprivate.h', + 'gtkcsstransformvalueprivate.h', + 'gtkcsstransientnodeprivate.h', + 'gtkcsstransitionprivate.h', + 'gtkcsstypedvalueprivate.h', + 'gtkcsstypesprivate.h', + 'gtkcssunsetvalueprivate.h', + 'gtkcssvalueprivate.h', + 'gtkcsswidgetnodeprivate.h', + 'gtkdialogprivate.h', + 'gtkentryprivate.h', + 'gtkeventcontrollerprivate.h', + 'gtkfilechooserprivate.h', + 'gtkfilechooserwidgetprivate.h', + 'gtkfontchooserprivate.h', + 'gtkgesturedragprivate.h', + 'gtkgesturelongpressprivate.h', + 'gtkgesturemultipressprivate.h', + 'gtkgesturepanprivate.h', + 'gtkgestureprivate.h', + 'gtkgesturerotateprivate.h', + 'gtkgesturesingleprivate.h', + 'gtkgestureswipeprivate.h', + 'gtkgesturezoomprivate.h', + 'gtkheaderbarprivate.h', + 'gtkhslaprivate.h', + 'gtkiconhelperprivate.h', + 'gtkiconviewprivate.h', + 'gtkimageprivate.h', + 'gtkimmoduleprivate.h', + 'gtklabelprivate.h', + 'gtklockbuttonprivate.h', + 'gtkmagnifierprivate.h', + 'gtkmenubuttonprivate.h', + 'gtkmenuitemprivate.h', + 'gtkmenuprivate.h', + 'gtkmenushellprivate.h', + 'gtkmodulesprivate.h', + 'gtkmountoperationprivate.h', + 'gtkorientableprivate.h', + 'gtkpixelcacheprivate.h', + 'gtkplacessidebarprivate.h', + 'gtkplacesviewprivate.h', + 'gtkplacesviewrowprivate.h', + 'gtkpopoverprivate.h', + 'gtkprinter-private.h', + 'gtkprintoperation-private.h', + 'gtkprivate.h', + 'gtkrangeprivate.h', + 'gtkrecentchooserprivate.h', + 'gtkrenderbackgroundprivate.h', + 'gtkrenderborderprivate.h', + 'gtkrendericonprivate.h', + 'gtkrenderprivate.h', + 'gtkroundedboxprivate.h', + 'gtkscaleprivate.h', + 'gtksearchengine.h', + 'gtksearchenginemodel.h', + 'gtksearchenginequartz.h', + 'gtksearchenginesimple.h', + 'gtksearchenginetracker.h', + 'gtksearchentryprivate.h', + 'gtkselectionprivate.h', + 'gtksettingsprivate.h', + 'gtksidebarrowprivate.h', + 'gtksizegroup-private.h', + 'gtksizerequestcacheprivate.h', + 'gtksocketprivate.h', + 'gtkstyleanimationprivate.h', + 'gtkstylecascadeprivate.h', + 'gtkstylecontextprivate.h', + 'gtkstylepropertyprivate.h', + 'gtkstyleproviderprivate.h', + 'gtktextattributesprivate.h', + 'gtktextchildprivate.h', + 'gtktexthandleprivate.h', + 'gtktextiterprivate.h', + 'gtktextmarkprivate.h', + 'gtktexttagprivate.h', + 'gtktogglebuttonprivate.h', + 'gtktoolbarprivate.h', + 'gtktoolpaletteprivate.h', + 'gtktooltipprivate.h', + 'gtktooltipwindowprivate.h', + 'gtktreeprivate.h', + 'gtkwidgetprivate.h', + 'gtkwin32themeprivate.h', + 'gtkwindowprivate.h', + 'fnmatch.h', + 'gtkactionmuxer.h', + 'gtkactionobserver.h', + 'gtkactionobservable.h', + 'gtk9slice.h', + 'gtkanimationdescription.h', + 'gtkbitmaskprivateimpl.h', + 'gtkbookmarksmanager.h', + 'gtkdbusgenerated.c', + 'gtkdbusgenerated.h', + 'gtkdebug.h', + 'gtkactionhelper.h', + 'gtkdndcursors.h', + 'gtkfilechooserdefault.h', + 'gtkfilechooserembed.h', + 'gtkfilechooserentry.h', + 'gtkfilechoosersettings.h', + 'gtkfilechooserutils.h', + 'gtkfilesystem.h', + 'gtkfilesystemmodel.h', + 'gtkfilesystemunix.h', + 'gtkfilesystemwin32.h', + 'gtkfontchooserutils.h', + 'gtkiconcache.h', + 'gtkiconcachevalidator.h', + 'gtkiconthemeparser.h', + 'gtkintl.h', + 'gtkkeyhash.h', + 'gtkkineticscrolling.h', + 'gtkmarshal.h', + 'gtkmnemonichash.h', + 'gtkmenutracker.h', + 'gtkmenutrackeritem.h', + 'gtkmenusectionbox.h', + 'gtkmodelmenu.h', + 'gtkmodelmenuitem.h', + 'gtkmodifierstyle.h', + 'gtkpathbar.h', + 'gtkprintbackend.h', + 'gtkprinteroption.h', + 'gtkprinteroptionset.h', + 'gtkprinteroptionwidget.h', + 'gtkprint-win32.h', + 'gtkprintutils.h', + 'gtkprivate.h', + 'gtkprivatetypebuiltins.h', + 'gtkquery.h', + 'gtkrbtree.h', + 'gtkrecentchooserdefault.h', + 'gtkrecentchooserutils.h', + 'gtksearchengine.h', + 'gtksearchenginetracker.h', + 'gtksearchenginesimple.h', + 'gtksearchenginequartz.h', + 'gtksequence.h', + 'gtksocketprivate.h', + 'gtktextbtree.h', + 'gtktextbufferserialize.h', + 'gtktextdisplay.h', + 'gtktextlayout.h', + 'gtktextsegment.h', + 'gtktexttypes.h', + 'gtktextutil.h', + 'gtktimeline.h', + 'gtkthemes.h', + 'gtktrashmonitor.h', + 'gtktrayicon.h', + 'gtktreedatalist.h', + 'gtktreemenu.h', + 'gtktypebuiltins.h', + 'gtkxembed.h', + 'gtkwin32embed.h', + 'gtkwin32embedwidget.h', + 'gtkwindow-decorate.h', + 'xdgmime', + 'xembed.h', +] + +images = [ + 'images/aboutdialog.png', + 'images/accel-label.png', + 'images/action-bar.png', + 'images/appchooserbutton.png', + 'images/appchooserdialog.png', + 'images/assistant.png', + 'images/box-packing.png', + 'images/box-expand.png', + 'images/button.png', + 'images/check-button.png', + 'images/color-button.png', + 'images/colorchooser.png', + 'images/combo-box.png', + 'images/combo-box-entry.png', + 'images/combo-box-text.png', + 'images/entry.png', + 'images/figure-hierarchical-drawing.png', + 'images/figure-windowed-label.png', + 'images/file-button.png', + 'images/filechooser.png', + 'images/font-button.png', + 'images/fontchooser.png', + 'images/frame.png', + 'images/glarea.png', + 'images/headerbar.png', + 'images/icon-view.png', + 'images/image.png', + 'images/info-bar.png', + 'images/label.png', + 'images/levelbar.png', + 'images/link-button.png', + 'images/list-and-tree.png', + 'images/lock-button.png', + 'images/lockbutton.png', + 'images/lockbutton-locked.png', + 'images/lockbutton-unlocked.png', + 'images/lockbutton-sorry.png', + 'images/menubar.png', + 'images/menu-button.png', + 'images/messagedialog.png', + 'images/multiline-text.png', + 'images/notebook.png', + 'images/panes.png', + 'images/pagesetupdialog.png', + 'images/placessidebar.png', + 'images/popup-anchors.png', + 'images/popup-flip.png', + 'images/popup-slide.png', + 'images/printdialog.png', + 'images/progressbar.png', + 'images/radio-group.png', + 'images/recentchooserdialog.png', + 'images/scales.png', + 'images/scrollbar.png', + 'images/scrolledwindow.png', + 'images/search-bar.png', + 'images/search-entry.png', + 'images/separator.png', + 'images/sidebar.png', + 'images/spinbutton.png', + 'images/spinner.png', + 'images/stack.png', + 'images/stackswitcher.png', + 'images/statusbar.png', + 'images/toggle-button.png', + 'images/toolbar.png', + 'images/toolpalette.png', + 'images/tree-view-coordinates.png', + 'images/volumebutton.png', + 'images/window.png', + 'images/layout-btlr.png', + 'images/layout-btrl.png', + 'images/layout-lrbt.png', + 'images/layout-lrtb.png', + 'images/layout-rlbt.png', + 'images/layout-rltb.png', + 'images/layout-tblr.png', + 'images/layout-tbrl.png', + 'images/widget-hvalign.png', + 'images/window-default.png', + 'images/hello-world.png', + 'images/grid-packing.png', + 'images/drawing.png', + 'images/switch.png', + 'images/linear.png', + 'images/ease.png', + 'images/ease-in-out.png', + 'images/ease-in.png', + 'images/ease-out.png', + 'images/gradient1.png', + 'images/gradient2.png', + 'images/gradient3.png', + 'images/gradient4.png', + 'images/border1.png', + 'images/border2.png', + 'images/border3.png', + 'images/slices.png', + 'images/checks.png', + 'images/options.png', + 'images/arrows.png', + 'images/expanders.png', + 'images/background.png', + 'images/frames.png', + 'images/frame-gap.png', + 'images/sliders.png', + 'images/focus.png', + 'images/handles.png', + 'images/extensions.png', + 'images/numerableicon.png', + 'images/numerableicon2.png', + 'images/bloatpad-osx.png', + 'images/bloatpad-gnome.png', + 'images/bloatpad-xfce.png', + 'images/down-center.png', + 'images/down-end.png', + 'images/down-start.png', + 'images/left-center.png', + 'images/left-end.png', + 'images/left-start.png', + 'images/right-center.png', + 'images/right-end.png', + 'images/right-start.png', + 'images/up-center.png', + 'images/up-end.png', + 'images/up-start.png', + 'images/list-box.png', + 'images/getting-started-app1.png', + 'images/getting-started-app2.png', + 'images/getting-started-app3.png', + 'images/getting-started-app4.png', + 'images/getting-started-app6.png', + 'images/getting-started-app7.png', + 'images/getting-started-app8.png', + 'images/getting-started-app9.png', + 'images/getting-started-app10.png', + 'images/exampleapp.png', + 'images/flow-box.png', + 'images/inspector.png', + 'images/gedit-shortcuts.png', + 'images/clocks-shortcuts.png', + 'images/builder-shortcuts.png', +] + +content_files = [ + 'broadway.xml', + 'broadwayd.xml', + 'building.sgml', + 'compiling.sgml', + 'css-overview.xml', + 'css-properties.xml', + 'drawing-model.xml', + 'getting_started.xml', + 'glossary.xml', + 'gtk3-demo-application.xml', + 'gtk3-demo.xml', + 'gtk3-icon-browser.xml', + 'gtk3-widget-factory.xml', + 'gtk-builder-tool.xml', + 'gtk-encode-symbolic-svg.xml', + 'gtk-launch.xml', + 'gtk-query-immodules-3.0.xml', + 'gtk-query-settings.xml', + 'gtk-update-icon-cache.xml', + 'input-handling.xml', + 'migrating-2to3.xml', + 'migrating-3xtoy.xml', + 'migrating-checklist.sgml', + 'migrating-GtkGrid.xml', + 'migrating-GtkStyleContext.xml', + 'migrating-smclient-GtkApplication.xml', + 'migrating-unique-GtkApplication.xml', + 'mir.xml', + 'osx.sgml', + 'overview.xml', + 'question_index.sgml', + 'resources.sgml', + 'running.sgml', + 'text_widget.sgml', + 'tree_widget.sgml', + 'visual_index.xml', + 'wayland.xml', + 'windows.sgml', + 'x11.sgml', +] + +expand_content_files = [ + 'compiling.sgml', + 'drawing-model.xml', + 'getting_started.xml', + 'glossary.xml', + 'input-handling.xml', + 'migrating-2to3.xml', + 'migrating-3xtoy.xml', + 'migrating-checklist.sgml', + 'migrating-GtkGrid.xml', + 'migrating-GtkStyleContext.xml', + 'migrating-smclient-GtkApplication.xml', + 'migrating-unique-GtkApplication.xml', + 'question_index.sgml', + 'text_widget.sgml', + 'tree_widget.sgml', +] + +configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + +types_conf = configuration_data() +if os_win32 + types_conf.set('DISABLE_ON_W32', '%') +else + types_conf.set('DISABLE_ON_W32', '') +endif + +if os_darwin + types_conf.set('DISABLE_ON_QUARTZ', '%') +else + types_conf.set('DISABLE_ON_QUARTZ', '') +endif + +gnome.gtkdoc('gtk3', + mode: 'none', + main_xml: 'gtk-docs.sgml', + src_dir: [ + gtkinc, + ], + dependencies: libgtk_dep, + gobject_typesfile: configure_file( + input: 'gtk3.types.in', + output: 'gtk3.types', + configuration: types_conf, + ), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + '--ignore-headers=' + ' '.join(private_headers), + ], + mkdb_args: [ + '--default-includes=gtk/gtk.h', + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=@0@'.format(cairo_docpath), + '--extra-dir=@0@'.format(gdkpixbuf_docpath), + '--extra-dir=../gdk', + ], + content_files: content_files, + expand_content_files: expand_content_files, + html_assets: images, + install: true) + +xsltproc = find_program('xsltproc', required: false) +if get_option('man-pages') and not xsltproc.found() + error('No xsltproc found, but man pages were explicitly enabled') +endif + +if get_option('man-pages') and xsltproc.found() + xlstproc_flags = [ + '--nonet', + '--stringparam', 'man.output.quietly', '1', + '--stringparam', 'funcsynopsis.style', 'ansi', + '--stringparam', 'man.th.extra1.suppress', '1', + '--stringparam', 'man.authors.section.enabled', '0', + '--stringparam', 'man.copyright.section.enabled', '0', + ] + + man_files = [ + [ 'gtk-query-immodules-3.0', '1', ], + [ 'gtk-update-icon-cache', '1', ], + [ 'gtk-encode-symbolic-svg', '1', ], + [ 'gtk-launch', '1', ], + [ 'gtk3-demo', '1', ], + [ 'gtk3-demo-application', '1', ], + [ 'gtk3-widget-factory', '1', ], + [ 'gtk3-icon-browser', '1', ], + [ 'broadwayd', '1', ], + [ 'gtk-builder-tool', '1', ], + [ 'gtk-query-settings', '1', ], + ] + + foreach man: man_files + man_name = man.get(0) + man_section = man.get(1, '1') + custom_target('@0@.@1@'.format(man_name, man_section), + input: '@0@.xml'.format(man_name), + output: '@0@.@1@'.format(man_name, man_section), + command: [ + xsltproc, + xlstproc_flags, + '-o', '@OUTPUT@', + 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl', + '@INPUT@', + ], + install: true, + install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section))) + endforeach +endif diff --git a/docs/reference/libgail-util/meson.build b/docs/reference/libgail-util/meson.build new file mode 100644 index 0000000000..dea5ecc597 --- /dev/null +++ b/docs/reference/libgail-util/meson.build @@ -0,0 +1,19 @@ +configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + +gnome.gtkdoc('gail-libgail-util3', + mode: 'none', + main_xml: 'gail-libgail-util-docs.sgml', + src_dir: libgailutilinc, + dependencies: [libgtk_dep, libgailutil], + gobject_typesfile: join_paths(meson.current_source_dir(), 'gail-libgail-util3.types'), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=../gtk', + ], + install: true) diff --git a/docs/reference/meson.build b/docs/reference/meson.build new file mode 100644 index 0000000000..3edf5f7d6d --- /dev/null +++ b/docs/reference/meson.build @@ -0,0 +1,20 @@ +glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') +glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') + +cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix') +cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo') + +gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix') +gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf') + +docpath = join_paths(gtk_datadir, 'gtk-doc', 'html') + +version_conf = configuration_data() +version_conf.set('GTK_VERSION', meson.project_version()) + +src_dir_conf = configuration_data() +src_dir_conf.set('SRC_DIR', meson.source_root()) + +subdir('gdk') +subdir('gtk') +subdir('libgail-util') diff --git a/docs/tools/meson.build b/docs/tools/meson.build new file mode 100644 index 0000000000..05621ee7ed --- /dev/null +++ b/docs/tools/meson.build @@ -0,0 +1,12 @@ +if x11_enabled + doc_shooter_sources = [ + 'shadow.c', + 'shooter.c', + 'widgets.c', + '../../tests/gtkgears.c', + ] + + doc_shooter = executable('doc-shooter', doc_shooter_sources, + include_directories: [ confinc, gdkinc, gtkinc, testinc, ], + dependencies: libgtk_dep) +endif diff --git a/meson.build b/meson.build index 9693318a9f..1d370e127b 100644 --- a/meson.build +++ b/meson.build @@ -294,6 +294,7 @@ endif confinc = include_directories('.') gdkinc = include_directories('gdk') gtkinc = include_directories('gtk') +libgailutilinc = include_directories('libgail-util') testinc = include_directories('tests') # Dependencies @@ -832,13 +833,12 @@ if os_unix install_dir: pkg_install_dir) endif -# TODO subdir('po') subdir('po-properties') -#if get_option('documentation') -# subdir('docs/tools') -# subdir('docs/reference') -#endif +if get_option('documentation') + subdir('docs/tools') + subdir('docs/reference') +endif # Keep this in sync with post-install.py expected arguments meson.add_install_script('build-aux/meson/post-install.py', From dbf7e1d23b66e5c7d91e6be28ce220146402546d Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 20:37:29 +0100 Subject: [PATCH 50/89] meson: widget-factory: install icons --- demos/widget-factory/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build index 184a8abbb4..9ce9cc2213 100644 --- a/demos/widget-factory/meson.build +++ b/demos/widget-factory/meson.build @@ -9,6 +9,13 @@ widgetfactory_resources = gnome.compile_resources( source_dir: '.' ) +foreach s: [ '16', '22', '24', '32', '48', '256'] + icon_destdir = join_paths(gtk_datadir, 'icons', 'hicolor', '@0@x@0@'.format(s), 'apps') + icons = [join_paths('data', '@0@x@0@'.format(s), 'gtk3-widget-factory.png'), + join_paths('data', '@0@x@0@'.format(s), 'gtk3-widget-factory-symbolic.symbolic.png')] + install_data(icons, install_dir: icon_destdir) +endforeach + widget_factory = executable( 'gtk3-widget-factory', widgetfactory_sources, From c9d4f53cfcc68e6adf1ddc6dca5df4dd06f16932 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 21:11:42 +0100 Subject: [PATCH 51/89] meson: install gtkbuilder.rng/its/loc files --- gtk/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/meson.build b/gtk/meson.build index bc9ea4b865..cb08e34506 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -993,6 +993,13 @@ install_data(['gtk-keys.css.emacs'], install_dir: join_paths(get_option('datadir'), 'themes/Emacs/gtk-3.0'), rename: ['gtk-keys.css']) +# Data to install +install_data('gtkbuilder.rng', + install_dir: join_paths(gtk_datadir, 'gtk-3.0')) + +install_data('gtkbuilder.loc', 'gtkbuilder.its', + install_dir: join_paths(gtk_datadir, 'gettext/its')) + ####### Utils ###### gtk_query_settings = executable( 'gtk-query-settings', From 1bbd24451727b5d6dedb6d6e939f8532e8504fae Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 21:31:11 +0100 Subject: [PATCH 52/89] meson: install desktop/gschema files for demos --- demos/gtk-demo/meson.build | 7 +++++++ demos/icon-browser/meson.build | 3 +++ demos/widget-factory/meson.build | 3 +++ 3 files changed, 13 insertions(+) diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build index 1f8e348f6a..5e30941cfc 100644 --- a/demos/gtk-demo/meson.build +++ b/demos/gtk-demo/meson.build @@ -134,3 +134,10 @@ foreach s: [ '16', '22', '24', '32', '48', '256', '512'] join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo-symbolic.symbolic.png')] install_data(icons, install_dir: icon_destdir) endforeach + +# desktop file +install_data('gtk3-demo.desktop', install_dir: gtk_applicationsdir) + +# GSettings +install_data('org.gtk.Demo.gschema.xml', install_dir: gtk_schemasdir) +gnome.compile_schemas(depend_files: files(['org.gtk.Demo.gschema.xml'])) diff --git a/demos/icon-browser/meson.build b/demos/icon-browser/meson.build index 8bd7e9e5bb..f241a5a7c4 100644 --- a/demos/icon-browser/meson.build +++ b/demos/icon-browser/meson.build @@ -19,3 +19,6 @@ iconbrowser = executable( include_directories : confinc, install: true ) + +# desktop file +install_data('gtk3-icon-browser.desktop', install_dir: gtk_applicationsdir) diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build index 9ce9cc2213..2a1b980fa8 100644 --- a/demos/widget-factory/meson.build +++ b/demos/widget-factory/meson.build @@ -24,3 +24,6 @@ widget_factory = executable( include_directories : confinc, install: true ) + +# desktop file +install_data('gtk3-widget-factory.desktop', install_dir: gtk_applicationsdir) From 331a92d559ce130efd4263cbb401073dba98a004 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 21:45:14 +0100 Subject: [PATCH 53/89] meson: gtk gir: depend on xlib and include gtkx.h if X11 is enabled To match what the autotools build does. --- gtk/meson.build | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gtk/meson.build b/gtk/meson.build index cb08e34506..cfe2a5d399 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -955,6 +955,14 @@ if build_gir gtkversion, ] + gtk_gir_includes = [gdk_gir[0], 'Atk-1.0'] + gtk_gir_extra_args = gir_args + ['-DGTK_COMPILATION', + '--c-include=gtk/gtk-a11y.h'] + if x11_enabled + gtk_gir_includes += ['xlib-2.0'] + gtk_gir_extra_args += ['--c-include=gtk/gtkx.h'] + endif + gtk_gir = gnome.generate_gir(libgtk, sources: gtk_introspection_sources, namespace: 'Gtk', @@ -962,14 +970,11 @@ if build_gir identifier_prefix: 'Gtk', symbol_prefix: 'gtk', export_packages: 'gtk+-3.0', - includes: [ gdk_gir[0], 'Atk-1.0', ], + includes: gtk_gir_includes, header: 'gtk/gtk.h', install: true, dependencies: gdk_gir_dep, - extra_args: gir_args + [ - '-DGTK_COMPILATION', - '--c-include=gtk/gtk-a11y.h', - ]) + extra_args: gtk_gir_extra_args) gtk_dep_sources += gtk_gir endif From 490cf8dff69874bc0eb9ff5adeb7ec8f252429fb Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 29 Mar 2019 22:45:14 +0100 Subject: [PATCH 54/89] meson: make the gtk/gdk .pc files match autotools on Linux Try to include the same things and in a similar order so differences are easier to catch. This also adds the backend specific .pc files for gdk like gdk-x11-3.0.pc --- meson.build | 57 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 1d370e127b..df28072a42 100644 --- a/meson.build +++ b/meson.build @@ -714,8 +714,10 @@ if os_win32 endif endif +have_gio_unix = false if os_unix - cdata.set('HAVE_GIO_UNIX', giounix_dep.found()) + have_gio_unix = giounix_dep.found() + cdata.set('HAVE_GIO_UNIX', have_gio_unix) endif cloudproviders_enabled = get_option('cloudproviders') @@ -779,19 +781,36 @@ elif cc.get_id() == 'msvc' and cairogobj_dep.found() endif pkgconf.set('GDK_PACKAGES', gdk_packages) -pkgconf.set('GTK_PACKAGES', - ' '.join([ 'atk', atk_req, - 'gio-2.0', glib_req ])) + +if have_gio_unix + gio_packages = ['gio-unix-2.0', glib_req] +else + gio_packages = ['gio-2.0', glib_req] +endif + +pkgconf.set('GDK_PRIVATE_PACKAGES', + ' '.join(gio_packages + x11_pkgs + wayland_pkgs + cairo_backends + + ['epoxy', epoxy_req, 'fribidi', fribidi_req])) + +gtk_packages = ' '.join([ + atk_dep.name(), atk_req, + cairo_dep.name(), cairo_req, + cairogobj_dep.name(), cairo_req, + pixbuf_dep.name(), gdk_pixbuf_req, + 'gio-2.0', glib_req, +]) +pkgconf.set('GTK_PACKAGES', gtk_packages) # Requires.private pc_gdk_extra_libs += cairo_libs -gio_pkgname = os_unix ? 'gio-unix-2.0' : 'gio-2.0' -pkgconf.set('GDK_PRIVATE_PACKAGES', - ' '.join([ gio_pkgname, glib_req, - 'epoxy', epoxy_req ] + x11_pkgs + wayland_pkgs + cairo_backends)) -pangoft2_pkgs = (wayland_enabled or x11_enabled) ? ['pangoft2'] : [] -pkgconf.set('GTK_PRIVATE_PACKAGES', ' '.join(atk_pkgs + pangoft2_pkgs)) +gtk_private_packages = atk_pkgs + wayland_pkgs + ['epoxy', epoxy_req, 'fribidi', fribidi_req] +if wayland_enabled or x11_enabled + gtk_private_packages += ['pangoft2'] +endif +gtk_private_packages += gio_packages + +pkgconf.set('GTK_PRIVATE_PACKAGES', ' '.join(gtk_private_packages)) pkgconf.set('GDK_EXTRA_LIBS', ' '.join(pc_gdk_extra_libs)) pkgconf.set('GSK_EXTRA_LIBS', '') @@ -803,23 +822,27 @@ pkgconf.set('GTK_EXTRA_CFLAGS', '') pkg_install_dir = join_paths(get_option('libdir'), 'pkgconfig') -pkgs = [ 'gtk+-3.0.pc' ] +gtk_pcs = ['gtk+-3.0.pc'] +gdk_pcs = ['gdk-3.0.pc'] pkg_targets = '' foreach backend: [ 'broadway', 'quartz', 'wayland', 'win32', 'x11', ] if get_variable('@0@_enabled'.format(backend)) - pkgs += ['gtk+-@0@-3.0.pc'.format(backend)] + gtk_pcs += ['gtk+-@0@-3.0.pc'.format(backend)] + gdk_pcs += ['gdk-@0@-3.0.pc'.format(backend)] pkg_targets += ' ' + backend endif endforeach pkgconf.set('GDK_BACKENDS', pkg_targets.strip()) -configure_file(input: 'gdk-3.0.pc.in', - output: 'gdk-3.0.pc', - configuration: pkgconf, - install_dir: pkg_install_dir) +foreach pkg: gdk_pcs + configure_file(input: 'gdk-3.0.pc.in', + output: pkg, + configuration: pkgconf, + install_dir: pkg_install_dir) +endforeach -foreach pkg: pkgs +foreach pkg: gtk_pcs configure_file(input: 'gtk+-3.0.pc.in', output: pkg, configuration: pkgconf, From a33bf3da56dea830b4ba3a82a364d1b51de49a87 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 08:46:33 +0100 Subject: [PATCH 55/89] meson: Install gail-3.0.pc and gtk-3.0.m4 --- meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meson.build b/meson.build index df28072a42..03bcf50588 100644 --- a/meson.build +++ b/meson.build @@ -835,6 +835,11 @@ foreach backend: [ 'broadway', 'quartz', 'wayland', 'win32', 'x11', ] endforeach pkgconf.set('GDK_BACKENDS', pkg_targets.strip()) +configure_file(input: 'gail-3.0.pc.in', + output: 'gail-3.0.pc', + configuration: pkgconf, + install_dir: pkg_install_dir) + foreach pkg: gdk_pcs configure_file(input: 'gdk-3.0.pc.in', output: pkg, @@ -863,6 +868,8 @@ if get_option('documentation') subdir('docs/reference') endif +install_data('m4macros/gtk-3.0.m4', install_dir: join_paths(get_option('datadir'), 'aclocal')) + # Keep this in sync with post-install.py expected arguments meson.add_install_script('build-aux/meson/post-install.py', gtk_api_version, From 59055fd9f7d7434d77f7af9f7de1bed99711b837 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 08:48:22 +0100 Subject: [PATCH 56/89] meson: set interface age; pass soversion to libgdk as well --- gdk/meson.build | 1 + meson.build | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/meson.build b/gdk/meson.build index d9830de992..fd43415cbd 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -279,6 +279,7 @@ if cc.get_id() == 'msvc' endif libgdk = shared_library('gdk-3', + soversion: gtk_soversion, sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig], dependencies: gdk_deps, include_directories: [confinc, gdkx11_inc, wlinc], diff --git a/meson.build b/meson.build index 03bcf50588..2fb5f5513a 100644 --- a/meson.build +++ b/meson.build @@ -51,7 +51,7 @@ gtk_version = meson.project_version() gtk_major_version = gtk_version.split('.')[0].to_int() gtk_minor_version = gtk_version.split('.')[1].to_int() gtk_micro_version = gtk_version.split('.')[2].to_int() -gtk_interface_age = 0 +gtk_interface_age = 3 add_project_arguments('-DGTK_VERSION="@0@"'.format(meson.project_version()), language: 'c') add_project_arguments('-D_GNU_SOURCE', language: 'c') From b1bc86e905b9a4ccab29cf6f72631a9ddb1a7c2e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 08:49:11 +0100 Subject: [PATCH 57/89] meson: mkenums: only write basenames in the comments The autotools build uses relative filenames here while with meson we get absolute paths. Switch to basename so we get the same result for both and don't break reproducible builds with absolute paths in public headers. --- gdk/gdkenumtypes.h.template | 2 +- gtk/gtktypebuiltins.h.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdk/gdkenumtypes.h.template b/gdk/gdkenumtypes.h.template index 0bc4a71033..d6f62480bc 100644 --- a/gdk/gdkenumtypes.h.template +++ b/gdk/gdkenumtypes.h.template @@ -14,7 +14,7 @@ G_BEGIN_DECLS /*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ +/* enumerations from "@basename@" */ /*** END file-production ***/ /*** BEGIN value-header ***/ diff --git a/gtk/gtktypebuiltins.h.template b/gtk/gtktypebuiltins.h.template index 6a2c32013c..3dc9f834bf 100644 --- a/gtk/gtktypebuiltins.h.template +++ b/gtk/gtktypebuiltins.h.template @@ -14,7 +14,7 @@ G_BEGIN_DECLS /*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ +/* enumerations from "@basename@" */ /*** END file-production ***/ /*** BEGIN value-header ***/ From 310dc4b6c41863386a5d20981a515b2f084a54b1 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 09:45:34 +0100 Subject: [PATCH 58/89] meson: cloudproviders fixes Set min cloudproviders version. Add libcloudproviders to gdk Requires.private. CI: build/test with cloudproviders --- .gitlab-ci/Dockerfile | 1 + .gitlab-ci/test-docker-autotools.sh | 2 +- .gitlab-ci/test-docker-meson.sh | 7 ++++++- meson.build | 7 +++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile index 6258a39602..d9fa23d31d 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/Dockerfile @@ -25,6 +25,7 @@ RUN dnf -y install \ hicolor-icon-theme \ itstool \ json-glib-devel \ + libcloudproviders-devel \ libepoxy-devel \ libmount-devel \ librsvg2 \ diff --git a/.gitlab-ci/test-docker-autotools.sh b/.gitlab-ci/test-docker-autotools.sh index 523582e119..ca84162309 100755 --- a/.gitlab-ci/test-docker-autotools.sh +++ b/.gitlab-ci/test-docker-autotools.sh @@ -6,5 +6,5 @@ mkdir -p _ccache export CCACHE_BASEDIR="$(pwd)" export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" -./autogen.sh +./autogen.sh --enable-cloudproviders make -j8 diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh index b24c866c08..e9168e0426 100755 --- a/.gitlab-ci/test-docker-meson.sh +++ b/.gitlab-ci/test-docker-meson.sh @@ -9,7 +9,12 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" export PATH="${HOME}/.local/bin:${PATH}" python3 -m pip install --user meson==0.49.2 -meson -Ddocumentation=true -Dman-pages=true _build +meson \ + -Dcloudproviders=true \ + -Ddocumentation=true \ + -Dman-pages=true \ + _build + cd _build ninja diff --git a/meson.build b/meson.build index 2fb5f5513a..4535c82bdd 100644 --- a/meson.build +++ b/meson.build @@ -721,9 +721,11 @@ if os_unix endif cloudproviders_enabled = get_option('cloudproviders') +cloudproviders_packages = [] if cloudproviders_enabled - cloudproviders_dep = dependency('cloudproviders', required: true) + cloudproviders_dep = dependency('cloudproviders', version: cloudproviders_req, required: true) if cloudproviders_dep.found() + cloudproviders_packages += ['cloudproviders', cloudproviders_req] cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found()) else error('Cloudproviders support not found, but was explicitly requested.') @@ -790,7 +792,8 @@ endif pkgconf.set('GDK_PRIVATE_PACKAGES', ' '.join(gio_packages + x11_pkgs + wayland_pkgs + cairo_backends + - ['epoxy', epoxy_req, 'fribidi', fribidi_req])) + ['epoxy', epoxy_req] + cloudproviders_packages + + ['fribidi', fribidi_req])) gtk_packages = ' '.join([ atk_dep.name(), atk_req, From fb9e3e18303f3d5a5fd7cceaccf5c4441407524d Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 10:53:09 +0100 Subject: [PATCH 59/89] CI: autotools: test with srcdir!=buildir --- .gitlab-ci/test-docker-autotools.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/test-docker-autotools.sh b/.gitlab-ci/test-docker-autotools.sh index ca84162309..b0b06f6ff4 100755 --- a/.gitlab-ci/test-docker-autotools.sh +++ b/.gitlab-ci/test-docker-autotools.sh @@ -6,5 +6,7 @@ mkdir -p _ccache export CCACHE_BASEDIR="$(pwd)" export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" -./autogen.sh --enable-cloudproviders +mkdir _build +cd _build +../autogen.sh --enable-cloudproviders make -j8 From 1882ff9be3f74716c808af96b02775a685e8e0fe Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 12:37:08 +0100 Subject: [PATCH 60/89] CI: enable broadway and xinerama --- .gitlab-ci/test-docker-autotools.sh | 5 ++++- .gitlab-ci/test-docker-meson.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/test-docker-autotools.sh b/.gitlab-ci/test-docker-autotools.sh index b0b06f6ff4..73d7e8a6f9 100755 --- a/.gitlab-ci/test-docker-autotools.sh +++ b/.gitlab-ci/test-docker-autotools.sh @@ -8,5 +8,8 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" mkdir _build cd _build -../autogen.sh --enable-cloudproviders +../autogen.sh \ + --enable-cloudproviders \ + --enable-broadway-backend \ + --enable-xinerama make -j8 diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh index e9168e0426..2679417905 100755 --- a/.gitlab-ci/test-docker-meson.sh +++ b/.gitlab-ci/test-docker-meson.sh @@ -13,6 +13,8 @@ meson \ -Dcloudproviders=true \ -Ddocumentation=true \ -Dman-pages=true \ + -Dbroadway-backend=true \ + -Dxinerama=yes \ _build cd _build From fd758bb2e9b167a2fb3202cb53d2350d3d11fcd2 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 13:33:30 +0100 Subject: [PATCH 61/89] meson: install unix-print headers --- gtk/meson.build | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gtk/meson.build b/gtk/meson.build index cfe2a5d399..a66144b5c5 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -630,6 +630,18 @@ gtk_semi_private_headers = files('gtktextlayout.h') gtk_public_headers = gtk_gir_public_headers + gtk_nogir_public_headers install_headers(gtk_public_headers + gtk_semi_private_headers, subdir: 'gtk-3.0/gtk') +if os_unix + gtk_unix_print_headers = [ + 'gtkpagesetupunixdialog.h', + 'gtkprintunixdialog.h', + 'gtkprinter.h', + 'gtkprintjob.h', + 'gtkunixprint-autocleanups.h', + 'gtkunixprint.h', + ] + install_headers(gtk_unix_print_headers, subdir: 'gtk-3.0/unix-print/gtk') +endif + gtk_unix_sources = files( 'gtkcustompaperunixdialog.c', 'gtkpagesetupunixdialog.c', From cb89ad18a2f2dabc92d64a88602859cb15907a85 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 13:34:24 +0100 Subject: [PATCH 62/89] meson: immodules: unset the name_prefix to match autotools --- modules/input/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/input/meson.build b/modules/input/meson.build index 31b2657beb..3d89389ef6 100644 --- a/modules/input/meson.build +++ b/modules/input/meson.build @@ -27,6 +27,7 @@ foreach l: immodules dependencies: [ libgtk_dep ], install_dir: '@0@/gtk-@1@/@2@/immodules/'.format(gtk_libdir, gtk_api_version, gtk_binary_version), include_directories: [confinc, gtkinc], - install : true) + install : true, + name_prefix: '') endif endforeach From e41ec3c62e2211e83d5efd2b1538bc79feb863ed Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 15:03:16 +0100 Subject: [PATCH 63/89] meson: install public broadway headers --- gdk/broadway/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build index 27dc52a872..6702280863 100644 --- a/gdk/broadway/meson.build +++ b/gdk/broadway/meson.build @@ -25,9 +25,8 @@ gdk_broadway_public_headers = files( 'gdkbroadwayvisual.h', ) -# Broadway backend headers aren't installed it seems -#install_headers(gdk_broadway_public_headers, subdir: 'gtk-4.0/gdk/broadway/') -#install_headers('gdkbroadway.h', subdir: 'gtk-4.0/gdk/') +install_headers(gdk_broadway_public_headers, subdir: 'gtk-3.0/gdk/broadway/') +install_headers('gdkbroadway.h', subdir: 'gtk-3.0/gdk/') gdk_broadway_deps = [shmlib] From 26d32f3bd0206a8da677a812353daf88f10ecc92 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 16:21:21 +0100 Subject: [PATCH 64/89] meson: build all input modules; fix static build on Linux --- gtk/meson.build | 21 ++++++++- meson.build | 93 ++++++++++++++++++++++----------------- modules/input/meson.build | 17 +------ 3 files changed, 74 insertions(+), 57 deletions(-) diff --git a/gtk/meson.build b/gtk/meson.build index a66144b5c5..06ba5cc9e3 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -940,11 +940,30 @@ if cc.has_header('langinfo.h') endforeach endif +# Static immodules +gtk_included_im_deps = [] +foreach l: immodules + name = l[0] + sources = l[1] + cond = l.get(2, true) + cflags = l.get(3, []) + + if cond and (builtin_immodules.contains(name) or builtin_all_immodules) + mod = static_library('staticimmodule-@0@'.format(name), + sources, + dependencies: gtk_deps + [libgdk_dep] , + c_args: gtk_cargs + common_cflags + ['-DINCLUDE_IM_@0@'.format(name)] + cflags, + include_directories: [confinc, gdkinc, gtkinc]) + + gtk_included_im_deps += declare_dependency(link_with: mod) + endif +endforeach + # Library libgtk = shared_library('gtk-3', soversion: gtk_soversion, sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h], - c_args: gtk_cargs + common_cflags + gtk_included_im_cflags, + c_args: gtk_cargs + common_cflags, include_directories: [confinc, gdkinc, gtkinc], dependencies: gtk_deps + [libgdk_dep] + gtk_included_im_deps, link_with: libgdk, diff --git a/meson.build b/meson.build index 4535c82bdd..7dbb728ca5 100644 --- a/meson.build +++ b/meson.build @@ -634,56 +634,67 @@ elif builtin_immodules.contains('backend') builtin_immodules += backend_immodules endif +proto_sources = [ + 'text-input-unstable-v3', + 'gtk-text-input', +] +proto_sources_outputs = [] + +foreach proto_name: proto_sources + if wayland_enabled + + wayland_scanner = find_program('wayland-scanner') + input_path = join_paths('modules', 'input', proto_name + '.xml') + sources = [] + sources += custom_target('@0@ client header'.format(proto_name), + input: input_path, + output: '@0@-client-protocol.h'.format(proto_name), + command: [ + wayland_scanner, + 'client-header', + '@INPUT@', '@OUTPUT@', + ]) + + sources += custom_target('@0@ source'.format(proto_name), + input: input_path, + output: '@0@-protocol.c'.format(proto_name), + command: [ + wayland_scanner, + 'private-code', + '@INPUT@', '@OUTPUT@', + ]) + proto_sources_outputs += [sources] + else + proto_sources_outputs += [[]] + endif +endforeach + # Unfortunately it seems that we need to include the input module sources here, and build # them in $(buildrootdir) if we are to build them included in GTK... # Make sure the source listings are the same as in modules/input/Makefile.am immodule_srcdir = 'modules/input/' immodules = [ - [ 'am-et', [ immodule_srcdir + 'imam-et.c' ] ], - [ 'cedilla', [ immodule_srcdir + 'imcedilla.c' ] ], - [ 'cyrillic-translit', [ immodule_srcdir + 'imcyrillic-translit.c' ] ], - [ 'inuktitut', [ immodule_srcdir + 'iminuktitut.c' ] ], - [ 'ipa', [ immodule_srcdir + 'imipa.c' ] ], - [ 'multipress', [ immodule_srcdir + 'gtkimcontextmultipress.c', immodule_srcdir + 'immultipress.c' ], true, + [ 'am-et', files([ immodule_srcdir + 'imam-et.c' ]) ], + [ 'cedilla', files([ immodule_srcdir + 'imcedilla.c' ]) ], + [ 'cyrillic-translit', files([ immodule_srcdir + 'imcyrillic-translit.c' ]) ], + [ 'inuktitut', files([ immodule_srcdir + 'iminuktitut.c' ]) ], + [ 'ipa', files([ immodule_srcdir + 'imipa.c' ]) ], + [ 'multipress', files( [ immodule_srcdir + 'gtkimcontextmultipress.c', immodule_srcdir + 'immultipress.c' ]), true, ['-DMULTIPRESS_LOCALEDIR="@0@"'.format(gtk_mplocaledir), '-DMULTIPRESS_CONFDIR="@0@/gtk-3.0"'.format(gtk_sysconfdir)] ], - [ 'thai', [ immodule_srcdir + 'thai-charprop.c', immodule_srcdir + 'gtkimcontextthai.c', immodule_srcdir + 'imthai.c' ] ], - [ 'ti-er', [ immodule_srcdir + 'imti-er.c' ] ], - [ 'ti-et', [ immodule_srcdir + 'imti-et.c' ] ], - [ 'viqr', [ immodule_srcdir + 'imviqr.c' ] ], - [ 'broadway', [ immodule_srcdir + 'imbroadway.c' ], broadway_enabled ], - [ 'ime', [ immodule_srcdir + 'gtkimcontextime.c', immodule_srcdir + 'imime.c' ], win32_enabled ], - [ 'quartz', [ immodule_srcdir + 'imquartz.c' ], quartz_enabled, '-xobjective-c' ], - # FIXME: needs to be ported from gtk4 - # [ 'wayland', [ immodule_srcdir + 'imwayland.c', immodule_srcdir + 'text-input-unstable-v3-protocol.c' ], wayland_enabled ], - # [ 'waylandgtk', [ immodule_srcdir + 'imwaylandgtk.c', immodule_srcdir + 'gtk-text-input-protocol.c' ], wayland_enabled ], - [ 'xim', [ immodule_srcdir + 'gtkimcontextxim.c', immodule_srcdir + 'imxim.c' ], x11_enabled ], + [ 'thai', files([ immodule_srcdir + 'thai-charprop.c', immodule_srcdir + 'gtkimcontextthai.c', immodule_srcdir + 'imthai.c' ]) ], + [ 'ti-er', files([ immodule_srcdir + 'imti-er.c' ]) ], + [ 'ti-et', files([ immodule_srcdir + 'imti-et.c' ]) ], + [ 'viqr', files([ immodule_srcdir + 'imviqr.c' ]) ], + [ 'broadway', files([ immodule_srcdir + 'imbroadway.c' ]), broadway_enabled ], + [ 'ime', files([ immodule_srcdir + 'gtkimcontextime.c', immodule_srcdir + 'imime.c' ]), win32_enabled ], + [ 'quartz', files([ immodule_srcdir + 'imquartz.c' ]), quartz_enabled, '-xobjective-c' ], + [ 'wayland', files([ immodule_srcdir + 'imwayland.c' ]) + proto_sources_outputs[0], wayland_enabled ], + [ 'waylandgtk', files([ immodule_srcdir + 'imwaylandgtk.c']) + proto_sources_outputs[1], wayland_enabled ], + [ 'xim', files([ immodule_srcdir + 'gtkimcontextxim.c', immodule_srcdir + 'imxim.c' ]), x11_enabled ], ] -gtk_included_im_cflags = [] -gtk_included_im_deps = [] -immodules_cflags = [ '-DGTK_COMPILATION' ] -included_immodules_cflags = immodules_cflags - -foreach l: immodules - name = l[0] - sources = l[1] - cond = l.get(2, true) - cflags = l.get(3, []) - - if cond and (builtin_immodules.contains(name) or builtin_all_immodules) - cflag_for_included_immodule = ['-DINCLUDE_IM_@0@'.format(name)] - gtk_included_im_cflags += cflag_for_included_immodule - included_immodules_cflags += immodules_cflags + cflag_for_included_immodule + cflags - - mod = static_library('staticimmodule-@0@'.format(name), - sources, - c_args: common_cflags + included_immodules_cflags, - include_directories: [confinc, gtkinc]) - - gtk_included_im_deps += declare_dependency(link_with: mod) - endif -endforeach +install_data(join_paths(immodule_srcdir, 'im-multipress.conf'), install_dir: join_paths(gtk_sysconfdir, 'gtk-3.0')) # Check for bind_textdomain_codeset, including -lintl if GLib brings it in by # doing the same check as glib. We can't check that by linking to glib because diff --git a/modules/input/meson.build b/modules/input/meson.build index 3d89389ef6..0e8ea9ec2c 100644 --- a/modules/input/meson.build +++ b/modules/input/meson.build @@ -3,27 +3,14 @@ foreach l: immodules name = l[0] - sources = l[1] + immod_sources = l[1] cond = l.get(2, true) cflags = l.get(3, []) - immod_sources = [] - - # Only get the filename without modules/input - foreach s: sources - immod_sources += s.split('/')[2] - endforeach if cond and not (builtin_immodules.contains(name) or builtin_all_immodules) - immodules_cflags += cflags - - if name == 'multipress' - install_data('im-multipress.conf', - install_dir: join_paths(gtk_sysconfdir, 'gtk-3.0')) - endif - shared_module('im-@0@'.format(name), immod_sources, - c_args: common_cflags + immodules_cflags, + c_args: common_cflags + cflags, dependencies: [ libgtk_dep ], install_dir: '@0@/gtk-@1@/@2@/immodules/'.format(gtk_libdir, gtk_api_version, gtk_binary_version), include_directories: [confinc, gtkinc], From d52dad2042ce4934d09098161253d2f515a13986 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 30 Mar 2019 20:06:25 +0100 Subject: [PATCH 65/89] autotools: dist all meson related build files --- Makefile.am | 8 +++++++- demos/Makefile.am | 3 +++ demos/gtk-demo/Makefile.am | 4 +++- demos/gtk-demo/meson.build | 2 +- demos/icon-browser/Makefile.am | 3 ++- demos/widget-factory/Makefile.am | 3 ++- docs/reference/Makefile.am | 3 +++ docs/reference/gdk/Makefile.am | 4 +++- docs/reference/gtk/Makefile.am | 4 +++- docs/reference/libgail-util/Makefile.am | 4 +++- docs/tools/Makefile.am | 3 +++ examples/Makefile.am | 4 +++- examples/application1/Makefile.am | 3 +++ examples/application10/Makefile.am | 3 ++- examples/application2/Makefile.am | 3 ++- examples/application3/Makefile.am | 3 ++- examples/application4/Makefile.am | 3 ++- examples/application5/Makefile.am | 3 ++- examples/application6/Makefile.am | 3 ++- examples/application7/Makefile.am | 3 ++- examples/application8/Makefile.am | 3 ++- examples/application9/Makefile.am | 3 ++- examples/bp/Makefile.am | 4 +++- gdk/Makefile.am | 5 ++++- gdk/broadway/Makefile.am | 2 ++ gdk/quartz/Makefile.am | 2 ++ gdk/wayland/Makefile.am | 3 ++- gdk/win32/Makefile.am | 3 ++- gdk/x11/Makefile.am | 3 ++- gtk/Makefile.am | 11 ++++++++++- libgail-util/Makefile.am | 5 ++++- modules/Makefile.am | 3 +++ modules/input/Makefile.am | 6 +++++- tests/Makefile.am | 3 ++- tests/visuals/Makefile.am | 3 ++- testsuite/Makefile.am | 3 +++ testsuite/css/Makefile.am | 4 +++- testsuite/css/nodes/Makefile.am | 2 +- testsuite/css/parser/Makefile.am | 6 +++++- testsuite/css/style/Makefile.am | 1 + testsuite/gdk/Makefile.am | 3 +++ testsuite/gtk/Makefile.am | 1 + 42 files changed, 117 insertions(+), 31 deletions(-) diff --git a/Makefile.am b/Makefile.am index e53cb6a875..e1978fc3bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,13 @@ EXTRA_DIST += \ sanitize-la.sh \ po/README.translators \ po/po2tbl.sed.in \ - make-pot + make-pot \ + meson_options.txt \ + meson.build \ + po/meson.build \ + po-properties/meson.build \ + build-aux/meson/post-install.py \ + config.h.meson MAINTAINERCLEANFILES = \ $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ diff --git a/demos/Makefile.am b/demos/Makefile.am index 5c4873cc10..f780869ead 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -3,4 +3,7 @@ include $(top_srcdir)/Makefile.decl SUBDIRS = gtk-demo widget-factory icon-browser +EXTRA_DIST = \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am index c8529e5bf7..cbcd9cc93c 100644 --- a/demos/gtk-demo/Makefile.am +++ b/demos/gtk-demo/Makefile.am @@ -117,7 +117,9 @@ EXTRA_DIST += \ demo.gresource.xml \ $(resource_files) \ org.gtk.Demo.gschema.xml \ - demos.h.win32 + demos.h.win32 \ + meson.build \ + geninclude.py gsettings_SCHEMAS = \ org.gtk.Demo.gschema.xml diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build index 5e30941cfc..e2af42c8c4 100644 --- a/demos/gtk-demo/meson.build +++ b/demos/gtk-demo/meson.build @@ -128,7 +128,7 @@ gtk_settings_schemas = [ 'org.gtk.Settings.Debug.gschema.xml', ] -foreach s: [ '16', '22', '24', '32', '48', '256', '512'] +foreach s: [ '16', '22', '24', '32', '48', '256'] icon_destdir = join_paths(gtk_datadir, 'icons', 'hicolor', '@0@x@0@'.format(s), 'apps') icons = [join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo.png'), join_paths('data', '@0@x@0@'.format(s), 'gtk3-demo-symbolic.symbolic.png')] diff --git a/demos/icon-browser/Makefile.am b/demos/icon-browser/Makefile.am index 6de3fe7de5..d5f933bf2f 100644 --- a/demos/icon-browser/Makefile.am +++ b/demos/icon-browser/Makefile.am @@ -34,7 +34,8 @@ EXTRA_DIST = \ menus.ui \ iconbrowser.gresource.xml \ window.ui \ - icon.list + icon.list \ + meson.build # ------------------- MSVC Build Items ---------------- MSVCPROJS = gtk3-icon-browser diff --git a/demos/widget-factory/Makefile.am b/demos/widget-factory/Makefile.am index 62c156aa09..c33a6d0a95 100644 --- a/demos/widget-factory/Makefile.am +++ b/demos/widget-factory/Makefile.am @@ -66,6 +66,7 @@ EXTRA_DIST += \ help-overlay.ui \ widget-factory.gresource.xml \ data/source.svg \ - data/symbolic-source.svg + data/symbolic-source.svg \ + meson.build -include $(top_srcdir)/git.mk diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index a2f772e660..3a52c1e9a6 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -5,4 +5,7 @@ SUBDIRS = gdk gtk libgail-util GITIGNOREFILES = */*.1 +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/docs/reference/gdk/Makefile.am b/docs/reference/gdk/Makefile.am index d86a188784..77264cf210 100644 --- a/docs/reference/gdk/Makefile.am +++ b/docs/reference/gdk/Makefile.am @@ -198,7 +198,9 @@ endif include $(top_srcdir)/gtk-doc.make # Other files to distribute -EXTRA_DIST += version.xml.in +EXTRA_DIST += \ + version.xml.in \ + meson.build if ENABLE_GTK_DOC TESTS_ENVIRONMENT = cd $(srcdir) && \ diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am index abdea7fb59..df9296fcbe 100644 --- a/docs/reference/gtk/Makefile.am +++ b/docs/reference/gtk/Makefile.am @@ -543,7 +543,9 @@ endif MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) -EXTRA_DIST += $(man_MANS) +EXTRA_DIST += \ + $(man_MANS) \ + meson.build if ENABLE_GTK_DOC TESTS_ENVIRONMENT = cd $(srcdir) && \ diff --git a/docs/reference/libgail-util/Makefile.am b/docs/reference/libgail-util/Makefile.am index 263471d9b8..43f66a14e7 100644 --- a/docs/reference/libgail-util/Makefile.am +++ b/docs/reference/libgail-util/Makefile.am @@ -34,6 +34,8 @@ HTML_IMAGES = include $(top_srcdir)/gtk-doc.make # Other files to distribute -EXTRA_DIST += version.xml.in +EXTRA_DIST += \ + version.xml.in \ + meson.build -include $(top_srcdir)/git.mk diff --git a/docs/tools/Makefile.am b/docs/tools/Makefile.am index 6a6d70f496..bec43e3a55 100644 --- a/docs/tools/Makefile.am +++ b/docs/tools/Makefile.am @@ -20,6 +20,9 @@ LDADDS = \ $(GDK_DEP_LIBS) \ -lm +EXTRA_DIST += \ + meson.build + if USE_X11 noinst_PROGRAMS = \ doc-shooter diff --git a/examples/Makefile.am b/examples/Makefile.am index a455c03ac8..ed8f9a7ced 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -31,6 +31,8 @@ noinst_PROGRAMS = \ search-bar \ listbox-dnd -EXTRA_DIST = builder.ui +EXTRA_DIST = \ + builder.ui \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application1/Makefile.am b/examples/application1/Makefile.am index 114e204fa0..08bee3876d 100644 --- a/examples/application1/Makefile.am +++ b/examples/application1/Makefile.am @@ -17,4 +17,7 @@ exampleapp_SOURCES = \ exampleapp.c exampleapp.h \ exampleappwin.c exampleappwin.h +EXTRA_DIST = \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/examples/application10/Makefile.am b/examples/application10/Makefile.am index 5db103723e..c5bda45eba 100644 --- a/examples/application10/Makefile.am +++ b/examples/application10/Makefile.am @@ -41,7 +41,8 @@ EXTRA_DIST = \ prefs.ui \ gears-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application2/Makefile.am b/examples/application2/Makefile.am index 0ecba8a33f..8fc04789d8 100644 --- a/examples/application2/Makefile.am +++ b/examples/application2/Makefile.am @@ -26,6 +26,7 @@ resources.c: exampleapp.gresource.xml window.ui EXTRA_DIST = \ window.ui \ - exampleapp.gresource.xml + exampleapp.gresource.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application3/Makefile.am b/examples/application3/Makefile.am index 0ecba8a33f..8fc04789d8 100644 --- a/examples/application3/Makefile.am +++ b/examples/application3/Makefile.am @@ -26,6 +26,7 @@ resources.c: exampleapp.gresource.xml window.ui EXTRA_DIST = \ window.ui \ - exampleapp.gresource.xml + exampleapp.gresource.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application4/Makefile.am b/examples/application4/Makefile.am index c14a3cbcf1..7bc91ba1df 100644 --- a/examples/application4/Makefile.am +++ b/examples/application4/Makefile.am @@ -27,6 +27,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui EXTRA_DIST = \ window.ui \ app-menu.ui \ - exampleapp.gresource.xml + exampleapp.gresource.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/examples/application5/Makefile.am b/examples/application5/Makefile.am index 2b199f97d9..b6f34e7043 100644 --- a/examples/application5/Makefile.am +++ b/examples/application5/Makefile.am @@ -38,7 +38,8 @@ EXTRA_DIST = \ window.ui \ app-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application6/Makefile.am b/examples/application6/Makefile.am index b8cff5b8fe..9cf885ed10 100644 --- a/examples/application6/Makefile.am +++ b/examples/application6/Makefile.am @@ -40,7 +40,8 @@ EXTRA_DIST = \ app-menu.ui \ prefs.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application7/Makefile.am b/examples/application7/Makefile.am index b8cff5b8fe..9cf885ed10 100644 --- a/examples/application7/Makefile.am +++ b/examples/application7/Makefile.am @@ -40,7 +40,8 @@ EXTRA_DIST = \ app-menu.ui \ prefs.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application8/Makefile.am b/examples/application8/Makefile.am index 5db103723e..c5bda45eba 100644 --- a/examples/application8/Makefile.am +++ b/examples/application8/Makefile.am @@ -41,7 +41,8 @@ EXTRA_DIST = \ prefs.ui \ gears-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/application9/Makefile.am b/examples/application9/Makefile.am index 5db103723e..c5bda45eba 100644 --- a/examples/application9/Makefile.am +++ b/examples/application9/Makefile.am @@ -41,7 +41,8 @@ EXTRA_DIST = \ prefs.ui \ gears-menu.ui \ exampleapp.gresource.xml \ - org.gtk.exampleapp.gschema.xml + org.gtk.exampleapp.gschema.xml \ + meson.build CLEANFILES = \ gschemas.compiled diff --git a/examples/bp/Makefile.am b/examples/bp/Makefile.am index d521715eae..66b52b188a 100644 --- a/examples/bp/Makefile.am +++ b/examples/bp/Makefile.am @@ -27,6 +27,8 @@ bloatpad-gresources.c: $(resource_files) CLEANFILES = bloatpad-gresources.c -EXTRA_DIST = $(resource_files) +EXTRA_DIST = \ + $(resource_files) \ + meson.build -include $(top_srcdir)/git.mk diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 689ee52057..74b9d0bbf4 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -31,7 +31,10 @@ EXTRA_DIST += \ makefile.msc \ gdkenumtypes.c.template \ gdkenumtypes.h.template \ - gdkversionmacros.h.in + gdkversionmacros.h.in \ + meson.build \ + gen-gdk-gresources-xml.py \ + gdkconfig.h.meson GDK_CFLAGS_DEFINES = \ -DG_LOG_USE_STRUCTURED=1 \ diff --git a/gdk/broadway/Makefile.am b/gdk/broadway/Makefile.am index e04013f46f..ae33f4cef5 100644 --- a/gdk/broadway/Makefile.am +++ b/gdk/broadway/Makefile.am @@ -108,6 +108,8 @@ EXTRA_DIST += $(broadway_built_sources) BUILT_SOURCES = $(broadway_built_sources) +EXTRA_DIST += meson.build + # ------------------- MSVC Build Items ---------------- MSVCPROJS = gdk3-broadway broadwayd diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am index 9646f8687c..a7b12ad562 100644 --- a/gdk/quartz/Makefile.am +++ b/gdk/quartz/Makefile.am @@ -72,5 +72,7 @@ libgdkquartzinclude_HEADERS = \ gdkquartzvisual.h \ gdkquartzwindow.h +EXTRA_DIST += \ + meson.build -include $(top_srcdir)/git.mk diff --git a/gdk/wayland/Makefile.am b/gdk/wayland/Makefile.am index e3fb57f53d..956e5c92f5 100644 --- a/gdk/wayland/Makefile.am +++ b/gdk/wayland/Makefile.am @@ -107,6 +107,7 @@ endef EXTRA_DIST += \ protocol/gtk-primary-selection.xml \ protocol/gtk-shell.xml \ - protocol/server-decoration.xml + protocol/server-decoration.xml \ + meson.build -include $(top_srcdir)/git.mk diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am index e77ec652f2..2d7e259e4d 100644 --- a/gdk/win32/Makefile.am +++ b/gdk/win32/Makefile.am @@ -29,7 +29,8 @@ SUBDIRS=rc EXTRA_DIST += \ bdfcursor.c \ - makefile.msc + makefile.msc \ + meson.build libgdk_win32_la_SOURCES = \ gdkcursor-win32.c \ diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am index 6289f3ac79..32b1f24434 100644 --- a/gdk/x11/Makefile.am +++ b/gdk/x11/Makefile.am @@ -90,6 +90,7 @@ libgdkx11include_HEADERS = \ # We need to include all these C files here since the conditionals # don't seem to be correctly expanded for the dist files. EXTRA_DIST += \ - gdksettings.c + gdksettings.c \ + meson.build -include $(top_srcdir)/git.mk diff --git a/gtk/Makefile.am b/gtk/Makefile.am index e56ce9ee6c..29565bc8e3 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -1776,6 +1776,15 @@ EXTRA_DIST += \ gtktypebuiltins.c.template \ gtktypebuiltins.h.template \ gtkprivatetypebuiltins.c.template \ - gtkprivatetypebuiltins.h.template + gtkprivatetypebuiltins.h.template \ + meson.build \ + gen-gtk-gresources-xml.py \ + gentypefuncs.py \ + a11y/meson.build \ + deprecated/meson.build \ + inspector/meson.build \ + theme/Adwaita/meson.build \ + theme/HighContrast/meson.build + -include $(top_srcdir)/git.mk diff --git a/libgail-util/Makefile.am b/libgail-util/Makefile.am index 048fe33097..6e4141f802 100644 --- a/libgail-util/Makefile.am +++ b/libgail-util/Makefile.am @@ -1,6 +1,9 @@ include $(top_srcdir)/Makefile.decl -EXTRA_DIST += gailutil.def +EXTRA_DIST += \ + gailutil.def \ + meson.build + if OS_WIN32 export_symbols = -export-symbols $(srcdir)/gailutil.def gailutil.def: libgailutil-3.la diff --git a/modules/Makefile.am b/modules/Makefile.am index f8e7bb8797..b8dc2eea59 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -6,4 +6,7 @@ if OS_UNIX SUBDIRS += printbackends endif +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/modules/input/Makefile.am b/modules/input/Makefile.am index ce394632ee..631e580ca4 100644 --- a/modules/input/Makefile.am +++ b/modules/input/Makefile.am @@ -307,7 +307,11 @@ BUILT_SOURCES = $(protocol_built_sources) $(protocol_built_sources_gtk) EXTRA_DIST += $(protocol_built_sources) $(protocol_built_sources_gtk) endif -EXTRA_DIST += README.multipress +EXTRA_DIST += \ + README.multipress \ + meson.build \ + text-input-unstable-v3.xml \ + gtk-text-input.xml CLEANFILES = immodules.cache diff --git a/tests/Makefile.am b/tests/Makefile.am index 7c5ca99b57..ee1e8b5064 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -573,6 +573,7 @@ EXTRA_DIST += \ mydialog.ui \ mydialog2.ui \ popover.ui \ - selectionmode.ui + selectionmode.ui \ + meson.build -include $(top_srcdir)/git.mk diff --git a/tests/visuals/Makefile.am b/tests/visuals/Makefile.am index 8250de6df0..6ea2e4a67e 100644 --- a/tests/visuals/Makefile.am +++ b/tests/visuals/Makefile.am @@ -31,6 +31,7 @@ EXTRA_DIST = \ linked-buttons-vertical.ui \ osd-toolbars.ui \ primary-toolbar.ui \ - suggested-action-buttons.ui + suggested-action-buttons.ui \ + meson.build -include $(top_srcdir)/git.mk diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 418aa417ae..e5a0636094 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -2,5 +2,8 @@ include $(top_srcdir)/Makefile.decl SUBDIRS = gdk gtk a11y css reftests tools +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/testsuite/css/Makefile.am b/testsuite/css/Makefile.am index 091591a174..33c9473942 100644 --- a/testsuite/css/Makefile.am +++ b/testsuite/css/Makefile.am @@ -25,7 +25,9 @@ LDADD = \ TEST_PROGS += api test_in_files += api.test.in -EXTRA_DIST += $(test_in_files) +EXTRA_DIST += \ + $(test_in_files) \ + meson.build if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css diff --git a/testsuite/css/nodes/Makefile.am b/testsuite/css/nodes/Makefile.am index 339c47eda0..af93ee0e60 100644 --- a/testsuite/css/nodes/Makefile.am +++ b/testsuite/css/nodes/Makefile.am @@ -57,7 +57,7 @@ test_data = \ scale.ui scale.nodes \ $(NULL) -EXTRA_DIST += $(test_in_files) $(test_data) +EXTRA_DIST += $(test_in_files) $(test_data) meson.build if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css/nodes diff --git a/testsuite/css/parser/Makefile.am b/testsuite/css/parser/Makefile.am index bd7989117a..63cad9e1dc 100644 --- a/testsuite/css/parser/Makefile.am +++ b/testsuite/css/parser/Makefile.am @@ -474,6 +474,9 @@ test_data = \ EXTRA_DIST += $(test_in_files) $(test_data) +EXTRA_DIST += \ + meson.build + if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css/parser insttest_PROGRAMS = $(TEST_PROGS) @@ -488,7 +491,8 @@ test_files = $(test_in_files:.test.in=.test) $(test_files): %.test: %.test.in $(AM_V_GEN) sed $(substitutions) $< > $@.tmp && mv $@.tmp $@ -EXTRA_DIST += $(test_in_files) +EXTRA_DIST += \ + $(test_in_files) CLEANFILES += $(test_files) diff --git a/testsuite/css/style/Makefile.am b/testsuite/css/style/Makefile.am index bfdb22bad7..2ef0e55b61 100644 --- a/testsuite/css/style/Makefile.am +++ b/testsuite/css/style/Makefile.am @@ -51,6 +51,7 @@ EXTRA_DIST += \ $(resource_files) \ $(test_in_files) \ $(test_data) \ + meson.build \ $(NULL) if BUILDOPT_INSTALL_TESTS diff --git a/testsuite/gdk/Makefile.am b/testsuite/gdk/Makefile.am index 73b4beb486..b052d12ef0 100644 --- a/testsuite/gdk/Makefile.am +++ b/testsuite/gdk/Makefile.am @@ -33,6 +33,9 @@ CLEANFILES = \ gdksurface.png \ $(NULL) +EXTRA_DIST += \ + meson.build + if BUILDOPT_INSTALL_TESTS insttestdir=$(libexecdir)/installed-tests/$(PACKAGE) insttest_PROGRAMS = $(TEST_PROGS) diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am index 99718b671e..859f674f79 100644 --- a/testsuite/gtk/Makefile.am +++ b/testsuite/gtk/Makefile.am @@ -265,6 +265,7 @@ EXTRA_DIST += \ file-chooser-test-dir/text.txt \ $(test_icontheme) \ $(test_ui) \ + meson.build \ $(NULL) GTK_GSETTINGS_SCHEMAS = \ From 7391a078b34f9b19dbb142bc107cfffa0703d1f7 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 11:32:44 +0200 Subject: [PATCH 66/89] meson: build print backends This changes the configure option into two states: auto: build all that can be build (default) A list of backend names: build them and fail if we can't "papi" is missing because it's not in Debian and I can't test it. --- .gitlab-ci/Dockerfile | 1 + .gitlab-ci/test-docker-meson.sh | 1 + config.h.meson | 2 + gtk/meson.build | 2 - meson_options.txt | 4 +- modules/meson.build | 8 +- modules/printbackends/Makefile.am | 3 + modules/printbackends/meson.build | 177 ++++++++++++++++++++++++++++++ 8 files changed, 187 insertions(+), 11 deletions(-) create mode 100644 modules/printbackends/meson.build diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile index d9fa23d31d..8b4978eefb 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/Dockerfile @@ -49,6 +49,7 @@ RUN dnf -y install \ python3-pip \ python3-wheel \ redhat-rpm-config \ + rest-devel \ vulkan-devel \ wayland-devel \ wayland-protocols-devel \ diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh index 2679417905..0cd5636170 100755 --- a/.gitlab-ci/test-docker-meson.sh +++ b/.gitlab-ci/test-docker-meson.sh @@ -15,6 +15,7 @@ meson \ -Dman-pages=true \ -Dbroadway-backend=true \ -Dxinerama=yes \ + -Dprint-backends="file,lpr,test,cloudprint,cups" \ _build cd _build diff --git a/config.h.meson b/config.h.meson index 9fd690f966..fe5f861927 100644 --- a/config.h.meson +++ b/config.h.meson @@ -327,3 +327,5 @@ #mesondefine HAVE_DEV_EVDEV_INPUT_H #mesondefine HAVE_TRUNC + +#mesondefine GTK_PRINT_BACKENDS diff --git a/gtk/meson.build b/gtk/meson.build index 06ba5cc9e3..609ebca9e2 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -5,8 +5,6 @@ subdir('inspector') gtk_cargs = [ '-DGTK_COMPILATION', '-DG_LOG_DOMAIN="Gtk"', - # FIXME, support other backends - '-DGTK_PRINT_BACKENDS="file"', '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED', '-DGTK_BINARY_VERSION="@0@"'.format(gtk_binary_version), '-DGTK_HOST="@0@"'.format(host_machine.system()), diff --git a/meson_options.txt b/meson_options.txt index 683fff669a..21ca1ca2c8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -17,8 +17,8 @@ option('cloudproviders', type: 'boolean', value: false, description : 'Enable the cloudproviders support') # Print backends -option('print-backends', type : 'string', value : 'cups,file', - description : 'Build the specified print backends (comma-separated list, "all", or "none")') +option('print-backends', type : 'string', value : 'auto', + description : 'Build the specified print backends (comma-separated list, any of "cloudprint,cups,file,lpr,papi,test" or "auto")') option('colord', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', description : 'Build colord support for the CUPS printing backend') diff --git a/modules/meson.build b/modules/meson.build index e4b4b7905b..1ae93fdaf7 100644 --- a/modules/meson.build +++ b/modules/meson.build @@ -1,8 +1,2 @@ -# TODO -#if os_unix -# subdir('printbackends') -#else - print_backends = [] -#endif - subdir('input') +subdir('printbackends') diff --git a/modules/printbackends/Makefile.am b/modules/printbackends/Makefile.am index 7d6680dffb..f292fea851 100644 --- a/modules/printbackends/Makefile.am +++ b/modules/printbackends/Makefile.am @@ -20,4 +20,7 @@ endif DIST_SUBDIRS = cloudprint cups file lpr test papi +EXTRA_DIST += \ + meson.build + -include $(top_srcdir)/git.mk diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build new file mode 100644 index 0000000000..894572be0c --- /dev/null +++ b/modules/printbackends/meson.build @@ -0,0 +1,177 @@ +# Print backend config: 'auto' means all backends we have dependencies for, +# the specific backend names mean we should fail if dependencies are missing +all_print_backends = [ + 'cloudprint', + 'cups', + 'file', + 'lpr', + 'papi', + 'test', +] + +auto_print_backends = [] +foreach backend: all_print_backends + if backend != 'test' and os_unix + auto_print_backends += backend + endif +endforeach + +print_strict_deps = true +if get_option('print-backends') == 'auto' + enabled_print_backends = auto_print_backends + print_strict_deps = false +else + wanted_print_backends = get_option('print-backends').split(',') + enabled_print_backends = [] + foreach backend: wanted_print_backends + if backend != '' + if not all_print_backends.contains(backend) + error('print backend \'@0@\' unknown'.format(backend)) + endif + enabled_print_backends += backend + endif + endforeach +endif + +print_backends = [] + +if not enabled_print_backends.contains('file') + if os_unix + error('\'file\' print backed needs to be enabled') + endif +else + print_backends += ['file'] +endif + +if enabled_print_backends.contains('lpr') + print_backends += ['lpr'] +endif + +if enabled_print_backends.contains('test') + print_backends += ['test'] +endif + +if enabled_print_backends.contains('papi') + # TODO + if print_strict_deps + error('\'papi\' backend not supported with meson yet') + endif +endif + +if enabled_print_backends.contains('cloudprint') + rest_dep = dependency('rest-0.7', required : print_strict_deps) + json_glib_dep = dependency('json-glib-1.0', required : print_strict_deps) + if rest_dep.found() and json_glib_dep.found() + print_backends += ['cloudprint'] + else + message('\'cloudprint\' backend disabled: missing dependencies') + endif +endif + +if enabled_print_backends.contains('cups') + cups_error = '' + if cc.has_header('cups/cups.h') + cups_major_version = cc.compute_int('CUPS_VERSION_MAJOR', prefix : '#include ') + cups_minor_version = cc.compute_int('CUPS_VERSION_MINOR', prefix : '#include ') + message('Found CUPS version: @0@.@1@'.format(cups_major_version, cups_minor_version)) + if cups_major_version > 1 or cups_minor_version >= 2 + if cups_major_version > 1 or cups_minor_version >= 6 + cdata.set('HAVE_CUPS_API_1_6', 1) + endif + + if cc.compiles('#include \n http_t http; char *s = http.authstring;') + cdata.set('HAVE_HTTP_AUTHSTRING', 1, + description :'Define if cups http_t authstring field is accessible') + endif + libcups = cc.find_library('cups', required : true) + if libcups.found() and cc.has_function('httpGetAuthString', dependencies : libcups) + cdata.set('HAVE_HTTPGETAUTHSTRING', 1) + endif + else + cups_error = 'Need CUPS version >= 1.2' + endif + else + cups_error = 'Cannot find CUPS headers in default prefix.' + endif + + enable_colord = get_option('colord') + if enable_colord != 'no' + want_colord = enable_colord == 'yes' + colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord) + cdata.set('HAVE_COLORD', colord_dep.found()) + else + cups_colord_dep = [] + endif + + if cups_error != '' + if print_strict_deps + error(cups_error) + else + message(cups_error) + endif + else + print_backends += ['cups'] + endif +endif + +cdata.set_quoted('GTK_PRINT_BACKENDS', ','.join(print_backends)) + +# Building + +printbackends_args = [ + '-DGTK_COMPILATION', + '-DGTK_DISABLE_DEPRECATION_WARNINGS', + '-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED', +] +printbackends_subdir = 'gtk-3.0/@0@/printbackends'.format(gtk_binary_version) +printbackends_install_dir = join_paths(get_option('libdir'), printbackends_subdir) + +if print_backends.contains('file') + shared_module('printbackend-file', + 'file/gtkprintbackendfile.c', + c_args: printbackends_args, + dependencies: libgtk_dep, + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('lpr') + shared_module('printbackend-lpr', + 'lpr/gtkprintbackendlpr.c', + c_args: printbackends_args, + dependencies: libgtk_dep, + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('test') + shared_module('printbackend-test', + 'test/gtkprintbackendtest.c', + c_args: printbackends_args, + dependencies: libgtk_dep, + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('cloudprint') + shared_module('printbackend-cloudprint', + 'cloudprint/gtkprintbackendcloudprint.c', + 'cloudprint/gtkprintercloudprint.c', + 'cloudprint/gtkcloudprintaccount.c', + c_args: printbackends_args, + dependencies: [ libgtk_dep, rest_dep, json_glib_dep ], + install_dir: printbackends_install_dir, + install : true) +endif + +if print_backends.contains('cups') + shared_module('printbackend-cups', + 'cups/gtkprintbackendcups.c', + 'cups/gtkprintercups.c', + 'cups/gtkcupsutils.c', + 'cups/gtkcupssecretsutils.c', + c_args: printbackends_args, + dependencies: [libgtk_dep, libcups, colord_dep], + install_dir: printbackends_install_dir, + install : true) +endif From 6a37e2d19e2eaba40ce691ab0e10af6b4e021fcf Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 12:35:45 +0200 Subject: [PATCH 67/89] CI: Install sassc In case sassc is installed the build systems will try to regenerate the css files. This makes sure we test that code path. --- .gitlab-ci/Dockerfile | 1 + .gitlab-ci/test-msys2-meson.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile index 8b4978eefb..20eb281fd4 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/Dockerfile @@ -50,6 +50,7 @@ RUN dnf -y install \ python3-wheel \ redhat-rpm-config \ rest-devel \ + sassc \ vulkan-devel \ wayland-devel \ wayland-protocols-devel \ diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh index 2759c0b417..415e793f39 100644 --- a/.gitlab-ci/test-msys2-meson.sh +++ b/.gitlab-ci/test-msys2-meson.sh @@ -28,7 +28,8 @@ pacman --noconfirm -S --needed \ mingw-w64-$MSYS2_ARCH-shared-mime-info \ mingw-w64-$MSYS2_ARCH-meson \ mingw-w64-$MSYS2_ARCH-ninja \ - mingw-w64-$MSYS2_ARCH-gtk-doc + mingw-w64-$MSYS2_ARCH-gtk-doc \ + mingw-w64-$MSYS2_ARCH-sassc mkdir -p _ccache export CCACHE_BASEDIR="$(pwd)" From e47440def5e921c8bd9ac371c0f8e4fe4e752b7b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 13:22:16 +0200 Subject: [PATCH 68/89] meson: Don't make the man pages build depend on the documentation option Include all meson build files under docs/ and check with get_option() there. --- .gitlab-ci/test-msys2-meson.sh | 5 +- docs/reference/gdk/meson.build | 43 ++++++++------- docs/reference/gtk/meson.build | 71 +++++++++++++------------ docs/reference/libgail-util/meson.build | 38 ++++++------- docs/reference/meson.build | 24 +++++---- docs/tools/meson.build | 2 +- meson.build | 7 ++- 7 files changed, 101 insertions(+), 89 deletions(-) diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh index 415e793f39..2e5a128f17 100644 --- a/.gitlab-ci/test-msys2-meson.sh +++ b/.gitlab-ci/test-msys2-meson.sh @@ -39,7 +39,10 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" ccache --zero-stats ccache --show-stats -meson _build +meson \ + -Dman-pages=true \ + _build + ninja -C _build ccache --show-stats diff --git a/docs/reference/gdk/meson.build b/docs/reference/gdk/meson.build index e84fac07a4..007770f3aa 100644 --- a/docs/reference/gdk/meson.build +++ b/docs/reference/gdk/meson.build @@ -154,24 +154,27 @@ if wayland_enabled src_dir += [ gdkwayland_inc ] endif -configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) +if get_option('documentation') -gnome.gtkdoc('gdk3', - mode: 'none', - main_xml: 'gdk-docs.sgml', - src_dir: src_dir, - dependencies: libgdk_dep, - gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk3.types'), - scan_args: [ - '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', - '--ignore-headers=' + ' '.join(private_headers), - ], - fixxref_args: [ - '--html-dir=@0@'.format(docpath), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), - '--extra-dir=@0@'.format(cairo_docpath), - ], - html_assets: images, - install: true) + configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + + gnome.gtkdoc('gdk3', + mode: 'none', + main_xml: 'gdk-docs.sgml', + src_dir: src_dir, + dependencies: libgdk_dep, + gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk3.types'), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + '--ignore-headers=' + ' '.join(private_headers), + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=@0@'.format(cairo_docpath), + ], + html_assets: images, + install: true) +endif diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build index d179dac518..8e54742fa3 100644 --- a/docs/reference/gtk/meson.build +++ b/docs/reference/gtk/meson.build @@ -439,8 +439,6 @@ expand_content_files = [ 'tree_widget.sgml', ] -configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) - types_conf = configuration_data() if os_win32 types_conf.set('DISABLE_ON_W32', '%') @@ -454,38 +452,43 @@ else types_conf.set('DISABLE_ON_QUARTZ', '') endif -gnome.gtkdoc('gtk3', - mode: 'none', - main_xml: 'gtk-docs.sgml', - src_dir: [ - gtkinc, - ], - dependencies: libgtk_dep, - gobject_typesfile: configure_file( - input: 'gtk3.types.in', - output: 'gtk3.types', - configuration: types_conf, - ), - scan_args: [ - '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', - '--ignore-headers=' + ' '.join(private_headers), - ], - mkdb_args: [ - '--default-includes=gtk/gtk.h', - ], - fixxref_args: [ - '--html-dir=@0@'.format(docpath), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), - '--extra-dir=@0@'.format(cairo_docpath), - '--extra-dir=@0@'.format(gdkpixbuf_docpath), - '--extra-dir=../gdk', - ], - content_files: content_files, - expand_content_files: expand_content_files, - html_assets: images, - install: true) +if get_option('documentation') + + configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + + gnome.gtkdoc('gtk3', + mode: 'none', + main_xml: 'gtk-docs.sgml', + src_dir: [ + gtkinc, + ], + dependencies: libgtk_dep, + gobject_typesfile: configure_file( + input: 'gtk3.types.in', + output: 'gtk3.types', + configuration: types_conf, + ), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + '--ignore-headers=' + ' '.join(private_headers), + ], + mkdb_args: [ + '--default-includes=gtk/gtk.h', + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=@0@'.format(cairo_docpath), + '--extra-dir=@0@'.format(gdkpixbuf_docpath), + '--extra-dir=../gdk', + ], + content_files: content_files, + expand_content_files: expand_content_files, + html_assets: images, + install: true) +endif xsltproc = find_program('xsltproc', required: false) if get_option('man-pages') and not xsltproc.found() diff --git a/docs/reference/libgail-util/meson.build b/docs/reference/libgail-util/meson.build index dea5ecc597..870c3c2482 100644 --- a/docs/reference/libgail-util/meson.build +++ b/docs/reference/libgail-util/meson.build @@ -1,19 +1,21 @@ -configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) +if get_option('documentation') + configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) -gnome.gtkdoc('gail-libgail-util3', - mode: 'none', - main_xml: 'gail-libgail-util-docs.sgml', - src_dir: libgailutilinc, - dependencies: [libgtk_dep, libgailutil], - gobject_typesfile: join_paths(meson.current_source_dir(), 'gail-libgail-util3.types'), - scan_args: [ - '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', - ], - fixxref_args: [ - '--html-dir=@0@'.format(docpath), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), - '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), - '--extra-dir=../gtk', - ], - install: true) + gnome.gtkdoc('gail-libgail-util3', + mode: 'none', + main_xml: 'gail-libgail-util-docs.sgml', + src_dir: libgailutilinc, + dependencies: [libgtk_dep, libgailutil], + gobject_typesfile: join_paths(meson.current_source_dir(), 'gail-libgail-util3.types'), + scan_args: [ + '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT', + ], + fixxref_args: [ + '--html-dir=@0@'.format(docpath), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), + '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), + '--extra-dir=../gtk', + ], + install: true) +endif diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 3edf5f7d6d..23c4e22367 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -1,19 +1,21 @@ -glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') -glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') +if get_option('documentation') + glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') + glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') -cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix') -cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo') + cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix') + cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo') -gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix') -gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf') + gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix') + gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf') -docpath = join_paths(gtk_datadir, 'gtk-doc', 'html') + docpath = join_paths(gtk_datadir, 'gtk-doc', 'html') -version_conf = configuration_data() -version_conf.set('GTK_VERSION', meson.project_version()) + version_conf = configuration_data() + version_conf.set('GTK_VERSION', meson.project_version()) -src_dir_conf = configuration_data() -src_dir_conf.set('SRC_DIR', meson.source_root()) + src_dir_conf = configuration_data() + src_dir_conf.set('SRC_DIR', meson.source_root()) +endif subdir('gdk') subdir('gtk') diff --git a/docs/tools/meson.build b/docs/tools/meson.build index 05621ee7ed..5de632f141 100644 --- a/docs/tools/meson.build +++ b/docs/tools/meson.build @@ -1,4 +1,4 @@ -if x11_enabled +if x11_enabled and get_option('documentation') doc_shooter_sources = [ 'shadow.c', 'shooter.c', diff --git a/meson.build b/meson.build index 7dbb728ca5..2142509d2c 100644 --- a/meson.build +++ b/meson.build @@ -877,10 +877,8 @@ endif subdir('po') subdir('po-properties') -if get_option('documentation') - subdir('docs/tools') - subdir('docs/reference') -endif +subdir('docs/tools') +subdir('docs/reference') install_data('m4macros/gtk-3.0.m4', install_dir: join_paths(get_option('datadir'), 'aclocal')) @@ -903,6 +901,7 @@ summary = [ ' Colord support: @0@'.format(get_option('colord')), ' Introspection: @0@'.format(get_option('introspection')), ' Documentation: @0@'.format(get_option('documentation')), + ' Man pages: @0@'.format(get_option('man-pages')), ' Build tests: @0@'.format(get_option('build-tests')), ' Demos: @0@'.format(get_option('demos')), ' Examples: @0@'.format(get_option('build-examples')), From 1d40ba250fba1e1028eae30a02d3a5f68b42bd41 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 13:26:06 +0200 Subject: [PATCH 69/89] meson: only install broadway man pages if it's enabled --- .gitlab-ci/test-msys2-meson.sh | 1 + docs/reference/gtk/meson.build | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh index 2e5a128f17..23351a2b53 100644 --- a/.gitlab-ci/test-msys2-meson.sh +++ b/.gitlab-ci/test-msys2-meson.sh @@ -41,6 +41,7 @@ ccache --show-stats meson \ -Dman-pages=true \ + -Dbroadway-backend=true \ _build ninja -C _build diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build index 8e54742fa3..f97c545d10 100644 --- a/docs/reference/gtk/meson.build +++ b/docs/reference/gtk/meson.build @@ -514,11 +514,14 @@ if get_option('man-pages') and xsltproc.found() [ 'gtk3-demo-application', '1', ], [ 'gtk3-widget-factory', '1', ], [ 'gtk3-icon-browser', '1', ], - [ 'broadwayd', '1', ], [ 'gtk-builder-tool', '1', ], [ 'gtk-query-settings', '1', ], ] + if broadway_enabled + man_files += [[ 'broadwayd', '1', ]] + endif + foreach man: man_files man_name = man.get(0) man_section = man.get(1, '1') From 2445f46e01d2bb20ec407176020fba3c85297700 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 19:06:56 +0200 Subject: [PATCH 70/89] meson: gtk docs: set ENABLE_ON_X11 --- docs/reference/gtk/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build index f97c545d10..3e8c50d971 100644 --- a/docs/reference/gtk/meson.build +++ b/docs/reference/gtk/meson.build @@ -452,6 +452,12 @@ else types_conf.set('DISABLE_ON_QUARTZ', '') endif +if x11_enabled + types_conf.set('ENABLE_ON_X11', '') +else + types_conf.set('ENABLE_ON_X11', '%') +endif + if get_option('documentation') configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) From b5a8bd5fe3c5a66ce54796f45dafc7a9e68a895f Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 19:11:11 +0200 Subject: [PATCH 71/89] meson: Don't depend on meson 0.50 The install arg doesn't add anything here anyway. --- gdk/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdk/meson.build b/gdk/meson.build index fd43415cbd..45e4e96732 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -169,8 +169,7 @@ gdkconfig = configure_file( input : 'gdkconfig.h.meson', output : 'gdkconfig.h', configuration : gdkconfig_cdata, - install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk'), - install : true) + install_dir: join_paths(gtk_includedir, 'gtk-3.0/gdk')) gdkversion_cdata = configuration_data() From 65f2fe828c66e4f4d63ac8f6bca2a79f2888c97b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 19:12:08 +0200 Subject: [PATCH 72/89] meson: statically link immodules under mingw by default To match what the autotools build does right now. --- meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 2142509d2c..1e806e974d 100644 --- a/meson.build +++ b/meson.build @@ -615,8 +615,9 @@ builtin_modules_opt = get_option('builtin_immodules') builtin_immodules = [] if builtin_modules_opt == '' - if cc.get_id() == 'msvc' - # Current MSVC projects build all immodules directly into GTK by default + if os_win32 + # Current MSVC projects build all immodules directly into GTK by default, + # as does the mingw autotools build message('IMModules are built into GTK for MSVC builds by default') builtin_immodules = ['all'] else From 068f7f7423a745c3f210e41669cbf831a9bff61a Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 19:13:34 +0200 Subject: [PATCH 73/89] meson: set the soversion to just '0' everywhere This is what glib did for the meson port, so can't be that wrong. This also makes the DLL names match the autotools Windows DLLs. --- gdk/meson.build | 1 + gtk/meson.build | 1 + libgail-util/meson.build | 3 ++- meson.build | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gdk/meson.build b/gdk/meson.build index 45e4e96732..9d7ded377a 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -179,6 +179,7 @@ gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version) gdkversion_cdata.set('GTK_API_VERSION', gtk_api_version) gdkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version) gdkversion_cdata.set('GTK_VERSION', meson.project_version()) +gdkversion_cdata.set('LT_CURRENT_MINUS_AGE', gtk_soversion) gdkversionmacros = configure_file( input : 'gdkversionmacros.h.in', diff --git a/gtk/meson.build b/gtk/meson.build index 609ebca9e2..1753bcc043 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -798,6 +798,7 @@ gtkversion_cdata.set('GTK_API_VERSION', gtk_api_version) gtkversion_cdata.set('GTK_BINARY_VERSION', gtk_binary_version) gtkversion_cdata.set('GTK_VERSION', meson.project_version()) gtkversion_cdata.set('EXE_MANIFEST_ARCHITECTURE', '*') +gtkversion_cdata.set('LT_CURRENT_MINUS_AGE', gtk_soversion) gtkversion = configure_file(input: 'gtkversion.h.in', output: 'gtkversion.h', diff --git a/libgail-util/meson.build b/libgail-util/meson.build index 2b7828e724..6cca36f208 100644 --- a/libgail-util/meson.build +++ b/libgail-util/meson.build @@ -18,6 +18,7 @@ if cc.get_id() == 'msvc' endif libgailutil = shared_library('gailutil-3', + soversion: gtk_soversion, sources: [gailutil_sources], dependencies: libgtk_dep, include_directories: [confinc, gtkinc], @@ -26,4 +27,4 @@ libgailutil = shared_library('gailutil-3', '-DGTK_DISABLE_DEPRECATED', ] + common_cflags, link_args: gailutil_link_args, - install: true) \ No newline at end of file + install: true) diff --git a/meson.build b/meson.build index 1e806e974d..2359bb4124 100644 --- a/meson.build +++ b/meson.build @@ -78,7 +78,7 @@ gtk_binary_version = '3.0.0' gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version -gtk_soversion = '0.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk_interface_age) +gtk_soversion = '0' gtk_osxversions = [(100 * gtk_minor_version) + 1, '@0@.@1@.0'.format((100 * gtk_minor_version) + 1, gtk_micro_version)] gtk_api_version = '@0@.0'.format(gtk_major_version) From 8cfbf63c5a285d8470fe75e702517ad6b57ffc92 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 19:40:29 +0200 Subject: [PATCH 74/89] meson: static immodules: depend on generated headers --- gtk/meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/meson.build b/gtk/meson.build index 1753bcc043..9dcf309e9d 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -939,6 +939,8 @@ if cc.has_header('langinfo.h') endforeach endif +gtk_dep_sources = [gtkversion, gtktypebuiltins_h] + # Static immodules gtk_included_im_deps = [] foreach l: immodules @@ -949,7 +951,7 @@ foreach l: immodules if cond and (builtin_immodules.contains(name) or builtin_all_immodules) mod = static_library('staticimmodule-@0@'.format(name), - sources, + sources + gtk_dep_sources, dependencies: gtk_deps + [libgdk_dep] , c_args: gtk_cargs + common_cflags + ['-DINCLUDE_IM_@0@'.format(name)] + cflags, include_directories: [confinc, gdkinc, gtkinc]) @@ -970,7 +972,6 @@ libgtk = shared_library('gtk-3', darwin_versions : gtk_osxversions, install: true) -gtk_dep_sources = [gtkversion, gtktypebuiltins_h] # Introspection if build_gir gir_args = ['--quiet'] From 940126c427ac3b7289235ef5909b7f6453d22567 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 31 Mar 2019 22:41:46 +0200 Subject: [PATCH 75/89] meson: fix code examples in the gtk docs build getting_started.xml uses relative paths for including code examples and for some reason the base path is different with meson than with autotools. Switch both autotools and meson to generate the file and insert the absolute source path instead. This also cleans up the content file list: the expand content files have to be in the content file list as well, so just append them there. --- .gitlab-ci/test-docker-autotools.sh | 3 +- configure.ac | 1 + docs/reference/gtk/Makefile.am | 6 +-- ...ing_started.xml => getting_started.xml.in} | 42 +++++++++---------- docs/reference/gtk/meson.build | 20 ++------- docs/reference/meson.build | 2 +- 6 files changed, 32 insertions(+), 42 deletions(-) rename docs/reference/gtk/{getting_started.xml => getting_started.xml.in} (92%) diff --git a/.gitlab-ci/test-docker-autotools.sh b/.gitlab-ci/test-docker-autotools.sh index 73d7e8a6f9..32d8cec1e0 100755 --- a/.gitlab-ci/test-docker-autotools.sh +++ b/.gitlab-ci/test-docker-autotools.sh @@ -11,5 +11,6 @@ cd _build ../autogen.sh \ --enable-cloudproviders \ --enable-broadway-backend \ - --enable-xinerama + --enable-xinerama \ + --enable-gtk-doc make -j8 diff --git a/configure.ac b/configure.ac index f700616649..5615ac7193 100644 --- a/configure.ac +++ b/configure.ac @@ -1983,6 +1983,7 @@ docs/reference/gdk/version.xml docs/reference/gtk/Makefile docs/reference/gtk/gtk3.types docs/reference/gtk/version.xml +docs/reference/gtk/getting_started.xml docs/reference/libgail-util/Makefile docs/reference/libgail-util/version.xml docs/tools/Makefile diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am index df9296fcbe..4e20337d7d 100644 --- a/docs/reference/gtk/Makefile.am +++ b/docs/reference/gtk/Makefile.am @@ -287,7 +287,7 @@ content_files = \ css-overview.xml \ css-properties.xml \ drawing-model.xml \ - getting_started.xml \ + $(builddir)/getting_started.xml \ glossary.xml \ gtk3-demo-application.xml \ gtk3-demo.xml \ @@ -324,7 +324,7 @@ content_files = \ expand_content_files = \ compiling.sgml \ drawing-model.xml \ - getting_started.xml \ + $(builddir)/getting_started.xml \ glossary.xml \ input-handling.xml \ migrating-2to3.xml \ @@ -496,7 +496,7 @@ endif include $(top_srcdir)/gtk-doc.make # Other files to distribute -EXTRA_DIST += version.xml.in gtk3.types.in +EXTRA_DIST += version.xml.in gtk3.types.in getting_started.xml.in ######################################################################## diff --git a/docs/reference/gtk/getting_started.xml b/docs/reference/gtk/getting_started.xml.in similarity index 92% rename from docs/reference/gtk/getting_started.xml rename to docs/reference/gtk/getting_started.xml.in index 30cd88387d..efa604c862 100644 --- a/docs/reference/gtk/getting_started.xml +++ b/docs/reference/gtk/getting_started.xml.in @@ -44,7 +44,7 @@ Create a new file with the following content named example-0.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT @@ -153,7 +153,7 @@ Hello World in GTK+ Create a new file with the following content named example-1.c. - + MISSING XINCLUDE CONTENT @@ -233,7 +233,7 @@ Packing buttons Create a new file with the following content named example-2.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT You can compile the program above with GCC using: @@ -257,9 +257,9 @@ Packing buttons with GtkBuilder Create a new file with the following content named example-3.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Create a new file with the following content named builder.ui. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT You can compile the program above with GCC using: @@ -346,7 +346,7 @@ of our application class. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT All the application logic is in the application class, which @@ -364,7 +364,7 @@ GIO documentation. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Another important class that is part of the application support @@ -373,7 +373,7 @@ window. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT As part of the initial setup of our application, we also @@ -388,7 +388,7 @@ - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Note that @bindir@ needs to be replaced @@ -420,7 +420,7 @@ - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To make use of this file in our application, we revisit @@ -460,7 +460,7 @@ example_app_window_class_init (ExampleAppWindowClass *class) - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT This file has to be converted into a C source file that will be @@ -598,7 +598,7 @@ example_app_window_open (ExampleAppWindow *win, in a ui file, and add it as a resource to our binary. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To associate the app menu with the application, we have to call @@ -697,7 +697,7 @@ example_app_class_init (ExampleAppClass *class) GSettings requires a schema that describes our settings: - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Before we can make use of this schema in our application, @@ -749,13 +749,13 @@ example_app_window_init (ExampleAppWindow *win) Lets start with the template. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Next comes the dialog subclass. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Now we revisit the preferences_activated() function in our @@ -807,7 +807,7 @@ preferences_activated (GSimpleAction *action, to slide out the search bar below the header bar. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT Implementing the search needs quite a few code changes that @@ -887,7 +887,7 @@ example_app_window_init (ExampleAppWindow *win) which demonstrates #GtkMenuButton, #GtkRevealer and #GtkListBox. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT The code to populate the sidebar with buttons for the words @@ -898,7 +898,7 @@ example_app_window_init (ExampleAppWindow *win) ui file. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To connect the menuitem to the show-words setting, we use @@ -957,7 +957,7 @@ example_app_window_init (ExampleAppWindow *win) triggers the show-lines action: - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT To make this menu item do something, we create a property @@ -1017,7 +1017,7 @@ example_app_window_init (ExampleAppWindow *win) be a direct child of the window, and set its type to be titlebar. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT A small extra bonus of using a header bar is that we get @@ -1073,7 +1073,7 @@ example_app_window_init (ExampleAppWindow *win) Drawing in response to input Create a new file with the following content named example-4.c. - MISSING XINCLUDE CONTENT + MISSING XINCLUDE CONTENT You can compile the program above with GCC using: diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build index 3e8c50d971..892e272301 100644 --- a/docs/reference/gtk/meson.build +++ b/docs/reference/gtk/meson.build @@ -383,12 +383,8 @@ content_files = [ 'broadway.xml', 'broadwayd.xml', 'building.sgml', - 'compiling.sgml', 'css-overview.xml', 'css-properties.xml', - 'drawing-model.xml', - 'getting_started.xml', - 'glossary.xml', 'gtk3-demo-application.xml', 'gtk3-demo.xml', 'gtk3-icon-browser.xml', @@ -399,22 +395,11 @@ content_files = [ 'gtk-query-immodules-3.0.xml', 'gtk-query-settings.xml', 'gtk-update-icon-cache.xml', - 'input-handling.xml', - 'migrating-2to3.xml', - 'migrating-3xtoy.xml', - 'migrating-checklist.sgml', - 'migrating-GtkGrid.xml', - 'migrating-GtkStyleContext.xml', - 'migrating-smclient-GtkApplication.xml', - 'migrating-unique-GtkApplication.xml', 'mir.xml', 'osx.sgml', 'overview.xml', - 'question_index.sgml', 'resources.sgml', 'running.sgml', - 'text_widget.sgml', - 'tree_widget.sgml', 'visual_index.xml', 'wayland.xml', 'windows.sgml', @@ -424,7 +409,7 @@ content_files = [ expand_content_files = [ 'compiling.sgml', 'drawing-model.xml', - 'getting_started.xml', + join_paths(meson.current_build_dir(), 'getting_started.xml'), 'glossary.xml', 'input-handling.xml', 'migrating-2to3.xml', @@ -439,6 +424,8 @@ expand_content_files = [ 'tree_widget.sgml', ] +content_files += expand_content_files + types_conf = configuration_data() if os_win32 types_conf.set('DISABLE_ON_W32', '%') @@ -461,6 +448,7 @@ endif if get_option('documentation') configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) + configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf) gnome.gtkdoc('gtk3', mode: 'none', diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 23c4e22367..daec53a847 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -14,7 +14,7 @@ if get_option('documentation') version_conf.set('GTK_VERSION', meson.project_version()) src_dir_conf = configuration_data() - src_dir_conf.set('SRC_DIR', meson.source_root()) + src_dir_conf.set('abs_top_srcdir', meson.source_root()) endif subdir('gdk') From 52edd6b19237c5d8c6c41c417a1bee6fd8e4cd48 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 2 Apr 2019 10:06:16 +0200 Subject: [PATCH 76/89] CI: install dbus-x11 for dbus-launch and iso-codes (optional build dep) --- .gitlab-ci/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile index 20eb281fd4..c804e00be1 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/Dockerfile @@ -10,6 +10,7 @@ RUN dnf -y install \ ccache \ colord-devel \ cups-devel \ + dbus-x11 \ fribidi-devel \ gcc \ gcc-c++ \ @@ -23,6 +24,7 @@ RUN dnf -y install \ graphene-devel \ gtk-doc \ hicolor-icon-theme \ + iso-codes \ itstool \ json-glib-devel \ libcloudproviders-devel \ From 2d31112a7f4d921526d07bcdc06147950596e636 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 2 Apr 2019 17:41:28 +0200 Subject: [PATCH 77/89] CI: disable building with cloudproviders; breaks tests See #33 --- .gitlab-ci/test-docker-meson.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh index 0cd5636170..4603c5e0bf 100755 --- a/.gitlab-ci/test-docker-meson.sh +++ b/.gitlab-ci/test-docker-meson.sh @@ -10,7 +10,6 @@ export PATH="${HOME}/.local/bin:${PATH}" python3 -m pip install --user meson==0.49.2 meson \ - -Dcloudproviders=true \ -Ddocumentation=true \ -Dman-pages=true \ -Dbroadway-backend=true \ From 28833783cc6794d101a7f13abb063f8e0254dc34 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 1 Apr 2019 20:57:45 +0200 Subject: [PATCH 78/89] meson: Various config.h related fixes Various adjustments to make the config.h output between autotools and meson more similar by testing on Linux and Windows/MSYS2. Setting things to 1 instead of true and shifting things around is motivated by reducing the diff between the generated files. --- config.h.meson | 121 +++++++++++------------------- gtk/meson.build | 12 +-- meson.build | 61 +++++++++++---- modules/printbackends/meson.build | 2 +- 4 files changed, 98 insertions(+), 98 deletions(-) diff --git a/config.h.meson b/config.h.meson index fe5f861927..f90c96b7e6 100644 --- a/config.h.meson +++ b/config.h.meson @@ -1,6 +1,8 @@ +/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ -/* always defined to indicate that i18n is enabled */ +/* Define to 1 if translation of program messages to the user's native + language is requested. */ #mesondefine ENABLE_NLS /* The prefix for our gettext translation domains. */ @@ -9,12 +11,12 @@ /* Disable deprecation warnings from glib */ #mesondefine GLIB_DISABLE_DEPRECATION_WARNINGS -/* Define the location where the catalogs will be installed */ -#mesondefine GTK_LOCALEDIR - /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #mesondefine HAVE_BIND_TEXTDOMAIN_CODESET +/* Define if libcloudproviders is available */ +#mesondefine HAVE_CLOUDPROVIDERS + /* define if we have colord */ #mesondefine HAVE_COLORD @@ -24,7 +26,8 @@ /* Define to 1 if CUPS 1.6 API is available */ #mesondefine HAVE_CUPS_API_1_6 -/* Define to 1 if you have the `dcgettext' function. */ +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ #mesondefine HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. @@ -35,9 +38,18 @@ */ #mesondefine HAVE_DECL_ISNAN +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_DEV_EVDEV_INPUT_H + /* Define to 1 if you have the header file. */ #mesondefine HAVE_DLFCN_H +/* Define to 1 if you have the `exp2' function. */ +#mesondefine HAVE_EXP2 + +/* Define to 1 if you have the `flockfile' function. */ +#mesondefine HAVE_FLOCKFILE + /* Define to 1 if you have the header file. */ #mesondefine HAVE_FTW_H @@ -47,14 +59,11 @@ /* Define to 1 if you have the `getresuid' function. */ #mesondefine HAVE_GETRESUID -/* Define if the GNU gettext() function is already present or preinstalled. */ -#mesondefine HAVE_GETTEXT - /* Define if gio-unix is available */ #mesondefine HAVE_GIO_UNIX -/* Have GNU ftw */ -#mesondefine HAVE_GNU_FTW +/* defines whether we have HarfBuzz */ +#mesondefine HAVE_HARFBUZZ /* Define to 1 if you have the `httpGetAuthString' function. */ #mesondefine HAVE_HTTPGETAUTHSTRING @@ -68,18 +77,18 @@ /* Define to 1 if the system has the type `IPrintDialogCallback'. */ #mesondefine HAVE_IPRINTDIALOGCALLBACK -/* Define if your file defines LC_MESSAGES. */ -#mesondefine HAVE_LC_MESSAGES +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_LINUX_INPUT_H -/* Define to 1 if you have the `m' library (-lm). */ -#mesondefine HAVE_LIBM - -/* Define to 1 if you have the header file. */ -#mesondefine HAVE_LOCALE_H +/* Define to 1 if you have the header file. */ +#mesondefine HAVE_LINUX_MEMFD_H /* Define to 1 if you have the `localtime_r' function. */ #mesondefine HAVE_LOCALTIME_R +/* Define to 1 if you have the `log2' function. */ +#mesondefine HAVE_LOG2 + /* Define to 1 if you have the `lstat' function. */ #mesondefine HAVE_LSTAT @@ -98,6 +107,9 @@ /* Define to 1 if you have the `nearbyint' function. */ #mesondefine HAVE_NEARBYINT +/* defines whether we have pangoft2 */ +#mesondefine HAVE_PANGOFT + /* Define to 1 if libpapi available */ #mesondefine HAVE_PAPI @@ -116,18 +128,12 @@ /* Define to 1 if you have the `round' function. */ #mesondefine HAVE_ROUND +/* Define to 1 if SetupDiGetDevicePropertyW() is available */ +#mesondefine HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W + /* Define to 1 if you have the `sincos' function. */ #mesondefine HAVE_SINCOS -/* Define to 1 if you have the `log2` function */ -#mesondefine HAVE_LOG2 - -/* Define to 1 if you ahve the `exp2` function */ -#mesondefine HAVE_EXP2 - -/* Have the sockaddr_un.sun_len member */ -#mesondefine HAVE_SOCKADDR_UN_SUN_LEN - /* Define to 1 if solaris xinerama is available */ #mesondefine HAVE_SOLARIS_XINERAMA @@ -164,6 +170,9 @@ /* Define to 1 if you have the header file. */ #mesondefine HAVE_SYS_TYPES_H +/* Define to 1 if you have the `trunc' function. */ +#mesondefine HAVE_TRUNC + /* Define to 1 if you have the header file. */ #mesondefine HAVE_UNISTD_H @@ -194,12 +203,9 @@ /* Have the SYNC extension library */ #mesondefine HAVE_XSYNC -/* Define to 1 if you have the `_lock_file' function */ +/* Define to 1 if you have the `_lock_file' function. */ #mesondefine HAVE__LOCK_FILE -/* Define to 1 if you have the `flockfile' function */ -#mesondefine HAVE_FLOCKFILE - /* Define if _NL_MEASUREMENT_MEASUREMENT is available */ #mesondefine HAVE__NL_MEASUREMENT_MEASUREMENT @@ -215,15 +221,9 @@ /* Define to 1 if you have the `_NSGetEnviron' function. */ #mesondefine HAVE__NSGETENVIRON -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#mesondefine LT_OBJDIR - /* Define if needed for xReply */ #mesondefine NEED_XIPROTO_H_FOR_XREPLY -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#mesondefine NO_MINUS_C_MINUS_O - /* Define to the address where bug reports for this package should be sent. */ #mesondefine PACKAGE_BUGREPORT @@ -246,33 +246,9 @@ etc. */ #mesondefine QUARTZ_RELOCATION -/* Define to 1 if you have the ANSI C header files. */ -#mesondefine STDC_HEADERS - -/* Define to 1 if gmodule works and should be used */ -#mesondefine USE_GMODULE - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - +/* The size of `DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', as computed by sizeof. + */ +#mesondefine SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY /* Define to 1 if XInput 2.0 is available */ #mesondefine XINPUT_2 @@ -280,9 +256,6 @@ /* Define to 1 if XInput 2.2 is available */ #mesondefine XINPUT_2_2 -/* Define to 1 if the X Window System is missing or not being used. */ -#mesondefine X_DISPLAY_MISSING - /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 @@ -313,19 +286,13 @@ /* Define to `int' if doesn't define. */ #mesondefine uid_t -/* Define to 1 if linux/memfd.h exists */ -#mesondefine HAVE_LINUX_MEMFD_H - -#mesondefine GTK_LOCALEDIR - #mesondefine GTK_DATADIR #mesondefine GTK_LIBDIR -#mesondefine HAVE_LINUX_INPUT_H - -#mesondefine HAVE_DEV_EVDEV_INPUT_H - -#mesondefine HAVE_TRUNC - #mesondefine GTK_PRINT_BACKENDS + +/* Define the location where the catalogs will be installed */ +#mesondefine GTK_LOCALEDIR + +#mesondefine ISO_CODES_PREFIX diff --git a/gtk/meson.build b/gtk/meson.build index 9dcf309e9d..06f3c943bc 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -9,10 +9,10 @@ gtk_cargs = [ '-DGTK_BINARY_VERSION="@0@"'.format(gtk_binary_version), '-DGTK_HOST="@0@"'.format(host_machine.system()), '-DGTK_DATA_PREFIX="@0@"'.format(gtk_prefix), - '-DGTK_LIBDIR="@0@"'.format(gtk_libdir), - '-DGTK_LOCALEDIR="@0@"'.format(gtk_localedir), - '-DGTK_DATADIR="@0@"'.format(gtk_datadir), - '-DGTK_SYSCONFDIR="@0@"'.format(gtk_sysconfdir), + '-DGTK_LIBDIR="@0@"'.format(gtk_libdir), + '-DGTK_LOCALEDIR="@0@"'.format(gtk_localedir), + '-DGTK_DATADIR="@0@"'.format(gtk_datadir), + '-DGTK_SYSCONFDIR="@0@"'.format(gtk_sysconfdir), ] # List of sources to build the library from @@ -830,6 +830,8 @@ gtk_deps = [ platform_gio_dep, pangocairo_dep, pango_dep, + pangoft_dep, + harfbuzz_dep, fribidi_dep, cairogobj_dep, cairo_dep, @@ -935,7 +937,7 @@ if cc.has_header('langinfo.h') '_NL_PAPER_HEIGHT', '_NL_PAPER_WIDTH', '_NL_TIME_FIRST_WEEKDAY', ] - cdata.set('HAVE_' + nl_enum, cc.has_header_symbol('langinfo.h', nl_enum)) + cdata.set('HAVE_' + nl_enum, cc.has_header_symbol('langinfo.h', nl_enum) ? 1 : false) endforeach endif diff --git a/meson.build b/meson.build index 2359bb4124..5e83ecb5d8 100644 --- a/meson.build +++ b/meson.build @@ -149,6 +149,14 @@ cdata.set('GTK_MICRO_VERSION', gtk_micro_version) cdata.set('GTK_BINARY_AGE', gtk_binary_age) cdata.set('GTK_INTERFACE_AGE', gtk_interface_age) +cdata.set_quoted('PACKAGE_URL', '') +cdata.set_quoted('PACKAGE_NAME', 'gtk+') +cdata.set_quoted('PACKAGE_TARNAME', 'gtk+') +cdata.set_quoted('PACKAGE_STRING', 'gtk+ @0@'.format(meson.project_version())) +cdata.set_quoted('PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B') + +cdata.set('ENABLE_NLS', 1) + check_headers = [ 'crt/externs.h', 'dlfcn.h', @@ -200,6 +208,7 @@ check_functions = [ 'exp2', 'sincos', 'trunc', + 'localtime_r', ] foreach func : check_functions @@ -208,8 +217,8 @@ foreach func : check_functions endif endforeach -cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf')) -cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan')) +cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf') ? 1 : false) +cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan') ? 1 : false) # Disable deprecation checks for all libraries we depend on on stable branches. # This is so newer versions of those libraries don't cause more warnings with @@ -271,8 +280,10 @@ common_cflags = cc.get_supported_arguments(test_cflags) if get_option('default_library') != 'static' if os_win32 cdata.set('DLL_EXPORT', true) - cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern') - if cc.get_id() != 'msvc' + if cc.get_id() == 'msvc' + cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern') + else + cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern') common_cflags += ['-fvisibility=hidden'] endif else @@ -411,7 +422,7 @@ endif if iso_codes_dep.found() cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix')) else - cdata.set_quoted('ISO_CODES_PREFIX', '/usr') + cdata.set_quoted('ISO_CODES_PREFIX', get_option('prefix')) endif backend_immodules = [] @@ -462,8 +473,8 @@ endif cairo_libs = [] -cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found()) -cdata.set('HAVE_PANGOFT', pangoft_dep.found()) +cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found() ? 1 : false) +cdata.set('HAVE_PANGOFT', pangoft_dep.found() ? 1 : false) atk_pkgs = ['atk'] @@ -518,10 +529,10 @@ if x11_enabled atk_pkgs += ['atk-bridge-2.0'] - cdata.set('HAVE_XDAMAGE', xdamage_dep.found()) - cdata.set('HAVE_XCURSOR', xcursor_dep.found()) - cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found()) - cdata.set('HAVE_XFIXES', xfixes_dep.found()) + cdata.set('HAVE_XDAMAGE', xdamage_dep.found() ? 1 : false) + cdata.set('HAVE_XCURSOR', xcursor_dep.found() ? 1 : false) + cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found() ? 1 : false) + cdata.set('HAVE_XFIXES', xfixes_dep.found() ? 1 : false) if cc.has_function('XkbQueryExtension', dependencies: x11_dep, prefix : '#include ') @@ -558,14 +569,15 @@ if x11_enabled xinerama_dep = dependency('xinerama', required: want_xinerama) if xinerama_dep.found() and cc.has_header_symbol('X11/extensions/Xinerama.h', 'XineramaQueryExtension', dependencies: xinerama_dep) cdata.set('HAVE_XFREE_XINERAMA', 1) + cdata.set('HAVE_XINERAMA', 1) x11_pkgs += ['xinerama'] endif else xinerama_dep = [] endif - cdata.set('HAVE_RANDR', xrandr_dep.found()) - cdata.set('HAVE_RANDR15', xrandr15_dep.found()) + cdata.set('HAVE_RANDR', xrandr_dep.found() ? 1 : false) + cdata.set('HAVE_RANDR15', xrandr15_dep.found() ? 1 : false) endif if broadway_enabled @@ -724,12 +736,31 @@ if os_win32 if cc.has_header_symbol('windows.h', 'IPrintDialogCallback') cdata.set('HAVE_IPRINTDIALOGCALLBACK', 1) endif + + dvot_size = cc.sizeof('DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', prefix : ''' + #define _WIN32_WINNT 0x601 + #include + ''') + cdata.set('SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', dvot_size) + + getdevprop_code = ''' + #define _WIN32_WINNT 0x0600 + #include + #include + #include + + int main(int argc, char *argv[]) { + return SetupDiGetDevicePropertyW(NULL, NULL, NULL, NULL, NULL, 0, NULL, 0); + } + ''' + result = cc.links(getdevprop_code, args: ['-lsetupapi'], name: 'has SetupDiGetDevicePropertyW') + cdata.set('HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W', result ? 1 : false) endif have_gio_unix = false if os_unix have_gio_unix = giounix_dep.found() - cdata.set('HAVE_GIO_UNIX', have_gio_unix) + cdata.set('HAVE_GIO_UNIX', have_gio_unix ? 1 : false) endif cloudproviders_enabled = get_option('cloudproviders') @@ -738,7 +769,7 @@ if cloudproviders_enabled cloudproviders_dep = dependency('cloudproviders', version: cloudproviders_req, required: true) if cloudproviders_dep.found() cloudproviders_packages += ['cloudproviders', cloudproviders_req] - cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found()) + cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found() ? 1 : false) else error('Cloudproviders support not found, but was explicitly requested.') endif diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build index 894572be0c..36f322b487 100644 --- a/modules/printbackends/meson.build +++ b/modules/printbackends/meson.build @@ -98,7 +98,7 @@ if enabled_print_backends.contains('cups') if enable_colord != 'no' want_colord = enable_colord == 'yes' colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord) - cdata.set('HAVE_COLORD', colord_dep.found()) + cdata.set('HAVE_COLORD', colord_dep.found() ? 1 : false) else cups_colord_dep = [] endif From c5789127a7a471945ff3a218c8877056698de12b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Wed, 3 Apr 2019 20:59:28 +0200 Subject: [PATCH 79/89] meson: set soversion to 'vs' for MSVC This should result in -vs.dll filenames. --- meson.build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 5e83ecb5d8..0c25957bb1 100644 --- a/meson.build +++ b/meson.build @@ -78,7 +78,14 @@ gtk_binary_version = '3.0.0' gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version -gtk_soversion = '0' +cc = meson.get_compiler('c') + +if cc.get_id() == 'msvc' + gtk_soversion = 'vs@0@'.format(cc.version().split('.')[0]) +else + gtk_soversion = '0' +endif + gtk_osxversions = [(100 * gtk_minor_version) + 1, '@0@.@1@.0'.format((100 * gtk_minor_version) + 1, gtk_micro_version)] gtk_api_version = '@0@.0'.format(gtk_major_version) @@ -134,8 +141,6 @@ gtk_appdatadir = join_paths(gtk_datadir, 'metainfo') # multipress: is mplocaledir defined somewhere? gtk_mplocaledir = join_paths(gtk_prefix, get_option('localedir')) -cc = meson.get_compiler('c') - cdata = configuration_data() cdata.set_quoted('PACKAGE_VERSION', meson.project_version()) cdata.set_quoted('GTK_LOCALEDIR', gtk_localedir) From d2ef356f1dafa92951b6ad6096acf66f753fe52d Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 4 Apr 2019 09:33:08 +0800 Subject: [PATCH 80/89] meson.build: MSVC-Add fallback dep search for HarfBuzz It seems that Meson 0.50.0 broke dependency search using CMake for HarfBuzz at least, so we add a workaround for it to look for the HarfBuzz headers and libraries manually when we couldn't find HarfBuzz using the pkg-config and CMake method. --- meson.build | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 0c25957bb1..45f0d7a16a 100644 --- a/meson.build +++ b/meson.build @@ -409,8 +409,10 @@ epoxy_dep = dependency('epoxy', version: epoxy_req, fallback: ['libepoxy', 'libepoxy_dep']) atk_dep = dependency('atk', version: atk_req, fallback : ['atk', 'libatk_dep']) -harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false, - fallback: ['harfbuzz', 'libharfbuzz_dep']) + +# Update once Meson can have deps declared in a declarative manner or can +# find deps properly with CMake again +harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false) xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled) iso_codes_dep = dependency('iso-codes', required: false) @@ -424,6 +426,20 @@ if os_unix platform_gio_dep = giounix_dep endif +# Remove once Meson is fixed to find deps properly with CMake or +# gains the ability to declare deps in a declarative manner +# Fallback for HarfBuzz +if cc.get_id() == 'msvc' and not harfbuzz_dep.found() + if cc.has_header('hb.h') + harfbuzz_dep = cc.find_library('harfbuzz', required : false) + endif +endif + +if not harfbuzz_dep.found() + harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false, + fallback: ['harfbuzz', 'libharfbuzz_dep']) +endif + if iso_codes_dep.found() cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix')) else From 33589f154e90e6dac685326d44131f448a83d2e9 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 4 Apr 2019 09:43:04 +0800 Subject: [PATCH 81/89] meson.build: Fix generating .pc files It may be so that Cairo is not found using pkg-config files, so we cannot just use .name() on the Cairo deps directly. Since we already have a similar mechanism for generating the GDK .pc files, re-use and share that mechanism. --- meson.build | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 45f0d7a16a..bf91cf612f 100644 --- a/meson.build +++ b/meson.build @@ -476,8 +476,6 @@ foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled], cairo_backends += cairo_backend endif endforeach - elif cc.get_id() == 'msvc' and cairo_dep.found() - cairo_backends += 'cairo-win32' endif endif endforeach @@ -835,17 +833,20 @@ gdk_packages = ' '.join([ pango_pkgname, pango_req, 'pangocairo', pango_req, 'gdk-pixbuf-2.0', gdk_pixbuf_req ]) +cairo_packages = '' + if cairo_pkg_found - gdk_packages += ' '.join([ ' cairo', cairo_req ]) + cairo_packages += ' '.join([ ' cairo', cairo_req ]) elif cc.get_id() == 'msvc' and cairo_dep.found() - gdk_packages += ' '.join([ ' -lcairo' ]) + cairo_packages += ' '.join([ ' -lcairo' ]) endif if cairogobj_pkg_found - gdk_packages += ' '.join([ ' cairo-gobject', cairo_req ]) + cairo_packages += ' '.join([ ' cairo-gobject', cairo_req ]) elif cc.get_id() == 'msvc' and cairogobj_dep.found() - gdk_packages += ' '.join([ ' -lcairo-gobject' ]) + cairo_packages += ' '.join([ ' -lcairo-gobject' ]) endif +gdk_packages += cairo_packages pkgconf.set('GDK_PACKAGES', gdk_packages) if have_gio_unix @@ -861,8 +862,7 @@ pkgconf.set('GDK_PRIVATE_PACKAGES', gtk_packages = ' '.join([ atk_dep.name(), atk_req, - cairo_dep.name(), cairo_req, - cairogobj_dep.name(), cairo_req, + cairo_packages, pixbuf_dep.name(), gdk_pixbuf_req, 'gio-2.0', glib_req, ]) From 0432b22e0208289a3ddf459de183a001b93b0323 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 4 Apr 2019 10:15:27 +0800 Subject: [PATCH 82/89] meson.build: Output DLL names similar to the MSVC projects This makes the DLL names match those that are produced by the Visual Studio projects by default. This, currently, however, names the .lib files same as the ones that are produced for other platforms (i.e. -3.lib). This is actually not that bad as one can just copy those .lib's into -3.0.lib when needed and the binaries that link to those .lib's ultimately link to the same DLLs, so this should not harm binary compatibility. --- meson.build | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bf91cf612f..b6a9ddd062 100644 --- a/meson.build +++ b/meson.build @@ -81,7 +81,29 @@ gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version cc = meson.get_compiler('c') if cc.get_id() == 'msvc' - gtk_soversion = 'vs@0@'.format(cc.version().split('.')[0]) + vsver = 0 + mscver = cc.version().split('.')[0].to_int() + + # pre-Visual Studio 2015 (18.xx.xxxxx or earlier): just subtract 6 from major + # version of cc.version() to get the Visual Studio version + if mscver < 19 + vsver = mscver - 6 + else + # Visual Studio 2015 and later (19.xx.xxxxx or later): look at the minor version. + # If minor version < 10: Visual Studio 2015, + # 10 < minor version < 20: Visual Studio 2017, + # 20 < minor version: Visual Studio 2019 + mscsubver = cc.version().split('.')[1].to_int() + if mscsubver < 10 + vsver = 14 + elif mscsubver < 20 + vsver = 15 + else + vsver = 16 + endif + endif + + gtk_soversion = 'vs@0@'.format(vsver) else gtk_soversion = '0' endif From 3462fcf9a068bb2446bb5a1224d92c0aa4de0fa9 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 4 Apr 2019 08:48:34 +0200 Subject: [PATCH 83/89] meson: Follow gnome conventions for build option names --- .gitlab-ci/test-docker-meson.sh | 8 ++++---- .gitlab-ci/test-msys2-meson.sh | 4 ++-- docs/reference/gdk/meson.build | 2 +- docs/reference/gtk/meson.build | 6 +++--- docs/reference/libgail-util/meson.build | 2 +- docs/reference/meson.build | 2 +- docs/tools/meson.build | 2 +- meson.build | 22 +++++++++++----------- meson_options.txt | 22 +++++++++++----------- modules/printbackends/meson.build | 4 ++-- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci/test-docker-meson.sh b/.gitlab-ci/test-docker-meson.sh index 4603c5e0bf..c791f3f1ba 100755 --- a/.gitlab-ci/test-docker-meson.sh +++ b/.gitlab-ci/test-docker-meson.sh @@ -10,11 +10,11 @@ export PATH="${HOME}/.local/bin:${PATH}" python3 -m pip install --user meson==0.49.2 meson \ - -Ddocumentation=true \ - -Dman-pages=true \ - -Dbroadway-backend=true \ + -Dgtk_doc=true \ + -Dman=true \ + -Dbroadway_backend=true \ -Dxinerama=yes \ - -Dprint-backends="file,lpr,test,cloudprint,cups" \ + -Dprint_backends="file,lpr,test,cloudprint,cups" \ _build cd _build diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh index 23351a2b53..6116411dd5 100644 --- a/.gitlab-ci/test-msys2-meson.sh +++ b/.gitlab-ci/test-msys2-meson.sh @@ -40,8 +40,8 @@ ccache --zero-stats ccache --show-stats meson \ - -Dman-pages=true \ - -Dbroadway-backend=true \ + -Dman=true \ + -Dbroadway_backend=true \ _build ninja -C _build diff --git a/docs/reference/gdk/meson.build b/docs/reference/gdk/meson.build index 007770f3aa..96a993e066 100644 --- a/docs/reference/gdk/meson.build +++ b/docs/reference/gdk/meson.build @@ -154,7 +154,7 @@ if wayland_enabled src_dir += [ gdkwayland_inc ] endif -if get_option('documentation') +if get_option('gtk_doc') configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build index 892e272301..a49235cb1e 100644 --- a/docs/reference/gtk/meson.build +++ b/docs/reference/gtk/meson.build @@ -445,7 +445,7 @@ else types_conf.set('ENABLE_ON_X11', '%') endif -if get_option('documentation') +if get_option('gtk_doc') configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) configure_file(input: 'getting_started.xml.in', output: 'getting_started.xml', configuration: src_dir_conf) @@ -485,11 +485,11 @@ if get_option('documentation') endif xsltproc = find_program('xsltproc', required: false) -if get_option('man-pages') and not xsltproc.found() +if get_option('man') and not xsltproc.found() error('No xsltproc found, but man pages were explicitly enabled') endif -if get_option('man-pages') and xsltproc.found() +if get_option('man') and xsltproc.found() xlstproc_flags = [ '--nonet', '--stringparam', 'man.output.quietly', '1', diff --git a/docs/reference/libgail-util/meson.build b/docs/reference/libgail-util/meson.build index 870c3c2482..ce32d9f8db 100644 --- a/docs/reference/libgail-util/meson.build +++ b/docs/reference/libgail-util/meson.build @@ -1,4 +1,4 @@ -if get_option('documentation') +if get_option('gtk_doc') configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf) gnome.gtkdoc('gail-libgail-util3', diff --git a/docs/reference/meson.build b/docs/reference/meson.build index daec53a847..2e28fba4a8 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -1,4 +1,4 @@ -if get_option('documentation') +if get_option('gtk_doc') glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') diff --git a/docs/tools/meson.build b/docs/tools/meson.build index 5de632f141..05621ee7ed 100644 --- a/docs/tools/meson.build +++ b/docs/tools/meson.build @@ -1,4 +1,4 @@ -if x11_enabled and get_option('documentation') +if x11_enabled doc_shooter_sources = [ 'shadow.c', 'shooter.c', diff --git a/meson.build b/meson.build index b6a9ddd062..3411e3a046 100644 --- a/meson.build +++ b/meson.build @@ -112,11 +112,11 @@ gtk_osxversions = [(100 * gtk_minor_version) + 1, '@0@.@1@.0'.format((100 * gtk_ gtk_api_version = '@0@.0'.format(gtk_major_version) -x11_enabled = get_option('x11-backend') -wayland_enabled = get_option('wayland-backend') -broadway_enabled = get_option('broadway-backend') -quartz_enabled = get_option('quartz-backend') -win32_enabled = get_option('win32-backend') +x11_enabled = get_option('x11_backend') +wayland_enabled = get_option('wayland_backend') +broadway_enabled = get_option('broadway_backend') +quartz_enabled = get_option('quartz_backend') +win32_enabled = get_option('win32_backend') os_unix = false os_linux = false @@ -824,11 +824,11 @@ subdir('libgail-util') if get_option('demos') subdir('demos') endif -if get_option('build-tests') +if get_option('tests') subdir('tests') subdir('testsuite') endif -if get_option('build-examples') +if get_option('examples') subdir('examples') endif @@ -975,11 +975,11 @@ summary = [ ' Cloud support: @0@'.format(get_option('cloudproviders')), ' Colord support: @0@'.format(get_option('colord')), ' Introspection: @0@'.format(get_option('introspection')), - ' Documentation: @0@'.format(get_option('documentation')), - ' Man pages: @0@'.format(get_option('man-pages')), - ' Build tests: @0@'.format(get_option('build-tests')), + ' Documentation: @0@'.format(get_option('gtk_doc')), + ' Man pages: @0@'.format(get_option('man')), + ' Build tests: @0@'.format(get_option('tests')), ' Demos: @0@'.format(get_option('demos')), - ' Examples: @0@'.format(get_option('build-examples')), + ' Examples: @0@'.format(get_option('examples')), 'Directories:', ' prefix: @0@'.format(gtk_prefix), ' includedir: @0@'.format(gtk_includedir), diff --git a/meson_options.txt b/meson_options.txt index 21ca1ca2c8..7a0e7aa592 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,13 +1,13 @@ # GDK backends -option('x11-backend', type: 'boolean', value: true, +option('x11_backend', type: 'boolean', value: true, description : 'Enable the X11 gdk backend (only when building on Unix)') -option('wayland-backend', type: 'boolean', value: true, +option('wayland_backend', type: 'boolean', value: true, description : 'Enable the wayland gdk backend (only when building on Unix except for macOS)') -option('broadway-backend', type: 'boolean', value: false, +option('broadway_backend', type: 'boolean', value: false, description : 'Enable the broadway (HTML5) gdk backend') -option('win32-backend', type: 'boolean', value: true, +option('win32_backend', type: 'boolean', value: true, description : 'Enable the Windows gdk backend (only when building on Windows)') -option('quartz-backend', type: 'boolean', value: true, +option('quartz_backend', type: 'boolean', value: true, description : 'Enable the macOS gdk backend (only when building on macOS)') # Optional dependencies @@ -17,15 +17,15 @@ option('cloudproviders', type: 'boolean', value: false, description : 'Enable the cloudproviders support') # Print backends -option('print-backends', type : 'string', value : 'auto', +option('print_backends', type : 'string', value : 'auto', description : 'Build the specified print backends (comma-separated list, any of "cloudprint,cups,file,lpr,papi,test" or "auto")') option('colord', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', description : 'Build colord support for the CUPS printing backend') # Documentation and introspection -option('documentation', type: 'boolean', value: 'false', - description : 'Build API reference and tools documentation') -option('man-pages', type: 'boolean', value: 'false', +option('gtk_doc', type: 'boolean', value: 'false', + description : 'Build API reference with gtk-doc') +option('man', type: 'boolean', value: 'false', description : 'Build man pages for installed tools') option('introspection', type: 'boolean', value: 'true', description : 'Build introspection data (requires gobject-introspection)') @@ -33,9 +33,9 @@ option('introspection', type: 'boolean', value: 'true', # Demos and binaries option('demos', type: 'boolean', value: 'true', description : 'Build demo programs') -option('build-examples', type: 'boolean', value: 'true', +option('examples', type: 'boolean', value: 'true', description : 'Build examples') -option('build-tests', type: 'boolean', value: 'true', +option('tests', type: 'boolean', value: 'true', description : 'Build tests') # input modules diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build index 36f322b487..3f4dfd13f1 100644 --- a/modules/printbackends/meson.build +++ b/modules/printbackends/meson.build @@ -17,11 +17,11 @@ foreach backend: all_print_backends endforeach print_strict_deps = true -if get_option('print-backends') == 'auto' +if get_option('print_backends') == 'auto' enabled_print_backends = auto_print_backends print_strict_deps = false else - wanted_print_backends = get_option('print-backends').split(',') + wanted_print_backends = get_option('print_backends').split(',') enabled_print_backends = [] foreach backend: wanted_print_backends if backend != '' From 749a58ab26bc01381d66ccefdd3aa42a34353e70 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 5 Apr 2019 07:48:56 +0200 Subject: [PATCH 84/89] meson: simplify builtin_immodules build option Make it a yes/no/auto combo. "yes" means all modules are built into libgtk, "no" that none are and "auto" uses the platform defaults, yes on win32, no otherwise. If we need more we can always extend it later. --- gtk/meson.build | 2 +- meson.build | 30 ++++++------------------------ meson_options.txt | 4 ++-- modules/input/meson.build | 2 +- 4 files changed, 10 insertions(+), 28 deletions(-) diff --git a/gtk/meson.build b/gtk/meson.build index 06f3c943bc..e1b1a268ec 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -951,7 +951,7 @@ foreach l: immodules cond = l.get(2, true) cflags = l.get(3, []) - if cond and (builtin_immodules.contains(name) or builtin_all_immodules) + if cond and builtin_immodules mod = static_library('staticimmodule-@0@'.format(name), sources + gtk_dep_sources, dependencies: gtk_deps + [libgdk_dep] , diff --git a/meson.build b/meson.build index 3411e3a046..538abb378c 100644 --- a/meson.build +++ b/meson.build @@ -468,8 +468,6 @@ else cdata.set_quoted('ISO_CODES_PREFIX', get_option('prefix')) endif -backend_immodules = [] - pc_gdk_extra_libs = [] cairo_found_type = cairo_dep.type_name() @@ -525,7 +523,6 @@ if wayland_enabled wlprotocolsdep = dependency('wayland-protocols', version: wayland_proto_req) wlcursordep = dependency('wayland-cursor', version: wayland_req) wlegldep = dependency('wayland-egl') - backend_immodules += ['wayland'] wayland_pkgs = [ 'wayland-client', wayland_req, @@ -551,8 +548,6 @@ if x11_enabled fontconfig_dep = dependency('fontconfig', fallback: ['fontconfig', 'fontconfig_dep']) atkbridge_dep = dependency('atk-bridge-2.0', version: atk_req) - backend_immodules += ['xim'] - x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr'] if xcursor_dep.found() @@ -623,12 +618,10 @@ endif if broadway_enabled pc_gdk_extra_libs += ['-lz'] - backend_immodules += ['broadway'] endif if quartz_enabled pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon', '-framework CoreGraphics'] - backend_immodules += ['quartz'] endif extra_demo_ldflags = [] @@ -643,7 +636,6 @@ if win32_enabled pc_gdk_extra_libs += ['-Wl,-luuid'] endif pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32'] - backend_immodules += ['ime'] # Check whether libepoxy is built with EGL support on Windows win32_has_egl = cc.links( @@ -662,30 +654,20 @@ endif # IMModules stuff-unfortunately we need to put items here # as they can be built as modules or built directly into GTK -builtin_all_immodules = false - builtin_modules_opt = get_option('builtin_immodules') -builtin_immodules = [] - -if builtin_modules_opt == '' +if builtin_modules_opt == 'auto' if os_win32 # Current MSVC projects build all immodules directly into GTK by default, # as does the mingw autotools build message('IMModules are built into GTK for MSVC builds by default') - builtin_immodules = ['all'] + builtin_immodules = true else - builtin_immodules = ['none'] + builtin_immodules = false endif +elif builtin_modules_opt == 'yes' + builtin_immodules = true else - builtin_immodules = builtin_modules_opt.split(',') -endif - -if builtin_immodules.contains('none') - builtin_immodules = [] -elif builtin_immodules.contains('all') - builtin_all_immodules = true -elif builtin_immodules.contains('backend') - builtin_immodules += backend_immodules + builtin_immodules = false endif proto_sources = [ diff --git a/meson_options.txt b/meson_options.txt index 7a0e7aa592..5b30c29aa6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -39,5 +39,5 @@ option('tests', type: 'boolean', value: 'true', description : 'Build tests') # input modules -option('builtin_immodules', type: 'string', - value: '', description: 'Build specified immodules into GTK so/DLL (comma-separated list), "all", "none" or "backend"') +option('builtin_immodules', type: 'combo', choices : ['yes', 'no', 'auto'], + value: 'auto', description: 'Build immodules into GTK so/DLL') diff --git a/modules/input/meson.build b/modules/input/meson.build index 0e8ea9ec2c..09625a93c1 100644 --- a/modules/input/meson.build +++ b/modules/input/meson.build @@ -7,7 +7,7 @@ foreach l: immodules cond = l.get(2, true) cflags = l.get(3, []) - if cond and not (builtin_immodules.contains(name) or builtin_all_immodules) + if cond and not builtin_immodules shared_module('im-@0@'.format(name), immod_sources, c_args: common_cflags + cflags, From 5aba13f62d19923da6c4d524b45c5b7df5848ef0 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 5 Apr 2019 09:12:09 +0200 Subject: [PATCH 85/89] autotools: dist gen-c-array.py and gen-rc.py --- gdk/broadway/Makefile.am | 4 +++- gtk/Makefile.am | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gdk/broadway/Makefile.am b/gdk/broadway/Makefile.am index ae33f4cef5..fd4b9d1414 100644 --- a/gdk/broadway/Makefile.am +++ b/gdk/broadway/Makefile.am @@ -108,7 +108,9 @@ EXTRA_DIST += $(broadway_built_sources) BUILT_SOURCES = $(broadway_built_sources) -EXTRA_DIST += meson.build +EXTRA_DIST += \ + meson.build \ + gen-c-array.py # ------------------- MSVC Build Items ---------------- MSVCPROJS = gdk3-broadway broadwayd diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 29565bc8e3..eaca4737dc 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -1779,6 +1779,7 @@ EXTRA_DIST += \ gtkprivatetypebuiltins.h.template \ meson.build \ gen-gtk-gresources-xml.py \ + gen-rc.py \ gentypefuncs.py \ a11y/meson.build \ deprecated/meson.build \ From b6b15508d599f85eca58abe40381f2699c8cfba2 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 8 Apr 2019 12:49:02 +0800 Subject: [PATCH 86/89] meson/MSVC: Copy xxx-3.lib to xxx-3.0.lib upon post-install This ensures that current Visual Studio project files and NMake Makefiles (which do not use pkg-config files) do not break with the Meson-built GTK-3.x libraries. --- build-aux/meson/post-install.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build-aux/meson/post-install.py b/build-aux/meson/post-install.py index f526bc81bf..71edc4da80 100644 --- a/build-aux/meson/post-install.py +++ b/build-aux/meson/post-install.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os +import shutil import sys import subprocess @@ -16,6 +17,14 @@ if 'DESTDIR' not in os.environ: gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules') gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends') + if os.name == 'nt': + for lib in ['gdk', 'gtk', 'gailutil']: + # Make copy for MSVC-built .lib files, e.g. xxx-3.lib->xxx-3.0.lib + installed_lib = os.path.join(gtk_libdir, lib + '-' + gtk_api_version.split('.')[0] + '.lib') + installed_lib_dst = os.path.join(gtk_libdir, lib + '-' + gtk_api_version + '.lib') + if os.path.isfile(installed_lib): + shutil.copyfile(installed_lib, installed_lib_dst) + print('Compiling GSettings schemas...') subprocess.call(['glib-compile-schemas', os.path.join(gtk_datadir, 'glib-2.0', 'schemas')]) From 651715b8e861e8e0529e95f60a6fb960a2d1cb45 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 10 Apr 2019 17:20:18 +0800 Subject: [PATCH 87/89] meson: Fix building with builtin immodules We also need to ensure that we pass in -DINCLUDE_IM_xxxx when building the GTK DLL/.so, in addition to building the respective (static) immodules, so that we did really link in the immodules into the final GTK DLL/.so. --- gtk/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/meson.build b/gtk/meson.build index e1b1a268ec..01c999ebfb 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -952,10 +952,11 @@ foreach l: immodules cflags = l.get(3, []) if cond and builtin_immodules + gtk_cargs += ['-DINCLUDE_IM_@0@'.format(name)] mod = static_library('staticimmodule-@0@'.format(name), sources + gtk_dep_sources, dependencies: gtk_deps + [libgdk_dep] , - c_args: gtk_cargs + common_cflags + ['-DINCLUDE_IM_@0@'.format(name)] + cflags, + c_args: gtk_cargs + common_cflags + cflags, include_directories: [confinc, gdkinc, gtkinc]) gtk_included_im_deps += declare_dependency(link_with: mod) From 9f1b954fffb8b361c417771b54620d6ce6af8a4a Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 10 Apr 2019 17:43:14 +0800 Subject: [PATCH 88/89] README.win32: Add instructions on Meson builds This adds a set of instructions, notes and known issues for the Meson builds on Windows, especially Visual Studio. --- README.win32 | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/README.win32 b/README.win32 index 4c2464e3f0..2998b99d6c 100644 --- a/README.win32 +++ b/README.win32 @@ -181,6 +181,96 @@ instance the makefile.msc files might not produce identically named DLLs and import libraries as the "autoconfiscated" makefiles and libtool do. If this bothers you, you will have to fix the makefiles. +3) Using Meson (for Visual Studio and MinGW builds) +--- + +Meson can now be used to build GTK+-3.x with either MinGW or Visual Studio. +You will need the following items in addition to all the dependencies +listed above: + +- Python 3.5 or later +- Meson build system, 0.48.0 or later +- Ninja (if not using the Visual Studio project generator for + Visual Studio 2010, 2015, 2017, 2019) +- CMake (optional, used for dependency searching) +- pkg-config (optional, or some compatible tool, highly recommended) + +For all Windows builds, note that unless -Dbuiltin_immodules=no is specified, +the input modules (immodules) are built directly into the GTK DLL. + +For building with Meson using Visual Studio, do the following: + +Create an empty build directory somewhere that is on the same drive +as the source tree, and launch the Visual Studio command prompt that +matches the build configuration (Visual Studio version and architecture), +and run the following: + +- Ensure that both the installation directory of Python and its script + directory is in your PATH, as well as the Ninja, CMake and pkg-config + executables (if used). If a pkg-config compatible drop-in replacement + tool is being used, ensure that PKG_CONFIG is set to point to the + executable of that tool as well. + +- For non-GNOME dependencies (such as Cairo and Harfbuzz), where pkg-config + files or CMake files could not be properly located, set INCLUDE and LIB + to ensure that their header files and .lib files can be found respectively. + The DLLs of those dependencies should also be in the PATH during the build + as well, especially if introspection files are to be built. + +- For GNOME dependencies, the pkg-config files for those dependencies should + be searchable by pkg-config (or a compatible tool). Verify this by running + $(PKG_CONFIG) --modversion . + +- Run the following: + meson --buildtype=... --prefix=..., + where buildtype can be release, debugoptimized, debug or plain. Please + refer to the Meson documentation for more details. You may also wish to + pass in -Dbroadway_backend=true if building the Broadway GDK backend is + desired, and/or pass in -Dbuiltin_immodules=no to build the immodules as + standalone DLLs that can be loaded by GTK dynamically. For Visual Studio + 2010, 2015, 2017 and 2019 builds, you may pass in --backend=vs to generate + Visual Studio project files to be used to carry out the builds. + +If you are building with Visual Studio 2008, note the following items as well: + +- For x64 builds, the compiler may hang when building the certain files, due + to optimization issues in the compiler. If this happens, use the Windows + Task Manager and terminate all cl.exe processes, and the build will fail + with the source files that did not finish compiling due to the hang. + Look for them in build.ninja in the build directory, and change their compiler + flag "/O2" to "/O1", and the compilation and linking should proceed normally. + At this time of writing, the following files are known to cause this hang: + + gtk\gtkfilechoosernativewin32.c + gtk\gtkfilesystemmodel.c + gtk\gtktextsegment.c + gtk\gtktextbtree.c + gtk\gtkrbtree.c + testsuite\gtk\treemodel.c + testsuite\gtk\textbuffer.c + testsuite\gtk\rbtree.c + testsuite\gtk\icontheme.c + +- Upon running install (via "ninja install"), it is likely that + gtk-query-immodules-3.0.exe will fail to run as it cannot find msvcr90.dll or + msvcr90D.dll. You can ignore this if you did not specify -Dbuiltin_immodules=no + when configuring via Meson. If -Dbuiltin_immodules=no is specified, you need to + run the following after embedding the manifests as outlined in the next point: + + \bin\gtk-query-immodules-3.0.exe > \lib\gtk-3.0\3.0.0\immodules.cache + +- You will need to run the following upon completing install, from the build + directory in the Visual Studio 2008/SDK 6.0 command prompt (third line is not + needed unless -Dbuiltin_immodules=no is specified) so that the built binaries + can run: + + for /r %f in (*.dll.manifest) do if exist \bin\%~nf mt /manifest %f /outputresource:\bin\%~nf;2 + for /r %f in (*.exe.manifest) do if exist \bin\%~nf mt /manifest %f /outputresource:\bin\%~nf;1 + for /r %f in (*.dll.manifest) do if exist \lib\gtk-3.0\3.0.0\immodules\%~nf mt /manifest %f /outputresource:\lib\gtk-3.0\3.0.0\immodules\%~nf;2 + +- The more modern visual style for the print dialog is not applied for Visual + Studio 2008 builds. Any solutions to this is really appreciated. + Using GTK+ on Win32 =================== From e96c6c40f857c4a2d25f3ffd137fa1296a608733 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 10 Apr 2019 18:00:46 +0800 Subject: [PATCH 89/89] testsuite/gtk/builder.c: Export the needed symbols Those symbols need to be properly exported for Visual Studio builds for things to work properly. Fixes the test on Visual Studio builds. --- testsuite/gtk/builder.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c index 339ad110b2..58d9f235cd 100644 --- a/testsuite/gtk/builder.c +++ b/testsuite/gtk/builder.c @@ -26,14 +26,14 @@ #include /* exported for GtkBuilder */ -void signal_normal (GtkWindow *window, GParamSpec *spec); -void signal_after (GtkWindow *window, GParamSpec *spec); -void signal_object (GtkButton *button, GParamSpec *spec); -void signal_object_after (GtkButton *button, GParamSpec *spec); -void signal_first (GtkButton *button, GParamSpec *spec); -void signal_second (GtkButton *button, GParamSpec *spec); -void signal_extra (GtkButton *button, GParamSpec *spec); -void signal_extra2 (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_normal (GtkWindow *window, GParamSpec *spec); +G_MODULE_EXPORT void signal_after (GtkWindow *window, GParamSpec *spec); +G_MODULE_EXPORT void signal_object (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_object_after (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_first (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_second (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_extra (GtkButton *button, GParamSpec *spec); +G_MODULE_EXPORT void signal_extra2 (GtkButton *button, GParamSpec *spec); /* Copied from gtkiconfactory.c; keep in sync! */ struct _GtkIconSet @@ -133,7 +133,7 @@ static int after = 0; static int object = 0; static int object_after = 0; -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_normal (GtkWindow *window, GParamSpec *spec) { g_assert (GTK_IS_WINDOW (window)); @@ -143,7 +143,7 @@ signal_normal (GtkWindow *window, GParamSpec *spec) normal++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_after (GtkWindow *window, GParamSpec *spec) { g_assert (GTK_IS_WINDOW (window)); @@ -153,7 +153,7 @@ signal_after (GtkWindow *window, GParamSpec *spec) after++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_object (GtkButton *button, GParamSpec *spec) { g_assert (GTK_IS_BUTTON (button)); @@ -163,7 +163,7 @@ signal_object (GtkButton *button, GParamSpec *spec) object++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_object_after (GtkButton *button, GParamSpec *spec) { g_assert (GTK_IS_BUTTON (button)); @@ -173,28 +173,28 @@ signal_object_after (GtkButton *button, GParamSpec *spec) object_after++; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_first (GtkButton *button, GParamSpec *spec) { g_assert (normal == 0); normal = 10; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_second (GtkButton *button, GParamSpec *spec) { g_assert (normal == 10); normal = 20; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_extra (GtkButton *button, GParamSpec *spec) { g_assert (normal == 20); normal = 30; } -void /* exported for GtkBuilder */ +G_MODULE_EXPORT void /* exported for GtkBuilder */ signal_extra2 (GtkButton *button, GParamSpec *spec) { g_assert (normal == 30); @@ -2619,13 +2619,13 @@ test_level_bar (void) static GObject *external_object = NULL, *external_object_swapped = NULL; -void +G_MODULE_EXPORT void on_button_clicked (GtkButton *button, GObject *data) { external_object = data; } -void +G_MODULE_EXPORT void on_button_clicked_swapped (GObject *data, GtkButton *button) { external_object_swapped = data; @@ -2844,7 +2844,7 @@ test_template () g_assert (GTK_IS_LABEL (my_gtk_grid->priv->label)); } -void +G_MODULE_EXPORT void on_cellrenderertoggle1_toggled (GtkCellRendererToggle *cell) { }