diff mbox series

[bug#38436] gnu: Add gfortran-toolchain

Message ID 87zhg1efld.fsf@gnu.org
State Accepted
Headers show
Series [bug#38436] gnu: Add gfortran-toolchain | expand

Commit Message

Ludovic Courtès Dec. 9, 2019, 2:30 p.m. UTC
Hi Konrad,

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

> * gnu/packages/commencement.scm: (gfortran-toolchain): New variable.
> * gnu/packages/commencement.scm: (make-gcc-toolchain): Added argument "language"

This LGTM, though I’d have a minor request:

> -      (synopsis "Complete GCC tool chain for C/C++ development")
> +      (synopsis (format #f
> +                        "Complete GCC tool chain for ~a development"
> +                        language))
>        (description
> -       "This package provides a complete GCC tool chain for C/C++ development to
> -be   installed in user profiles.  This includes GCC, as well as libc (headers
> -an  d binaries, plus debugging symbols in the @code{debug} output), and Binutils.")
> +       (format
> +        #f
> +        "This package provides a complete GCC tool chain for ~a development to
> +be installed in user profiles.  This includes GCC, as well as libc (headers
> +and binaries, plus debugging symbols in the @code{debug} output), and Binutils."
> +        language))

There’s this weird requirement that for the sake of i18n, we must not
construct synopses/descriptions like this:

  https://guix.gnu.org/manual/devel/en/html_node/Synopses-and-Descriptions.html

I’d suggest something as shown below.

Could you update the patch along those lines?

Thanks,
Ludo’.

Comments

Konrad Hinsen Dec. 10, 2019, 1:11 p.m. UTC | #1
Hi Ludo,

> There’s this weird requirement that for the sake of i18n, we must not
> construct synopses/descriptions like this:
>
>   https://guix.gnu.org/manual/devel/en/html_node/Synopses-and-Descriptions.html

Is that a specific rule for Guix? GNU gettext allows format strings,
and its manual refers to

  https://people.csail.mit.edu/jaffer/slib/Format-Specification.html

for format string syntax in Scheme. For Guile specifically,
it refers to (ice-9 format).

Cheers,
  Konrad
Ludovic Courtès Dec. 10, 2019, 2:38 p.m. UTC | #2
Hi,

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

>> There’s this weird requirement that for the sake of i18n, we must not
>> construct synopses/descriptions like this:
>>
>>   https://guix.gnu.org/manual/devel/en/html_node/Synopses-and-Descriptions.html
>
> Is that a specific rule for Guix?

Specific to the ‘guix-package’ domain, even.

Concretely, the idea is that <package> objects carry the untranslated
English-language synopsis and description.  This is useful for things
like ‘guix search’ or for web page generators, because they can query
translation explicitly when they need it.

We could allow constructed strings in there, like this:

  (package
    ;; …
    (synopsis (format #f (G_ "This is a ~a compiler") "C")))

But in that case, we’d have to perform translation right in the ‘G_’
call, and thus <package> would end up carrying a translated string.

So far we’ve managed to avoid that, it’s a constraint, but hopefully one
we can live with.

I hope that makes sense!

Ludo’.
Konrad Hinsen Dec. 11, 2019, 10:30 a.m. UTC | #3
Hi Ludo,

>> Is that a specific rule for Guix?
>
> Specific to the ‘guix-package’ domain, even.

Thanks for the explanation! That all makes sense, it's just not very
obvious.

I'll send a revised patch in which all synopses and descriptions are
literal string.

Cheers,
  Konrad.
diff mbox series

Patch

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 68030376fc..00de771bc4 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2523,8 +2523,12 @@  COREUTILS-FINAL vs. COREUTILS, etc."
 ;; (define-public gcc-glibc-2.27-toolchain
 ;;   (make-gcc-toolchain gcc glibc-2.27))
 
-(define* (make-gcc-toolchain gcc
+(define* (make-gcc-toolchain language gcc
                              #:optional
+                             ;; Note: Keep the synopsis literal string here so
+                             ;; that xgettext "sees" it.
+                             (synopsis
+                              "Complete GCC tool chain for C/C++ development")
                              (libc #f))
   "Return a complete toolchain for GCC. If LIBC is specified, target that libc."
   (let ((gcc (if libc (make-gcc-libc gcc libc) gcc))
@@ -2559,7 +2563,7 @@  COREUTILS-FINAL vs. COREUTILS, etc."
       (search-paths (package-search-paths gcc))
 
       (license (package-license gcc))
-      (synopsis "Complete GCC tool chain for C/C++ development")
+      (synopsis synopsis)
       (description
        "This package provides a complete GCC tool chain for C/C++ development to
 be   installed in user profiles.  This includes GCC, as well as libc (headers