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 788796 - Port to meson build system
Port to meson build system
Status: RESOLVED OBSOLETE
Product: gitg
Classification: Applications
Component: gitg
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gitg-maint
gitg-maint
Depends on:
Blocks: 782980
 
 
Reported: 2017-10-10 20:49 UTC by Iñigo Martínez
Modified: 2018-05-22 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Port to meson build system (33.72 KB, patch)
2017-10-10 21:09 UTC, Iñigo Martínez
committed Details | Review
build: Follow the new meson porting guidelines (4.03 KB, patch)
2017-11-15 10:24 UTC, Iñigo Martínez
committed Details | Review
build: Change project's default values (1.17 KB, patch)
2017-11-15 10:25 UTC, Iñigo Martínez
committed Details | Review
build: Remove unused defines (2.87 KB, patch)
2017-11-15 10:27 UTC, Iñigo Martínez
committed Details | Review
build: Set prefix relative install_dir for pkgconfig (1.33 KB, patch)
2017-11-15 16:25 UTC, Iñigo Martínez
committed Details | Review

Description Iñigo Martínez 2017-10-10 20:49:32 UTC
meson is a build system focused on speed an ease of use, which helps speeding up the software development.
Comment 1 Iñigo Martínez 2017-10-10 21:09:57 UTC
Created attachment 361292 [details] [review]
Port to meson build system

Patch that adds meson build system along autotools.

It needs meson 0.43.0  that have just been released. Although the meson build system works, there are different issues and some workarounds.

- `libgit2-glib`'s `VAPI` file should be renamed[0].
- `gsettings-desktop-schemas` dependency can't be used properly, because meson tries to resolve its `VAPI` file.
- It misses proper `valadoc` support[1], so it's not supported at the moment.
- GObject-Introspection Typelib object generation, although it's correct, it's not done in a proper way[2].

One main issue is that, although meson supports multiple OS, I've tested the meson build port only in Linux. Win32 and OSX support is in place, though I'm not sure if it works or if it needs some tweaking.

I've also created a wip branch[3] to ease it's testing.

Any suggestion woulde be very appreciated.

[0] https://bugzilla.gnome.org/show_bug.cgi?id=787198
[1] https://github.com/mesonbuild/meson/issues/894
[2] https://github.com/mesonbuild/meson/issues/2296
[3] https://git.gnome.org/browse/gitg/log/?h=wip/inigomartinez/meson
Comment 2 Iñigo Martínez 2017-10-16 08:57:26 UTC
A patch has been submitted[0] to fix the issue regarding `gsettings-desktop-schemas` following the recommendations from meson's contributors[1].

[0] https://bugzilla.gnome.org/show_bug.cgi?id=789045
[1] https://github.com/mesonbuild/meson/issues/1195#issuecomment-335797710
Comment 3 Ignacio Casal Quinteiro (nacho) 2017-10-16 09:06:02 UTC
Review of attachment 361292 [details] [review]:

The patch looks pretty good. Thanks a lot for it.
Comment 4 Iñigo Martínez 2017-10-16 09:13:57 UTC
(In reply to Ignacio Casal Quinteiro (nacho) from comment #3)
> Review of attachment 361292 [details] [review] [review]:
> 
> The patch looks pretty good. Thanks a lot for it.

Thank you for taking the time to review it :)

What do you think about the patch regarding `gsettings-desktop-schemas` VAPI file name?[0]

The patch would allow an even better meson port (I hate having to include a hard coded absolute path in the build files).

[0] https://bugzilla.gnome.org/show_bug.cgi?id=789045
Comment 5 Iñigo Martínez 2017-10-16 11:45:23 UTC
Comment on attachment 361292 [details] [review]
Port to meson build system

