New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Meson #83

Merged
merged 4 commits into from Aug 12, 2018

Conversation

3 participants
@Hjdskes
Owner

Hjdskes commented Feb 25, 2018

This PR removes the Autotools build system for a Meson build system. For anyone watching: please test this and see if everything works as intended. It works on my system and in a Flatpak, so we should be good, but I'll leave this open to gather feedback for a few days.

@Hjdskes Hjdskes force-pushed the meson branch from 49450e4 to 176c7d4 Feb 25, 2018

@julianrichen

This comment has been minimized.

Contributor

julianrichen commented Feb 26, 2018

Install & runs fine for me. The "Compile from source" README instructions need to be updated to Meson.

It's not critical but if no saved colors exists before running it throws an error on first run, program still runs:

$ gcolor3

** (gcolor3:10128): WARNING **: Error reading keys: Key file does not have group “Colors”
#FFFFFF

Probably should go into its own issue #.

@Hjdskes

This comment has been minimized.

Owner

Hjdskes commented Feb 26, 2018

Thanks for testing! I updated the README and opened #84 for the issue.

While looking at the README, I noticed that the translation instructions say to use intltool-update --pot to generate an updated .pot file. Do you know if this is still the recommended way to do this, @julianrichen?

@Hjdskes Hjdskes force-pushed the meson branch from 176c7d4 to 6876083 Feb 26, 2018

@julianrichen

This comment has been minimized.

Contributor

julianrichen commented Feb 26, 2018

@Hjdskes I don't really know about the localization. I know Meson has the i18n.* functions to make translating desktop/XML files easier but I don't believe it has its own intltool-update. So I think it's ok?

@Hjdskes

This comment has been minimized.

Owner

Hjdskes commented Feb 26, 2018

I'm not that familiar with localization either. I know a few years ago there was the initiative to use AM_GNU_GETTEXT instead, see e.g. https://blogs.gnome.org/mclasen/2016/07/21/using-modern-gettext/ and https://blogs.gnome.org/mcatanzaro/2016/07/27/on-the-killing-of-intltool/.

The first link mentions xgettext, but a quick look at its man page does not suggest it is a replacement for intltool-update. I'll ask around on IRC.

@julianrichen

This comment has been minimized.

Contributor

julianrichen commented Feb 26, 2018

https://github.com/mesonbuild/meson/blob/master/docs/markdown/Porting-from-autotools.md#gettext

snippet:

meson.build:

i18n = import('i18n')

gettext_package = 'foo'
add_project_arguments('-DGETTEXT_PACKAGE=' + gettext_package, language: 'c')
subdir('po')

i18n.merge_file(
  input: 'foo.desktop.in',
  output: 'foo.desktop',
  type: 'desktop',
  po_dir: 'po',
  install: true,
  install_dir: join_paths(get_option('datadir'), 'applications')
)

i18n.merge_file(
  input: 'foo.appdata.xml.in',
  output: 'foo.appdata.xml',
  po_dir: 'po',
  install: true,
  install_dir: join_paths(get_option('datadir'), 'appdata')
)

po/meson.build:

i18n.gettext(gettext_package, preset: 'glib')
@Hjdskes

This comment has been minimized.

Owner

Hjdskes commented Feb 26, 2018

Thanks, but I already have those snippets in the Meson build. Concretely, I want to know what tool to use to generate the .pot file, that translators need to make .po files. I'll ask on IRC later today or tomorrow, if you don't beat me to it ;)

@julianrichen

This comment has been minimized.

Contributor

julianrichen commented Feb 26, 2018

Oops, my bad. Did a bit more searching: https://github.com/mesonbuild/meson/blob/master/docs/markdown/Localisation.md

So I guess?

$ ninja intltest-pot

Update .po:

$ ninja intltest-update-po

Determines name from meson.project_name()?

@Hjdskes

This comment has been minimized.

Owner

Hjdskes commented Feb 26, 2018

Thanks! That works lovely :) All that seems to be left now is to go through all .po files and ensure they're correct. I'll do this tomorrow, then we can merge this!

@jtojnar

Can confirm that this works on NixOS.

@@ -30,10 +30,13 @@
"modules": [
{
"name": "gcolor3",
"buildsystem": "meson",
"builddir": true,

This comment has been minimized.

@jtojnar

jtojnar Aug 6, 2018

Mixed tabs and spaces.

"sources": [
{
"type": "git",
"url": "git://github.com/Hjdskes/gcolor3.git"
"url": "git://github.com/Hjdskes/gcolor3.git",
"branch": "meson"

This comment has been minimized.

@jtojnar

jtojnar Aug 6, 2018

Mixed tabs and spaces.

PREFIX=${MESON_INSTALL_PREFIX:-/usr}
# Update icon cache
gtk-update-icon-cache -f -t $PREFIX/share/icons/hicolor

This comment has been minimized.

@jtojnar

jtojnar Aug 6, 2018

This will fail if datadir is changed.

This comment has been minimized.

@Hjdskes

Hjdskes Aug 12, 2018

Owner

Thanks, this should be fixed now.

@@ -0,0 +1 @@
i18n.gettext(meson.project_name(), preset: 'glib')

This comment has been minimized.

@jtojnar

jtojnar Aug 6, 2018

Cool, the lowercasing fixes the metainfo localization.

Hjdskes added some commits Feb 25, 2018

Port to Meson
Fixes #66, #46.

@Hjdskes Hjdskes force-pushed the meson branch from 6876083 to 2a405a6 Aug 12, 2018

@Hjdskes

This comment has been minimized.

Owner

Hjdskes commented Aug 12, 2018

Thanks for all the help with this, @julianrichen and @jtojnar. I'm merging this now, otherwise it'll be open for another couple of months. For any fall out, please open a new issue.

@Hjdskes Hjdskes merged commit 2dfded3 into master Aug 12, 2018

@Hjdskes Hjdskes deleted the meson branch Aug 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment