After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781908 - Port to meson build system
Port to meson build system
Status: RESOLVED FIXED
Product: gnome-todo
Classification: Other
Component: General
3.25.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME To Do maintainer(s)
GNOME To Do maintainer(s)
Depends on:
Blocks: 782980
 
 
Reported: 2017-04-28 16:29 UTC by Iñigo Martínez
Modified: 2017-05-24 19:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Port to meson build system patch (27.33 KB, patch)
2017-04-28 16:29 UTC, Iñigo Martínez
none Details | Review
Added support for gtkdoc generation (3.75 KB, patch)
2017-05-02 14:05 UTC, Iñigo Martínez
none Details | Review
Added support for gschema compilation (1.30 KB, patch)
2017-05-02 14:08 UTC, Iñigo Martínez
none Details | Review
Added support for icon cache update (1.41 KB, patch)
2017-05-02 14:11 UTC, Iñigo Martínez
none Details | Review
Added support for enums schema generation (1.56 KB, patch)
2017-05-02 14:12 UTC, Iñigo Martínez
none Details | Review
Port to meson build system (29.98 KB, patch)
2017-05-02 14:26 UTC, Iñigo Martínez
none Details | Review
Port to meson build system (35.90 KB, patch)
2017-05-05 10:14 UTC, Iñigo Martínez
none Details | Review
Port to meson build system (35.94 KB, patch)
2017-05-05 14:52 UTC, Iñigo Martínez
none Details | Review
Port to meson build system (36.19 KB, patch)
2017-05-17 20:07 UTC, Iñigo Martínez
none Details | Review
Port to meson build system (36.87 KB, patch)
2017-05-21 13:49 UTC, Iñigo Martínez
committed Details | Review

Description Iñigo Martínez 2017-04-28 16:29:10 UTC
Created attachment 350670 [details] [review]
Port to meson build system patch

Almost complete port to build system. It is only missing the following things:

- Documentation generation by using gtkdoc.
- org.gnome.todo.enums.xml file generation.
- gschema compilation on install.
- icon-theme.cache creation.

Documentation generation by using gtkdoc is almost done, but there is a problem when linking with libgtd on install.

There is no proper support for the autotools GLIB_GSETTINGS, but there is a workaround by using a python script[0]. It would help on gschema compilation but probably not with org.gnome.todo.enums.xml

For icon-theme.cache creation, a similar procedure could be valid.

[0] https://github.com/mesonbuild/meson/wiki/Porting-from-autotools#gsettings
Comment 1 Georges Basile Stavracas Neto 2017-05-01 15:16:03 UTC
That's a nice contribution! Of course, I won't merge it until it's actually complete and functional, but I'm really looking forward porting To Do to meson.
Comment 2 Iñigo Martínez 2017-05-02 14:05:29 UTC
Created attachment 350878 [details] [review]
Added support for gtkdoc generation

Add support for documentation generation by using gtkdoc. The support was almost there but required some minor changes.
Comment 3 Iñigo Martínez 2017-05-02 14:08:15 UTC
Created attachment 350880 [details] [review]
Added support for gschema compilation

This patch adds support for compilation of the To Do schema file on install. It does this with the help of an external python script as stated on the meson "Porting from autotools" guide[0].

[0] http://mesonbuild.com/Porting-from-autotools.html#gsettings
Comment 4 Iñigo Martínez 2017-05-02 14:11:10 UTC
Created attachment 350881 [details] [review]
Added support for icon cache update

This patch adds support to create or update the icon cache on install. Similarly as it is done with gschema compilation, this is done with the help of an external python script.
Comment 5 Iñigo Martínez 2017-05-02 14:12:32 UTC
Created attachment 350882 [details] [review]
Added support for enums schema generation

This patch adds support for enums schema generation.
Comment 6 Georges Basile Stavracas Neto 2017-05-02 14:14:29 UTC
Could you please squash all the patches into a single one?
Comment 7 Iñigo Martínez 2017-05-02 14:26:12 UTC
Created attachment 350884 [details] [review]
Port to meson build system

Port to meson build system.
Comment 8 Iñigo Martínez 2017-05-02 14:28:32 UTC
Sure. I was expecting smaller patches to be easier to review. I have squashed them into a single one.
Comment 9 Georges Basile Stavracas Neto 2017-05-04 14:00:02 UTC
Review of attachment 350884 [details] [review]:

The patchset if very good but before I merge it, here are the two things I require:

 - Add a ./configure_meson script that will replace the current ./configure
 - Remove all the tabs from the meson files.
Comment 10 Iñigo Martínez 2017-05-05 10:14:11 UTC
Created attachment 351172 [details] [review]
Port to meson build system