Pushed as c876e0e2 - build: Port to meson build system
Comment 6 Iñigo Martínez 2017-10-16 11:48:10 UTC
If you don't mind. I would like leave the bug open, to see how the meson build port evolves, and also until meson supports `valadoc`, which I consider an important missing feature.
Comment 7 Iñigo Martínez 2017-10-16 16:29:12 UTC
While working on `intltool` to `gettext` migration[0], I've noticed that is not doing anything with `osx/build.json.in` file.

Although it's trivial to convert the `build.json.in` input file into `build.json` by replacing `VERSION` and `prefix` tokens with real values, I haven't figured out what the file is for.

Is `osx/scripts/make-bundle` related in any way? I have not been able to get it running.

I also don't have any possibility of checking it on a `OS-X`, this is why I haven't seen this problem before, however if anyone with an `OS-X` could assists me, I could try to get this working somehow. 

[0] https://bugzilla.gnome.org/show_bug.cgi?id=789066
Comment 8 Iñigo Martínez 2017-11-15 10:24:34 UTC
Created attachment 363666 [details] [review]
build: Follow the new meson porting guidelines

Following the new meson porting guidelines[0], this patch renames the build options. The list of changes is as follows:

- Remove the enable prefix from boolean options.
- The character separator from multi-word options has been changed to underscore.

The warning compiler options are also removed because meson's compiler related options should be used.

[0] https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
Comment 9 Iñigo Martínez 2017-11-15 10:25:38 UTC
Created attachment 363667 [details] [review]
build: Change project's default values

The project license has a different license from the one in the source code files: GPL2 in the project's description, and GPL2 or later in the source code files.

The default options for warning level and the no undefined flag when linking have also the default options already used by meson.

This patch fixes the project license and also removes the default options which are already used by meson.
Comment 10 Iñigo Martínez 2017-11-15 10:27:13 UTC
Created attachment 363668 [details] [review]
build: Remove unused defines

meson generates the config.h file with multiple defines to be used as guards, in the same way as autotools does. However, almost all of them are not used.

This patch removes the unused defines.
Comment 11 Ignacio Casal Quinteiro (nacho) 2017-11-15 15:30:12 UTC
Review of attachment 363666 [details] [review]:

Fine for me
Comment 12 Ignacio Casal Quinteiro (nacho) 2017-11-15 15:30:47 UTC
Review of attachment 363667 [details] [review]:

ok
Comment 13 Ignacio Casal Quinteiro (nacho) 2017-11-15 15:31:21 UTC
Review of attachment 363668 [details] [review]:

OK
Comment 14 Ignacio Casal Quinteiro (nacho) 2017-11-15 15:32:47 UTC
Thanks for the patches, since you are at it, any chance you could also have a look at the following modules, since I ported them some time ago and they might need some update? libgit2-glib, glib-openssl, wing and libgxps :)
Comment 15 Iñigo Martínez 2017-11-15 16:25:09 UTC
Created attachment 363706 [details] [review]
build: Set prefix relative install_dir for pkgconfig

While installing seems to have no issues with absolute paths for `install_dir`, the pkgconfig integration in meson does and create wrong library paths in the .pc file.

I have extended the meson issue regarding the paths in the pkgconfig files[0] to also include this problem.

[0] https://github.com/mesonbuild/meson/issues/2469
Comment 16 Iñigo Martínez 2017-11-15 16:27:47 UTC
Comment on attachment 363666 [details] [review]
build: Follow the new meson porting guidelines

Pushed as d56af4d8 - build: Follow the new meson porting guidelines
Comment 17 Ignacio Casal Quinteiro (nacho) 2017-11-15 16:28:51 UTC
Review of attachment 363706 [details] [review]:

this feels to me more like a bug in meson...
Comment 18 Iñigo Martínez 2017-11-15 16:29:58 UTC
Comment on attachment 363667 [details] [review]
build: Change project's default values

Pushed as 98a1498a - build: Change project's default values
Comment 19 Iñigo Martínez 2017-11-15 16:30:53 UTC
Comment on attachment 363668 [details] [review]
build: Remove unused defines

