Bug 393195 - translations are not installed
Summary: translations are not installed
Status: RESOLVED FIXED
Alias: None
Product: rkward
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: RKWard Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-16 15:52 UTC by Wolfgang Bauer
Modified: 2018-04-18 08:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bauer 2018-04-16 15:52:47 UTC
When I tried to update the openSUSE rkward package to 0.7.0, the build failed because the %find_lang rpm macro suddenly didn't find *any* translations (i.e. rkward.mo).
It still worked fine with the pre-release tarball.

I chased it down to this commit, that apparently broke the installation of the translations:
https://cgit.kde.org/rkward.git/commit/i18n/CMakeLists.txt?h=releases/0.7.0&id=161f8230c5fd5d947981013ef7393827441dcd25
Reverting it fixes the problem (of course most translations are not complete enough to actually get installed, but that's a different story).

It seems that the IF(EXISTS "${_gmoFile}") check doesn't work as expected?
I have the impression that this IF prevents the generation of the .gmo files in the first place...
Comment 1 Thomas Friedrichsmeier 2018-04-16 18:20:25 UTC
Git commit 3554b69362e37d277bbb7f55cbc401f66932fab1 by Thomas Friedrichsmeier.
Committed on 16/04/2018 at 18:19.
Pushed by tfry into branch 'releases/0.7.0'.

Must not quote parameter, here!

M  +2    -2    i18n/CMakeLists.txt

https://commits.kde.org/rkward/3554b69362e37d277bbb7f55cbc401f66932fab1
Comment 2 Thomas Friedrichsmeier 2018-04-16 18:24:30 UTC
Ouch. Thanks for reporting.

For the record, the real culprit is the quotes I added about ${_gmoFile} one commit later in https://cgit.kde.org/rkward.git/commit/i18n/CMakeLists.txt?h=releases/0.7.0&id=68b9fba32fd510203ded51dcb73553ecad7523ba .

I'll try to upload a 0.7.0a with this fix, really soon, but I suppose you will also be able to patch this in your packaging.

(Note: Without the quotes, you get a lot of empty directories for those .mo-file s that got purged for being not complete enough. Of course still better than this...)
Comment 3 Wolfgang Bauer 2018-04-16 19:27:34 UTC
(In reply to Thomas Friedrichsmeier from comment #2)
> For the record, the real culprit is the quotes I added about ${_gmoFile} one
> commit later in
> https://cgit.kde.org/rkward.git/commit/i18n/CMakeLists.txt?h=releases/0.7.
> 0&id=68b9fba32fd510203ded51dcb73553ecad7523ba .

That's what I tried to revert first, but it didn't help.

Only removing the added IF(EXISTS ...) fixes it here.

I'm not a cmake expert, but I assume the .gmo will only be created after the IF, so the INSTALL is never executed...
Another possible fix may be to use execute_process() instead of add_custom_command(), I think.
Comment 4 Thomas Friedrichsmeier 2018-04-16 19:52:53 UTC
Git commit 2364009a4986d354541d7f083d043d5417a87a8e by Thomas Friedrichsmeier.
Committed on 16/04/2018 at 19:52.
Pushed by tfry into branch 'releases/0.7.0'.

Revert "Avoid creating empty directories for purged translations."

This reverts commit 161f8230c5fd5d947981013ef7393827441dcd25.

M  +5    -7    i18n/CMakeLists.txt

https://commits.kde.org/rkward/2364009a4986d354541d7f083d043d5417a87a8e
Comment 5 Thomas Friedrichsmeier 2018-04-16 19:56:02 UTC
You are right, again. The problem turns out to be that IF(EXISTS ...) checks whether the file exists at the time that cmake is run, not at the time of make install. Which it did, when I was testing without a complete wipe of the build directory, but of course not when building from scratch.

Reverting seems like the best option for now, since the only downside is a couple of empty directories in the installation.
Comment 6 Thomas Friedrichsmeier 2018-04-17 10:20:12 UTC
Alright, RKWard 0.7.0b packages have hit the servers, now. These simply revert the commit, as you suggested.

In git master, there is a new attempt at avoiding empty directories, without breaking installation: https://cgit.kde.org/rkward.git/commit/?id=23f685bb2d1eddd1eed2b16bde079c17112f5fdd .

Thanks a lot for reporting! I will try not to mess up as badly for the next release, and especially be much more careful about changes late in release phase.
Comment 7 Wolfgang Bauer 2018-04-17 10:54:52 UTC
(In reply to Thomas Friedrichsmeier from comment #6)
> Alright, RKWard 0.7.0b packages have hit the servers, now. These simply
> revert the commit, as you suggested.

Yes, I saw it 3 hours ago already... ;-)

And I can confirm that 0.7.0b builds fine here and does install the translations.

Haven't tried the new commit in master yet, but will do so later.
Comment 8 Wolfgang Bauer 2018-04-17 20:54:22 UTC
https://cgit.kde.org/rkward.git/commit/?id=23f685bb2d1eddd1eed2b16bde079c17112f5fdd seems to work fine here.
Translations are still installed, empty directories are not created anymore for the too incomplete ones.
Comment 9 Thomas Friedrichsmeier 2018-04-18 08:40:30 UTC
Git commit 134d592a7916e10b1ec0d2a1dbdc9c17b79e523a by Thomas Friedrichsmeier.
Committed on 18/04/2018 at 08:40.
Pushed by tfry into branch 'master'.

Installation destination for translations was not yet correct.

M  +2    -2    i18n/CMakeLists.txt
M  +1    -1    i18n/compile_po.cmake

https://commits.kde.org/rkward/134d592a7916e10b1ec0d2a1dbdc9c17b79e523a