This update adds a configure_meson file based on graphenes configure file and removes the tabs from the src/meson.build file.
Comment 11 Georges Basile Stavracas Neto 2017-05-05 14:22:53 UTC
Review of attachment 351172 [details] [review]:

This is getting in a good shape. I found a few issues with it:

 - Even if I run ./configure_meson --enable-gtk-doc, the documentation is not generated at build time
 - When I run ./configure_meson --prefix /my/home/.local, it tries to install gnome-todo to /bin

That's all I could find. Great job!
Comment 12 Iñigo Martínez 2017-05-05 14:52:03 UTC
Created attachment 351204 [details] [review]
Port to meson build system

- Added implicit installation directory for gnome-todo executable.
- Removed unneeded white spaces on a custom target.
- Change the placement of the associative arrays on the configure_meson script.
- Changed project object definition accordingly to other objects definition.
Comment 13 Iñigo Martínez 2017-05-05 15:00:12 UTC
(In reply to Georges Basile Stavracas Neto from comment #11)
> Review of attachment 351172 [details] [review] [review]:
> 
> This is getting in a good shape. I found a few issues with it:
> 
>  - Even if I run ./configure_meson --enable-gtk-doc, the documentation is
> not generated at build time
>  - When I run ./configure_meson --prefix /my/home/.local, it tries to
> install gnome-todo to /bin
> 
> That's all I could find. Great job!

Both issues are surprising. I've tried them a couple of times whithout issues here.

For the first one, take in account that with meson the generated files are not generared anymore along the source code, they will be placed in the build directory, which should be _build by default using the configure_meson script. You should find it in _build/doc/reference/html.

For the second one, it's true that the install_dir was not specified, but looking at the meson reference, it says the following:

> install_dir override install directory for this file. The value is relative to the prefix specified. F.ex, if you want to install plugins into a subdir, you'd use something like this: install_dir : get_option('libdir') + '/projectname-1.0'.

So using the given prefix, it should install gnome-todo to /my/home/.local/bin by default, which should be ${prefix}/${bindir}. I am wondering if you have any special setting for the bindir variable. Anyway, I've added the install_dir option now.
Comment 14 Georges Basile Stavracas Neto 2017-05-10 20:54:36 UTC
(In reply to Iñigo Martínez from comment #13)

I'm still seeing both issues.

> Both issues are surprising. I've tried them a couple of times whithout
> issues here.

Maybe I'm doing something stupid? How do you run the meson commands? I'm running exactly as follows:

$ ./configure_meson --enable-gtk-doc --prefix <prefix>
Comment 15 Iñigo Martínez 2017-05-11 06:00:20 UTC
I don't know what could be happening. This is my output to your command:

./configure_meson --enable-gtk-doc --prefix /tmp/gnome-todo


        gnome-todo
        ==========

        meson:         /usr/bin/meson
        ninja:         /usr/bin/ninja
        prefix:        /tmp/gnome-todo
        compiler:      
        global flags:    
        nls:           true
        documentation: true

    Plugins:
        Dark theme .............. true
        Run in Background ....... true
        Scheduled panel ......... true
        Score ................... true
        Today panel ............. true
        Unscheduled panel ....... true
        Todo.txt ................ true

        Now type '/usr/bin/ninja -C /home/imartinez/Development/gnome-todo/_build' to build

The Meson build system
Version: 0.40.1
Source dir: /home/imartinez/Development/gnome-todo
Build dir: /home/imartinez/Development/gnome-todo/_build
Build type: native build
Project name: gnome-todo
Native c compiler: cc (gcc 6.3.0)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Has header "dlfcn.h": YES
Has header "inttypes.h": YES
Has header "math.h": YES
Has header "memory.h": YES
Has header "stdint.h": YES
Has header "stdlib.h": YES
Has header "strings.h": YES
Has header "string.h": YES
Has header "sys/stat.h": YES
Has header "sys/types.h": YES
Has header "unistd.h": YES
Checking for function "dcgettext": YES
Checking for function "gettext": YES
Checking for function "iconv": YES
Compiler for c supports argument -ffast-math: YES
Compiler for c supports argument -fstrict-aliasing: YES
Compiler for c supports argument -Wpointer-arith: YES
Compiler for c supports argument -Wmissing-declarations: YES
Compiler for c supports argument -Wformat=2: YES
Compiler for c supports argument -Wstrict-prototypes: YES
Compiler for c supports argument -Wmissing-prototypes: YES
Compiler for c supports argument -Wnested-externs: YES
Compiler for c supports argument -Wold-style-definition: YES
Compiler for c supports argument -Wunused: YES
Compiler for c supports argument -Wuninitialized: YES
Compiler for c supports argument -Wshadow: YES
Compiler for c supports argument -Wmissing-noreturn: YES
Compiler for c supports argument -Wmissing-format-attribute: YES
Compiler for c supports argument -Wredundant-decls: YES
Compiler for c supports argument -Wlogical-op: YES
Compiler for c supports argument -Wcast-align: YES
Compiler for c supports argument -Wno-unused-local-typedefs: YES
Compiler for c supports argument -Werror=implicit: YES
Compiler for c supports argument -Werror=init-self: YES
Compiler for c supports argument -Werror=main: YES
Compiler for c supports argument -Werror=missing-braces: YES
Compiler for c supports argument -Werror=return-type: YES
Compiler for c supports argument -Werror=array-bounds: YES
Compiler for c supports argument -Werror=write-strings: YES
Found pkg-config: /usr/bin/pkg-config (0.29)
Native dependency gmodule-export-2.0 found: YES 2.53.1
Native dependency gio-2.0 found: YES 2.53.1
Native dependency glib-2.0 found: YES 2.53.1
Native dependency goa-1.0 found: YES 3.22.5
Native dependency gtk+-3.0 found: YES 3.22.12
Native dependency libecal-1.2 found: YES 3.22.7
Native dependency libedataserver-1.2 found: YES 3.22.7
Native dependency libedataserverui-1.2 found: YES 3.22.7
Native dependency libical found: YES 2.0
Native dependency libpeas-1.0 found: YES 1.20.0
Library m found: YES
Configuring config.h using configuration
Configuring eds.plugin using configuration
Configuring background.plugin using configuration
Configuring dark-theme.plugin using configuration
Configuring scheduled-panel.plugin using configuration
Configuring score.plugin using configuration
Configuring today-panel.plugin using configuration
Configuring unscheduled-panel.plugin using configuration
Configuring todo-txt.plugin using configuration
Native dependency glib-2.0 found: YES 2.53.1
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Compiler for c supports argument -Wl,--export-dynamic: YES
Compiler for c supports argument -Wl,--undefined=gtd_plugin_eds_register_types: YES
Compiler for c supports argument -Wl,--undefined=gtd_plugin_background_register_types: YES
Compiler for c supports argument -Wl,--undefined=gtd_plugin_dark_theme_register_types: YES
Compiler for c supports argument -Wl,--undefined=gtd_plugin_scheduled_panel_register_types: YES
Compiler for c supports argument -Wl,--undefined=gtd_plugin_today_panel_register_types: YES
Compiler for c supports argument -Wl,--undefined=gtd_plugin_todo_txt_register_types: YES
Program g-ir-scanner found: YES (/usr/bin/g-ir-scanner)
Program g-ir-compiler found: YES (/usr/bin/g-ir-compiler)
Native dependency gobject-introspection-1.0 found: YES 1.51.5
Configuring gnome-todo.pc using configuration
Program msgfmt found: YES (/usr/bin/msgfmt)
Configuring org.gnome.Todo.service using configuration
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program meson_post_install.py found: YES (/usr/bin/env python3 /home/imartinez/Development/gnome-todo/data/meson_post_install.py)
Program meson_post_install.py found: YES (/usr/bin/env python3 /home/imartinez/Development/gnome-todo/data/icons/meson_post_install.py)
Configuring gtkdocentities.ent using configuration
Configuring version.xml using configuration
Build targets in project: 19

If you want to try another setup, the configure_meson file is based on graphene's configure file. You could also try it. By the way, what unix shell are you using?
Comment 16 Iñigo Martínez 2017-05-17 20:07:22 UTC
Created attachment 352046 [details] [review]
Port to meson build system

- Fixed compiler options by using the same compiler options that autotools does.
- Imrproved different meson commands which does improve the build.
Comment 17 Iñigo Martínez 2017-05-21 13:49:11 UTC
Created attachment 352281 [details] [review]
Port to meson build system

Another set of minor improvements:

- Improved configuration file names handling to avoid typos.
- schema dir path reused.
- Reused Glib and GTK dependencies for getting their prefixes.
- Changed glib path for gtk path on extra directories on generating documentation.
- Added MKDB args option.
Comment 18 Georges Basile Stavracas Neto 2017-05-24 19:12:14 UTC
Comment on attachment 352281 [details] [review]
Port to meson build system

This is working very nicely! Thanks for working on such a important feature!
Comment 19 Georges Basile Stavracas Neto 2017-05-24 19:13:20 UTC
Attachment 352281 [details] pushed as 8d71b49 - project: Port to meson build system