Pushed as c663fb93 - build: Remove unused defines
Comment 20 Iñigo Martínez 2017-11-15 16:37:43 UTC
(In reply to Ignacio Casal Quinteiro (nacho) from comment #17)
> Review of attachment 363706 [details] [review] [review]:
> 
> this feels to me more like a bug in meson...

Yes, it is, and although this patch is not a pure `workaround`, it can be reverted once it's fixed in meson.
Comment 21 Ignacio Casal Quinteiro (nacho) 2017-11-15 16:39:37 UTC
Review of attachment 363706 [details] [review]:

OK
Comment 22 Iñigo Martínez 2017-11-15 16:41:58 UTC
(In reply to Ignacio Casal Quinteiro (nacho) from comment #14)
> Thanks for the patches, since you are at it, any chance you could also have
> a look at the following modules, since I ported them some time ago and they
> might need some update? libgit2-glib, glib-openssl, wing and libgxps :)

I can try to take a look to them, however, at least `libgit2-glib` which is the only one of these that I looked back in the day, seemed to be in quite good shape.
Comment 23 Iñigo Martínez 2017-11-15 16:44:08 UTC
Comment on attachment 363706 [details] [review]
build: Set prefix relative install_dir for pkgconfig

Pushed as 0c4f0dd4 - build: Set prefix-relative install_dir for pkgconfig
Comment 24 Iñigo Martínez 2017-12-11 14:03:32 UTC
(In reply to Iñigo Martínez from comment #23)
> Comment on attachment 363706 [details] [review] [review]
> build: Set prefix relative install_dir for pkgconfig
> 
> Pushed as 0c4f0dd4 - build: Set prefix-relative install_dir for pkgconfig

I had finally fixed this in meson[0] and should be supported in the yesterday's 0.44 release[1] :)

I have been thinking on getting valadoc support in meson[2], which is of the missing features fot gitg which will also allow to remove autotools. However, I have been trying to generate gitg's documentation, but it seems to fail. This is the ouput:

  $ make libgitg-ext-docs
  rm -f libgitg_libgitg_1_0_la_vala.stamp && echo stamp > libgitg_libgitg_1_0_la_vala.stamp-t
  CDPATH="${ZSH_VERSION+.}:" && cd . && /usr/bin/valac --pkg ggit-1.0 --pkg gtk+-3.0 --pkg gio-2.0 --pkg gio-unix-2.0 --pkg gee-0.8 --pkg libsecret-1 --pkg gsettings-desktop-schemas --pkg libsoup-2.4 --pkg gtksourceview-3.0 --pkg gitg-platform-support --pkg ide --target-glib 2.38 -g --vapidir ./vapi --vapidir ./contrib/ide --includedir libgitg --basedir . --gir Gitg-1.0.gir --vapi libgitg/libgitg-1.0.vapi --library libgitg/libgitg-1.0 --header libgitg/libgitg.h --gresources "./libgitg/resources/resources.xml"  -C libgitg/gitg-assembly-info.vala libgitg/gitg-async.vala libgitg/gitg-authentication-dialog.vala libgitg/gitg-avatar-cache.vala libgitg/gitg-branch-base.vala libgitg/gitg-branch.vala libgitg/gitg-cell-renderer-lanes.vala libgitg/gitg-color.vala libgitg/gitg-commit-list-view.vala libgitg/gitg-commit-model.vala libgitg/gitg-commit.vala libgitg/gitg-credentials-manager.vala libgitg/gitg-date.vala libgitg/gitg-diff-stat.vala libgitg/gitg-diff-image-composite.vala libgitg/gitg-diff-image-difference.vala libgitg/gitg-diff-image-overlay.vala libgitg/gitg-diff-image-side-by-side.vala libgitg/gitg-diff-image-slider.vala libgitg/gitg-diff-image-surface-cache.vala libgitg/gitg-diff-view.vala libgitg/gitg-diff-view-file.vala libgitg/gitg-diff-view-file-info.vala libgitg/gitg-diff-view-file-selectable.vala libgitg/gitg-diff-view-file-renderer.vala libgitg/gitg-diff-view-file-renderer-binary.vala libgitg/gitg-diff-view-file-renderer-text.vala libgitg/gitg-diff-view-file-renderer-image.vala libgitg/gitg-diff-view-lines-renderer.vala libgitg/gitg-diff-selectable.vala libgitg/gitg-diff-view-commit-details.vala libgitg/gitg-diff-view-options.vala libgitg/gitg-hook.vala libgitg/gitg-init.vala libgitg/gitg-label-renderer.vala libgitg/gitg-lane.vala libgitg/gitg-lanes.vala libgitg/gitg-progress-bin.vala libgitg/gitg-ref-base.vala libgitg/gitg-ref.vala libgitg/gitg-remote.vala libgitg/gitg-repository-list-box.vala libgitg/gitg-repository.vala libgitg/gitg-resource.vala libgitg/gitg-sidebar.vala libgitg/gitg-stage-status-enumerator.vala libgitg/gitg-stage.vala libgitg/gitg-utils.vala libgitg/gitg-when-mapped.vala
mv -f libgitg_libgitg_1_0_la_vala.stamp-t libgitg_libgitg_1_0_la_vala.stamp
  /usr/bin/valadoc					\
  --directory ./docs		\
  --package-name gitgext				\
  --pkg ggit-1.0 --pkg gio-2.0 --pkg gtk+-3.0 --pkg libsoup-2.4 --pkg gee-0.8	\
  --basedir .				\
  --vapidir ./vapi			\
  --vapidir ./libgitg		\
  libgitg-ext/gitg-ext-action.vala libgitg-ext/gitg-ext-activity.vala libgitg-ext/gitg-ext-application.vala libgitg-ext/gitg-ext-assembly-info.vala libgitg ext/gitg-ext-command-line.vala libgitg-ext/gitg-ext-command-lines.vala libgitg-ext/gitg-ext-commit-action.vala libgitg-ext/gitg-ext-history-panel.vala libgitg-ext/gitg-ext-history.vala libgitg-ext/gitg-ext-message-bus.vala libgitg-ext/gitg-ext-message-id.vala libgitg-ext/gitg-ext-message.vala libgitg-ext/gitg-ext-notification.vala libgitg-ext/gitg-ext-notifications.vala libgitg-ext/gitg-ext-preferences.vala libgitg-ext/gitg-ext-ref-action-interface.vala libgitg-ext/gitg-ext-ref-action.vala libgitg-ext/gitg-ext-remote-lookup.vala libgitg-ext/gitg-ext-searchable.vala libgitg-ext/gitg-ext-selectable.vala libgitg-ext/gitg-ext-ui-element.vala libgitg-ext/gitg-ext-ui.vala libgitg-ext/gitg-ext-user-query.vala libgitg/libgitg-1.0.vapi
gitg-ext-activity.vala:36.5-36.12: error: expected <end-of-line>
    * Returns %TRUE if the activity is the default activity for @action,
    ^^^^^^^                                                            
  Failed: 1 error(s), 0 warning(s)
  Makefile:6827: recipe for target 'libgitg-ext-docs' failed
  make: *** [libgitg-ext-docs] Error 1

I've been trying to generate it using an older version, but I'm limited by one of the library's constraints: `libgit2-glib-1.0 < $LIBGIT2_GLIB_REQUIRED_MAX_VERSION`.

Is there any possibility to get this documentation fixed?

[0] https://github.com/mesonbuild/meson/pull/2632
[1] https://groups.google.com/forum/#!topic/mesonbuild/SMSQHkLJ2RE
[2] https://github.com/mesonbuild/meson/issues/894
Comment 25 Iñigo Martínez 2017-12-11 14:23:21 UTC
Ignore the last commit because I might fixed it. I've submitted a patch in the bug #791480.
Comment 26 GNOME Infrastructure Team 2018-05-22 13:24:52 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gitg/issues/99.