unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38436] [PATCH] gnu; Add gfortran-toolchain
@ 2019-11-29 17:46 Konrad Hinsen
  2019-12-02 15:01 ` [bug#38436] [PATCH] gnu: " Konrad Hinsen
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Konrad Hinsen @ 2019-11-29 17:46 UTC (permalink / raw)
  To: 38436

* gnu/packages/commencement.scm: (gfortran-toolchain): New variable.
* gnu/packages/commencement.scm: (make-gcc-toolchain): Added argument "language"
---
 gnu/packages/commencement.scm | 52 +++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 6a382c7517..8c57af749e 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2515,16 +2515,23 @@ COREUTILS-FINAL vs. COREUTILS, etc."
 ;;; GCC toolchain.
 ;;;
 
+;;; Toolchain packages combine everything needed for compilation,
+;;; and ensure that ld-wrapper comes before binutils' ld in the
+;;; user's profile, as otherwise dynamic library lookup would not
+;;; work correctly.
+
 ;; Using the following procedure, a gcc toolchain targeting glibc-2.27 can be
 ;; instantiated like this:
 ;;
 ;; (define-public gcc-glibc-2.27-toolchain
 ;;   (make-gcc-toolchain gcc glibc-2.27))
 
-(define* (make-gcc-toolchain gcc
-                            #:optional
-                            (libc #f))
-  "Return a complete toolchain for GCC. If LIBC is specified, target that libc."
+(define* (make-gcc-toolchain language
+                             gcc
+                             #:optional
+                             (libc #f))
+  "Return a complete toolchain for GCC. If LIBC is specified, target that libc.
+  Insert LANGUAGE into the documentation strings."
   (let ((gcc (if libc (make-gcc-libc gcc libc) gcc))
         (libc (if libc libc glibc-final)))
     (package
@@ -2557,17 +2564,19 @@ 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 (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))
       (home-page "https://gcc.gnu.org/")
       (outputs '("out" "debug" "static"))
 
-      ;; The main raison d'être of this "meta-package" is (1) to conveniently
-      ;; install everything that we need, and (2) to make sure ld-wrapper comes
-      ;; before Binutils' ld in the user's profile.
       (inputs `(("gcc" ,gcc)
                 ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper")))
                 ("binutils" ,binutils-final)
@@ -2576,27 +2585,34 @@ an  d binaries, plus debugging symbols in the @code{debug} output), and Binutils
                 ("libc-static" ,libc "static"))))))
 
 (define-public gcc-toolchain
-  (make-gcc-toolchain gcc-final))
+  (make-gcc-toolchain "C/C++" gcc-final))
 
 (define-public gcc-toolchain-4.8
-  (make-gcc-toolchain gcc-4.8))
+  (make-gcc-toolchain "C/C++" gcc-4.8))
 
 (define-public gcc-toolchain-4.9
-  (make-gcc-toolchain gcc-4.9))
+  (make-gcc-toolchain "C/C++" gcc-4.9))
 
 (define-public gcc-toolchain-5
-  (make-gcc-toolchain gcc-5))
+  (make-gcc-toolchain "C/C++" gcc-5))
 
 (define-public gcc-toolchain-6
-  (make-gcc-toolchain gcc-6))
+  (make-gcc-toolchain "C/C++" gcc-6))
 
 (define-public gcc-toolchain-7
   gcc-toolchain)
 
 (define-public gcc-toolchain-8
-  (make-gcc-toolchain gcc-8))
+  (make-gcc-toolchain "C/C++" gcc-8))
 
 (define-public gcc-toolchain-9
-  (make-gcc-toolchain gcc-9))
+  (make-gcc-toolchain "C/C++" gcc-9))
+
+;; Provide the toolchain package only for the version of gfortran
+;; that is used by Guix intenally to build Fortran libraries,
+;; because combining code compiled with different versions can
+;; cause problems.
+(define-public gfortran-toolchain
+  (make-gcc-toolchain "Fortran" gfortran))
 
 ;;; commencement.scm ends here
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-11-29 17:46 [bug#38436] [PATCH] gnu; Add gfortran-toolchain Konrad Hinsen
@ 2019-12-02 15:01 ` Konrad Hinsen
  2019-12-09 14:30   ` Ludovic Courtès
  2019-12-11 10:30 ` Konrad Hinsen
  2019-12-13 12:53 ` Konrad Hinsen
  2 siblings, 1 reply; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-02 15:01 UTC (permalink / raw)
  To: 38436

* gnu/packages/commencement.scm: (gfortran-toolchain): New variable.
* gnu/packages/commencement.scm: (make-gcc-toolchain): Added argument "language"
---
 gnu/packages/commencement.scm | 52 +++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 6a382c7517..8c57af749e 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2515,16 +2515,23 @@ COREUTILS-FINAL vs. COREUTILS, etc."
 ;;; GCC toolchain.
 ;;;

+;;; Toolchain packages combine everything needed for compilation,
+;;; and ensure that ld-wrapper comes before binutils' ld in the
+;;; user's profile, as otherwise dynamic library lookup would not
+;;; work correctly.
+
 ;; Using the following procedure, a gcc toolchain targeting glibc-2.27 can be
 ;; instantiated like this:
 ;;
 ;; (define-public gcc-glibc-2.27-toolchain
 ;;   (make-gcc-toolchain gcc glibc-2.27))

-(define* (make-gcc-toolchain gcc
-                            #:optional
-                            (libc #f))
-  "Return a complete toolchain for GCC. If LIBC is specified, target that libc."
+(define* (make-gcc-toolchain language
+                             gcc
+                             #:optional
+                             (libc #f))
+  "Return a complete toolchain for GCC. If LIBC is specified, target that libc.
+  Insert LANGUAGE into the documentation strings."
   (let ((gcc (if libc (make-gcc-libc gcc libc) gcc))
         (libc (if libc libc glibc-final)))
     (package
@@ -2557,17 +2564,19 @@ 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 (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))
       (home-page "https://gcc.gnu.org/")
       (outputs '("out" "debug" "static"))

-      ;; The main raison d'être of this "meta-package" is (1) to conveniently
-      ;; install everything that we need, and (2) to make sure ld-wrapper comes
-      ;; before Binutils' ld in the user's profile.
       (inputs `(("gcc" ,gcc)
                 ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper")))
                 ("binutils" ,binutils-final)
@@ -2576,27 +2585,34 @@ an  d binaries, plus debugging symbols in the @code{debug} output),
and Binutils
                 ("libc-static" ,libc "static"))))))

 (define-public gcc-toolchain
-  (make-gcc-toolchain gcc-final))
+  (make-gcc-toolchain "C/C++" gcc-final))

 (define-public gcc-toolchain-4.8
-  (make-gcc-toolchain gcc-4.8))
+  (make-gcc-toolchain "C/C++" gcc-4.8))

 (define-public gcc-toolchain-4.9
-  (make-gcc-toolchain gcc-4.9))
+  (make-gcc-toolchain "C/C++" gcc-4.9))

 (define-public gcc-toolchain-5
-  (make-gcc-toolchain gcc-5))
+  (make-gcc-toolchain "C/C++" gcc-5))

 (define-public gcc-toolchain-6
-  (make-gcc-toolchain gcc-6))
+  (make-gcc-toolchain "C/C++" gcc-6))

 (define-public gcc-toolchain-7
   gcc-toolchain)

 (define-public gcc-toolchain-8
-  (make-gcc-toolchain gcc-8))
+  (make-gcc-toolchain "C/C++" gcc-8))

 (define-public gcc-toolchain-9
-  (make-gcc-toolchain gcc-9))
+  (make-gcc-toolchain "C/C++" gcc-9))
+
+;; Provide the toolchain package only for the version of gfortran
+;; that is used by Guix intenally to build Fortran libraries,
+;; because combining code compiled with different versions can
+;; cause problems.
+(define-public gfortran-toolchain
+  (make-gcc-toolchain "Fortran" gfortran))

 ;;; commencement.scm ends here
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-02 15:01 ` [bug#38436] [PATCH] gnu: " Konrad Hinsen
@ 2019-12-09 14:30   ` Ludovic Courtès
  2019-12-10 13:11     ` Konrad Hinsen
  0 siblings, 1 reply; 16+ messages in thread
From: Ludovic Courtès @ 2019-12-09 14:30 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 38436

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

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’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1308 bytes --]

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-09 14:30   ` Ludovic Courtès
@ 2019-12-10 13:11     ` Konrad Hinsen
  2019-12-10 14:38       ` Ludovic Courtès
  0 siblings, 1 reply; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-10 13:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38436

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-10 13:11     ` Konrad Hinsen
@ 2019-12-10 14:38       ` Ludovic Courtès
  2019-12-11 10:30         ` Konrad Hinsen
  0 siblings, 1 reply; 16+ messages in thread
From: Ludovic Courtès @ 2019-12-10 14:38 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 38436

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’.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-10 14:38       ` Ludovic Courtès
@ 2019-12-11 10:30         ` Konrad Hinsen
  0 siblings, 0 replies; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-11 10:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38436

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.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-11-29 17:46 [bug#38436] [PATCH] gnu; Add gfortran-toolchain Konrad Hinsen
  2019-12-02 15:01 ` [bug#38436] [PATCH] gnu: " Konrad Hinsen
@ 2019-12-11 10:30 ` Konrad Hinsen
  2019-12-11 11:12   ` Ludovic Courtès
  2019-12-13 12:53 ` Konrad Hinsen
  2 siblings, 1 reply; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-11 10:30 UTC (permalink / raw)
  To: 38436

* gnu/packages/commencement.scm: (gfortran-toolchain): New variable.
* gnu/packages/commencement.scm: (make-gcc-toolchain): Added argument "language"
---
 gnu/packages/commencement.scm | 54 ++++++++++++++++++++++++-----------
 1 file changed, 38 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 68030376fc..e147836fc5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2517,16 +2517,29 @@ COREUTILS-FINAL vs. COREUTILS, etc."
 ;;; GCC toolchain.
 ;;;
 
-;; Using the following procedure, a gcc toolchain targeting glibc-2.27 can be
-;; instantiated like this:
-;;
-;; (define-public gcc-glibc-2.27-toolchain
-;;   (make-gcc-toolchain gcc glibc-2.27))
+;;; Toolchain packages combine everything needed for compilation,
+;;; and ensure that ld-wrapper comes before binutils' ld in the
+;;; user's profile, as otherwise dynamic library lookup would not
+;;; work correctly.
+
+;; The synopsis and description must be literal strings (not constructed
+;; using string-append or format) to make them translatable.
+(define gcc-synopsis
+  "Complete GCC tool chain for C/C++ development")
+(define gcc-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
+and binaries, plus debugging symbols in the @code{debug} output), and
+binutils.")
 
 (define* (make-gcc-toolchain gcc
-                            #:optional
-                            (libc #f))
-  "Return a complete toolchain for GCC. If LIBC is specified, target that libc."
+                             #:optional
+                             (synopsis gcc-synopsis)
+                             (description gcc-description)
+                             (libc #f))
+  "Return a complete toolchain for GCC.  If SYNOPSIS and/or
+DESCRIPTION are given, use them for documentation instead of the
+defaults for the C/C++ toolchain. If LIBC is specified, target that libc."
   (let ((gcc (if libc (make-gcc-libc gcc libc) gcc))
         (libc (if libc libc glibc-final)))
     (package
@@ -2559,17 +2572,11 @@ COREUTILS-FINAL vs. COREUTILS, etc."
       (search-paths (package-search-paths gcc))
 
       (license (package-license gcc))
-      (synopsis "Complete GCC tool chain for C/C++ development")
-      (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.")
+      (synopsis synopsis)
+      (description description)
       (home-page "https://gcc.gnu.org/")
       (outputs '("out" "debug" "static"))
 
-      ;; The main raison d'être of this "meta-package" is (1) to conveniently
-      ;; install everything that we need, and (2) to make sure ld-wrapper comes
-      ;; before Binutils' ld in the user's profile.
       (inputs `(("gcc" ,gcc)
                 ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper")))
                 ("binutils" ,binutils-final)
@@ -2601,4 +2608,19 @@ an  d binaries, plus debugging symbols in the @code{debug} output), and Binutils
 (define-public gcc-toolchain-9
   (make-gcc-toolchain gcc-9))
 
+;; Provide the Fortran toolchain package only for the version of gfortran that
+;; is used by Guix intenally to build Fortran libraries, because combining
+;; code compiled with different versions can cause problems.
+
+(define gfortran-synopsis
+  "Complete GCC tool chain for Fortran development")
+(define gfortran-description
+  "This package provides a complete GCC tool chain for Fortran 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.")
+
+(define-public gfortran-toolchain
+  (make-gcc-toolchain gfortran gfortran-synopsis gfortran-description))
+
 ;;; commencement.scm ends here
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-11 10:30 ` Konrad Hinsen
@ 2019-12-11 11:12   ` Ludovic Courtès
  2019-12-11 20:34     ` Konrad Hinsen
  0 siblings, 1 reply; 16+ messages in thread
From: Ludovic Courtès @ 2019-12-11 11:12 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 38436

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"

We’re almost there.  :-)

> +;; The synopsis and description must be literal strings (not constructed
> +;; using string-append or format) to make them translatable.
> +(define gcc-synopsis
> +  "Complete GCC tool chain for C/C++ development")
> +(define gcc-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
> +and binaries, plus debugging symbols in the @code{debug} output), and
> +binutils.")
>  
>  (define* (make-gcc-toolchain gcc
> -                            #:optional
> -                            (libc #f))
> -  "Return a complete toolchain for GCC. If LIBC is specified, target that libc."
> +                             #:optional
> +                             (synopsis gcc-synopsis)
> +                             (description gcc-description)

xgettext recognizes (synopsis "foo"), but it won’t catch the variables
defined above, because they’re not preceded by the ‘synopsis’ keyword or
anything.

That’s why I proposed in <https://issues.guix.gnu.org/issue/38436#2> to
arrange to keep the string wrapped in (synopsis …).

It’d be great if you could give it a spin, or I can make the change on
your behalf if you prefer.

Apologies for making something simple somewhat complicated!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-11 11:12   ` Ludovic Courtès
@ 2019-12-11 20:34     ` Konrad Hinsen
  2019-12-12 13:20       ` Ludovic Courtès
  0 siblings, 1 reply; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-11 20:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38436

Hi Ludo,

> xgettext recognizes (synopsis "foo"), but it won’t catch the variables
> defined above, because they’re not preceded by the ‘synopsis’ keyword or
> anything.

OK, so what's the exact rule? If the literal string has to be right
after the symbol "synopsis", then your optional-arg approach shouldn't
work when the argument is supplied at the call site (in
gfortran-toolchain).

That would still leave the option of doing something like

  (define-public gfortran-toolchain
   (package (inherit (make-gcc-toolchain gfortran))
     (synopsis ...)
     (description ...)

Cheers,
  Konrad.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-11 20:34     ` Konrad Hinsen
@ 2019-12-12 13:20       ` Ludovic Courtès
  2019-12-12 15:19         ` Konrad Hinsen
  0 siblings, 1 reply; 16+ messages in thread
From: Ludovic Courtès @ 2019-12-12 13:20 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 38436

Hi Konrad,

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

>> xgettext recognizes (synopsis "foo"), but it won’t catch the variables
>> defined above, because they’re not preceded by the ‘synopsis’ keyword or
>> anything.
>
> OK, so what's the exact rule? If the literal string has to be right
> after the symbol "synopsis", then your optional-arg approach shouldn't
> work when the argument is supplied at the call site (in
> gfortran-toolchain).

Good point!

The exact rule is given the the ‘--keyword’ options in
po/packages/Makevars.  Namely, xgettext will recognize:

  (synopsis "…")

Thus, something like:

  (define* (foo #:key (synopsis "…"))
    …)

works.

Now, for gfortran, you could resort to a not-so-fancy hack (used in
‘define-word-list-dictionary’ in (gnu packages aspell)) like this:

  (let-syntax ((synopsis (syntax-rules () ((_ str) str))))
    (make-gcc-toolchain gfortran #:synopsis (synopsis "…")))

Quite an effort for this little thing, but I couldn’t find of anything
simpler.

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-12 13:20       ` Ludovic Courtès
@ 2019-12-12 15:19         ` Konrad Hinsen
  2019-12-12 21:22           ` Ludovic Courtès
  0 siblings, 1 reply; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-12 15:19 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38436

Hi Ludo,

> The exact rule is given the the ‘--keyword’ options in
> po/packages/Makevars.  Namely, xgettext will recognize:

Great, good to know!

>   (let-syntax ((synopsis (syntax-rules () ((_ str) str))))
>     (make-gcc-toolchain gfortran #:synopsis (synopsis "…")))
>
> Quite an effort for this little thing, but I couldn’t find of anything
> simpler.

It looks like I still don't understand how this works. Why wouldn't
the simpler

   (let ((synopsis (lambda (_) _)))
     (make-gcc-toolchain gfortran #:synopsis (synopsis "…")))

be sufficient? And is there a good reason to prefer such constructs
to

  (define-public gfortran-toolchain
   (package (inherit (make-gcc-toolchain gfortran))
     (synopsis ...)
     (description ...)

which I think expresses the intention more clearly?

Cheers,
  Konrad

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-12 15:19         ` Konrad Hinsen
@ 2019-12-12 21:22           ` Ludovic Courtès
  2019-12-13 12:56             ` Konrad Hinsen
  0 siblings, 1 reply; 16+ messages in thread
From: Ludovic Courtès @ 2019-12-12 21:22 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 38436

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

>>   (let-syntax ((synopsis (syntax-rules () ((_ str) str))))
>>     (make-gcc-toolchain gfortran #:synopsis (synopsis "…")))
>>
>> Quite an effort for this little thing, but I couldn’t find of anything
>> simpler.
>
> It looks like I still don't understand how this works. Why wouldn't
> the simpler
>
>    (let ((synopsis (lambda (_) _)))
>      (make-gcc-toolchain gfortran #:synopsis (synopsis "…")))

Ah yes, that would work too.

> be sufficient? And is there a good reason to prefer such constructs
> to
>
>   (define-public gfortran-toolchain
>    (package (inherit (make-gcc-toolchain gfortran))
>      (synopsis ...)
>      (description ...)
>
> which I think expresses the intention more clearly?

Oh I guess I had overlooked this proposal, I agree that it’s nicer.

Apologies for the confusion!

Ludo’.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-11-29 17:46 [bug#38436] [PATCH] gnu; Add gfortran-toolchain Konrad Hinsen
  2019-12-02 15:01 ` [bug#38436] [PATCH] gnu: " Konrad Hinsen
  2019-12-11 10:30 ` Konrad Hinsen
@ 2019-12-13 12:53 ` Konrad Hinsen
  2019-12-13 12:56   ` Jonathan Brielmaier
  2019-12-14 23:22   ` bug#38436: " Ludovic Courtès
  2 siblings, 2 replies; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-13 12:53 UTC (permalink / raw)
  To: 38436

* gnu/packages/commencement.scm: (gfortran-toolchain): New variable.
---
 gnu/packages/commencement.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 68030376fc..541dedce0d 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2601,4 +2601,17 @@ an  d binaries, plus debugging symbols in the @code{debug} output), and Binutils
 (define-public gcc-toolchain-9
   (make-gcc-toolchain gcc-9))
 
+;; Provide the Fortran toolchain package only for the version of gfortran that
+;; is used by Guix intenally to build Fortran libraries, because combining
+;; code compiled with different versions can cause problems.
+
+(define-public gfortran-toolchain
+  (package (inherit (make-gcc-toolchain gfortran))
+    (synopsis "Complete GCC tool chain for Fortran development")
+    (description "This package provides a complete GCC tool chain for
+Fortran development to be installed in user profiles.  This includes
+gfortran, as well as libc (headers and binaries, plus debugging symbols
+in the @code{debug} output), and binutils.")))
+
+
 ;;; commencement.scm ends here
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-12 21:22           ` Ludovic Courtès
@ 2019-12-13 12:56             ` Konrad Hinsen
  0 siblings, 0 replies; 16+ messages in thread
From: Konrad Hinsen @ 2019-12-13 12:56 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38436

Ludovic Courtès <ludo@gnu.org> writes:

> Oh I guess I had overlooked this proposal, I agree that it’s nicer.

Patch submitted. It's probably also the shortest possible
patch to get the desired result.

Cheers,
  Konrad

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [bug#38436] [PATCH] gnu: Add gfortran-toolchain
  2019-12-13 12:53 ` Konrad Hinsen
@ 2019-12-13 12:56   ` Jonathan Brielmaier
  2019-12-14 23:22   ` bug#38436: " Ludovic Courtès
  1 sibling, 0 replies; 16+ messages in thread
From: Jonathan Brielmaier @ 2019-12-13 12:56 UTC (permalink / raw)
  To: Konrad Hinsen, 38436

On 13.12.19 13:53, Konrad Hinsen wrote:
> * gnu/packages/commencement.scm: (gfortran-toolchain): New variable.
> ---
>   gnu/packages/commencement.scm | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index 68030376fc..541dedce0d 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -2601,4 +2601,17 @@ an  d binaries, plus debugging symbols in the @code{debug} output), and Binutils
>   (define-public gcc-toolchain-9
>     (make-gcc-toolchain gcc-9))
>
> +;; Provide the Fortran toolchain package only for the version of gfortran that
> +;; is used by Guix intenally to build Fortran libraries, because combining

                       ^  internally

^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#38436: [PATCH] gnu: Add gfortran-toolchain
  2019-12-13 12:53 ` Konrad Hinsen
  2019-12-13 12:56   ` Jonathan Brielmaier
@ 2019-12-14 23:22   ` Ludovic Courtès
  1 sibling, 0 replies; 16+ messages in thread
From: Ludovic Courtès @ 2019-12-14 23:22 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 38436-done

Hi,

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

> * gnu/packages/commencement.scm: (gfortran-toolchain): New variable.

Applied, thanks!  I fixed that typo that Jonathan reported.

Ludo’.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-12-14 23:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29 17:46 [bug#38436] [PATCH] gnu; Add gfortran-toolchain Konrad Hinsen
2019-12-02 15:01 ` [bug#38436] [PATCH] gnu: " Konrad Hinsen
2019-12-09 14:30   ` Ludovic Courtès
2019-12-10 13:11     ` Konrad Hinsen
2019-12-10 14:38       ` Ludovic Courtès
2019-12-11 10:30         ` Konrad Hinsen
2019-12-11 10:30 ` Konrad Hinsen
2019-12-11 11:12   ` Ludovic Courtès
2019-12-11 20:34     ` Konrad Hinsen
2019-12-12 13:20       ` Ludovic Courtès
2019-12-12 15:19         ` Konrad Hinsen
2019-12-12 21:22           ` Ludovic Courtès
2019-12-13 12:56             ` Konrad Hinsen
2019-12-13 12:53 ` Konrad Hinsen
2019-12-13 12:56   ` Jonathan Brielmaier
2019-12-14 23:22   ` bug#38436: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).