Skip to content
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

Build drawing without gettext and intltool #153

Closed
Vouivre opened this issue Dec 29, 2019 · 7 comments
Closed

Build drawing without gettext and intltool #153

Vouivre opened this issue Dec 29, 2019 · 7 comments
Assignees
Labels
packaging problems or question about the creation/maintenance of packages translations
Milestone

Comments

@Vouivre
Copy link

Vouivre commented Dec 29, 2019

Hello, I would like to test drawing, but I'm unable to build it. I'm using Kiss linux and this distribution is targeted for english, so there is no gettext and intltool. When I build drawing, I get:

The Meson build system
Version: 0.52.1
Source dir: /home/macquat/.cache/kiss/build-17660/drawing
Build dir: /home/macquat/.cache/kiss/build-17660/drawing/build
Build type: native build
Project name: drawing
Project version: 0.4.10
Host machine cpu family: x86_64
Host machine cpu: x86_64
WARNING: Gettext not found, all translation targets will be ignored.

data/meson.build:1:0: ERROR: Tried to assign an invalid value to variable.

Would it be possible to add a configure option to meson to disable translation ? And before it's done, I could patch the meson.build, but I don't know which part to delete.

Thank you!

@maoschanz maoschanz added the packaging problems or question about the creation/maintenance of packages label Dec 29, 2019
@maoschanz
Copy link
Owner

this distribution is targeted for english

that sounds quite absurd

I don't know which part to delete

i think what fails is the generation of the translated .desktop file (in data/meson.build, the instruction beginning line 1). It's code from GNOME Builder's initial "hello world" app so i don't know how to fix it, i've never read meson's doc. The file com.github.maoschanz.drawing.desktop.in contains everything needed for an untranslated package, i guess renaming it and using something like

install_data(
	'com.github.maoschanz.drawing.desktop',
	install_dir: join_paths(get_option('datadir'), 'applications'
)

should kinda work.

Then the line 15 will fail again, but that's the appdata.xml file used by GNOME Software, Plasma Discover, etc. so you probably consider it bloated and don't care

@Vouivre
Copy link
Author

Vouivre commented Dec 30, 2019

this distribution is targeted for english

that sounds quite absurd

Ok, it's not exact, it was to simplify. The dev has created a distribution with simplicity in mind. And to simplify, english is the default language. Each user can package the necessary software for the translation, but they are not in the main repository. A user can also package the necessary softwares for the community of Kiss Linux.

Thank you for your help. I had a look again at my build instructions and with your help I created the following patch:

Only in b: data/.meson.build.un~
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,24 +1,7 @@
-desktop_file = i18n.merge_file(
-	input: 'com.github.maoschanz.drawing.desktop.in',
-	output: 'com.github.maoschanz.drawing.desktop',
-	type: 'desktop',
-	po_dir: '../po',
-	install: true,
-	install_dir: join_paths(get_option('datadir'), 'applications')
-)
-
 desktop_utils = find_program('desktop-file-validate', required: false)
 if desktop_utils.found()
 	test('Validate desktop file', desktop_utils, args: [desktop_file])
 endif
-
-appstream_file = i18n.merge_file(
-	input: 'com.github.maoschanz.drawing.appdata.xml.in',
-	output: 'com.github.maoschanz.drawing.appdata.xml',
-	po_dir: '../po',
-	install: true,
-	install_dir: join_paths(get_option('datadir'), 'metainfo')
-)
 
 appstream_util = find_program('appstream-util', required: false)
 if appstream_util.found()
Only in b: data/meson.build~

It compiles without problems, I'm just unable to start it, because python modules are missing, but that point must be discussed in the community of Kiss Linux.

What remains:

  • if I package your software, would it be possible to implement a configure option instead of maintaining a patch ? Ok, probably, the patch won't change soon!
  • After the installation, the files are installed in /usr/local instead of /usr. For example, the binary is /usr/local/bin/drawing. Is something wrong in my package or is in the build instructions of drawing ?
    For the moment, I don't know very well meson and ninja, I can use them, that's all. Here is my build:
meson build
DESTDIR="$1" ninja -C build install

@maoschanz
Copy link
Owner

do you really get the .desktop file installed with this patch?

if I package your software, would it be possible to implement a configure option instead of maintaining a patch?

once you'll know meson better than me (it shouldn't be long) you can implement it yourself, if it works i'll merge it

After the installation, the files are installed in /usr/local instead of /usr. For example, the binary is /usr/local/bin/drawing. Is something wrong in my package or is in the build instructions of drawing ?

as i said the existing meson.build files are from GNOME Builder's "hello world", and are thus designed to work with flatpak, where it's not an issue. If it's not normal when installing it as a native package (after a little googling it is indeed weird and should be fixed), change the value of this option in build-aux/meson/postinstall.py

@Vouivre
Copy link
Author

Vouivre commented Dec 30, 2019

do you really get the .desktop file installed with this patch?

No, good remark. But in fact I don't need it and unless somebody needs it, for the moment it will be enough. As I remember, it's necessary for desktop environment like KDE, Gnome or other or to use with xdg-open. But I use none of them. But for packaging it in Kiss, it could be necessary for xdg-open. Perhaps I forget a use case for the desktop file.

if I package your software, would it be possible to implement a configure option instead of maintaining a patch?

once you'll know meson better than me (it shouldn't be long) you can implement it yourself, if it works i'll merge it

Ok, I'll test your software and then I'll have a look. For the moment, a patch is enough.

After the installation, the files are installed in /usr/local instead of /usr. For example, the binary is /usr/local/bin/drawing. Is something wrong in my package or is in the build instructions of drawing ?

as i said the existing meson.build files are from GNOME Builder's "hello world", and are thus designed to work with flatpak, where it's not an issue. If it's not normal when installing it as a native package (after a little googling it is indeed weird and should be fixed), change the value of this option in build-aux/meson/postinstall.py

Ok, thank you for the information. I'll test your software and if I package it for Kiss, I'll have a look to modify the path. Can you keep this issue open until I have tested drawing ? It won't be long, it's just to check the features I need in such a software. And perhaps ask you which improvments can be made ;-).

@maoschanz
Copy link
Owner

i'll keep it opened until someone from another distro complains about /usr/local/

@maoschanz
Copy link
Owner

also, i don't know what exactly you're building, but be careful, 0.4.x released versions are on another branch, master is not stable at all

@Vouivre
Copy link
Author

Vouivre commented Dec 31, 2019

I built the 0.4.10 version. I need to think about it, I have a problem with the dependencies, and not sure if I can package it easily. I have to have a better look, some gir-gtk files were missing (don't remember exactly. I will manage to package drawing, but I could have some problems with other packages on my system after that. I'll have a closer look and I will tell you if I managed or not. Thank you for everything!

@maoschanz maoschanz added this to the 1.0.0 milestone Mar 6, 2021
@maoschanz maoschanz self-assigned this May 1, 2021
maoschanz added a commit that referenced this issue May 1, 2021
@maoschanz maoschanz modified the milestones: 1.0.0, 0.8 Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging problems or question about the creation/maintenance of packages translations
Projects
None yet
Development

No branches or pull requests

2 participants