Poedit fails to open PO files

  • Open
  • quality assurance status badge
Details
2 participants
  • Luis Felipe
  • (
Owner
unassigned
Submitted by
Luis Felipe
Severity
normal
L
L
Luis Felipe wrote on 24 Sep 2022 21:02
(name . Luis Felipe via Bug reports for GNU Guix)(address . bug-guix@gnu.org)
QpU9D0kpu_e0FL6Vtc2lBa14StqA4kE6533n1XBDNfY76GiIxAUt0wai_od13ucnRG_QVRUXw2JVRcrCzFYdruYqrGwmNfoGs5OVP0evVro=@protonmail.com
STEPS TO REPRODUCE

1. Launch Poedit
2. Open the attached PO file (guix-website-es.po)


EXPECTED RESULT

? Poedit displays the catalog correctly


UNEXPECTED RESULT

? The catalog is not displayed. Instead you see an error:

Poedit Error: Unhandled exception occurred: Cannot execute program: msgfmt -o /dev/null -c "/path/to/guix-website-es.po"


WORKAROUND

Start Poedit in a guix shell that adds gettext:

guix shell poedit gettext
poedit

Then, you can open the PO files normally.

So it seems the package definition for Poedit is missing gettext as a run-time dependency (?).


SYSTEM INFO

Guix System (guix 77e768a)

Poedit 2.2.4




---
Luis Felipe López Acevedo
Attachment: guix-website-es.po
Attachment: signature.asc
(
CN4VMLVVFQWG.1QX02ALFLRU4I@guix-aspire
On Sat Sep 24, 2022 at 8:02 PM BST, Luis Felipe via Bug reports for GNU Guix wrote:
Toggle quote (11 lines)
> WORKAROUND
>
> Start Poedit in a guix shell that adds gettext:
>
> guix shell poedit gettext
> poedit
>
> Then, you can open the PO files normally.
>
> So it seems the package definition for Poedit is missing gettext as a run-time dependency (?).

What might be referred to as a "run-time dependency" is called a
"propagated input" in Guix, where a dependency of X is installed
whenever X itself is installed. They are generally considered
undesirable and should be avoided, so when we're faced with this
sort of problem we usually do:

(inputs (list gettext))

and add a phase:

(add-after 'unpack 'patch-invocations
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "src/foo/bar.c"
(("\"msgfmt\"")
(string-append
"\""
(search-input-file inputs "bin/msgfmt")
"\"")))))

-- (
L
L
Luis Felipe wrote on 25 Sep 2022 15:14
(name . ()(address . paren@disroot.org)(address . 58046@debbugs.gnu.org)
aSXVl4qt85xEgN_CyCddjtO6Pt8UaKUu8XkFMoKhx5oeG6vAx8QPtHyWstPr13Eu74M_XBk3pmzVWAgGPVOFOAAXSv7f6rqV1G8QkCqqOoM=@protonmail.com
On Saturday, September 24th, 2022 at 19:25, ( <paren@disroot.org> wrote:

Toggle quote (24 lines)
>

> What might be referred to as a "run-time dependency" is called a
> "propagated input" in Guix, where a dependency of X is installed
> whenever X itself is installed. They are generally considered
> undesirable and should be avoided, so when we're faced with this
> sort of problem we usually do:
>

> (inputs (list gettext))
>

> and add a phase:
>

> (add-after 'unpack 'patch-invocations
> (lambda* (#:key inputs #:allow-other-keys)
> (substitute* "src/foo/bar.c"
> (("\"msgfmt\"")
> (string-append
> "\""
> (search-input-file inputs "bin/msgfmt")
> "\"")))))

Thanks, (, I'll try to patch it.
Attachment: signature.asc
?