unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
  2016-05-16 18:20 [PATCH 0/6] Modifications in building emacs packages Alex Kost
@ 2016-05-16 18:20 ` Alex Kost
  2016-05-19 11:54   ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2016-05-16 18:20 UTC (permalink / raw)
  To: guix-devel

* guix/build-system/emacs.scm (lower): Do not add "emacs" to
  build-inputs if it is already specified in the native-inputs.
---
 guix/build-system/emacs.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm
index 03c1eb2..017e6ef 100644
--- a/guix/build-system/emacs.scm
+++ b/guix/build-system/emacs.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
+;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,6 +26,7 @@
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
   #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:export (%emacs-build-system-modules
             emacs-build
@@ -73,8 +75,16 @@
 
                         ;; Keep the standard inputs of 'gnu-build-system'.
                         ,@(standard-packages)))
-         (build-inputs `(("emacs" ,emacs)
-                         ,@native-inputs))
+         ;; Add emacs to build-inputs only if native-inputs do not contain
+         ;; emacs already.  This allows us to use non-default emacs for
+         ;; building.
+         (build-inputs (if (find (match-lambda
+                                   (("emacs" _ ...) #t)
+                                   (_ #f))
+                                 native-inputs)
+                           native-inputs
+                           `(("emacs" ,emacs)
+                             ,@native-inputs)))
          (outputs outputs)
          (build emacs-build)
          (arguments (strip-keyword-arguments private-keywords arguments)))))
-- 
2.7.3

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

* Re: [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
  2016-05-16 18:20 ` [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified Alex Kost
@ 2016-05-19 11:54   ` Ludovic Courtès
  2016-05-20 21:21     ` Alex Kost
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2016-05-19 11:54 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>   build-inputs if it is already specified in the native-inputs.

In theory, one could want to have Emacs both in ‘native-inputs’ (to
build .elc files, for instance) and in ‘inputs’ (for instance because
the program embeds a reference to the ‘emacs’ program.)

So I’m rather reluctant about this approach.

Did you find packages where Emacs wrongfully appears twice in the
inputs?  It might be best to fix those packages instead.

WDYT?

Thanks,
Ludo’.

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

* [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
@ 2016-05-20  7:15 Federico Beffa
  2016-05-20 12:00 ` Ludovic Courtès
  2016-05-20 21:37 ` Alex Kost
  0 siblings, 2 replies; 8+ messages in thread
From: Federico Beffa @ 2016-05-20  7:15 UTC (permalink / raw)
  To: alezost, Guix-devel, Ludovic Courtès

Alex Kost <alezost@gmail.com> writes:

> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>   build-inputs if it is already specified in the native-inputs.
> @@ -73,8 +75,16 @@
>
>                          ;; Keep the standard inputs of 'gnu-build-system'.
>                          ,@(standard-packages)))
> -         (build-inputs `(("emacs" ,emacs)
> -                         ,@native-inputs))
> +         ;; Add emacs to build-inputs only if native-inputs do not contain
> +         ;; emacs already.  This allows us to use non-default emacs for
> +         ;; building.
> +         (build-inputs (if (find (match-lambda
> +                                   (("emacs" _ ...) #t)
> +                                   (_ #f))
> +                                 native-inputs)
> +                           native-inputs
> +                           `(("emacs" ,emacs)
> +                             ,@native-inputs)))

Note that for the interpreter we normally use a keyword, here #:emacs
(in a similar way as, say, for the python-build-system there is
#:python).  Your code overwrites its effect in a non-transparent way.

Please use the keyword in the packages where you need an emacs package
different from the default one, or remove all the code related to the
keyword.  If you opt for the second one, please be consistent and do the
same for all other build systems.

Fede

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

* Re: [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
  2016-05-20  7:15 [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified Federico Beffa
@ 2016-05-20 12:00 ` Ludovic Courtès
  2016-05-20 21:24   ` Alex Kost
  2016-05-20 21:37 ` Alex Kost
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2016-05-20 12:00 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel, alezost

Federico Beffa <beffa@ieee.org> skribis:

> Alex Kost <alezost@gmail.com> writes:
>
>> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>>   build-inputs if it is already specified in the native-inputs.
>> @@ -73,8 +75,16 @@
>>
>>                          ;; Keep the standard inputs of 'gnu-build-system'.
>>                          ,@(standard-packages)))
>> -         (build-inputs `(("emacs" ,emacs)
>> -                         ,@native-inputs))
>> +         ;; Add emacs to build-inputs only if native-inputs do not contain
>> +         ;; emacs already.  This allows us to use non-default emacs for
>> +         ;; building.
>> +         (build-inputs (if (find (match-lambda
>> +                                   (("emacs" _ ...) #t)
>> +                                   (_ #f))
>> +                                 native-inputs)
>> +                           native-inputs
>> +                           `(("emacs" ,emacs)
>> +                             ,@native-inputs)))
>
> Note that for the interpreter we normally use a keyword, here #:emacs
> (in a similar way as, say, for the python-build-system there is
> #:python).  Your code overwrites its effect in a non-transparent way.

Seconded, I prefer #:emacs, which is consistent with cmake-build-system,
python-build-system, etc.

Ludo’.

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

* Re: [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
  2016-05-19 11:54   ` Ludovic Courtès
@ 2016-05-20 21:21     ` Alex Kost
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Kost @ 2016-05-20 21:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès (2016-05-19 14:54 +0300) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>>   build-inputs if it is already specified in the native-inputs.
>
> In theory, one could want to have Emacs both in ‘native-inputs’ (to
> build .elc files, for instance) and in ‘inputs’ (for instance because
> the program embeds a reference to the ‘emacs’ program.)

I don't see a problem here, if "emacs" should be added to inputs, it may
just go there.  Nothing prohibits it.

> So I’m rather reluctant about this approach.
>
> Did you find packages where Emacs wrongfully appears twice in the
> inputs?  It might be best to fix those packages instead.

Do you mean: appears both in "inputs" and "native-inputs"?  If so, then
no, there are no such packages.

But I don't understand how this concerns.  The purpose of this patch is
to allow us to use a different "emacs" to build emacs packages.  I
would say this is the core patch of the whole patchset.  I didn't like
the fact that emacs-build-system uses a full-featured (and heavy on
dependencies) "emacs" package, and I would like to use "emacs-minimal"
instead.  But for some rare cases (currently only for auctex),
"emacs-minimal" (or "emacs-no-x") is not enough, so it should be
substituted somehow.  That's why I made this patch.

-- 
Alex

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

* Re: [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
  2016-05-20 12:00 ` Ludovic Courtès
@ 2016-05-20 21:24   ` Alex Kost
  2016-05-22 20:30     ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2016-05-20 21:24 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel, Federico Beffa

Ludovic Courtès (2016-05-20 15:00 +0300) wrote:

> Federico Beffa <beffa@ieee.org> skribis:
>
>> Alex Kost <alezost@gmail.com> writes:
>>
>>> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>>>   build-inputs if it is already specified in the native-inputs.
>>> @@ -73,8 +75,16 @@
>>>
>>>                          ;; Keep the standard inputs of 'gnu-build-system'.
>>>                          ,@(standard-packages)))
>>> -         (build-inputs `(("emacs" ,emacs)
>>> -                         ,@native-inputs))
>>> +         ;; Add emacs to build-inputs only if native-inputs do not contain
>>> +         ;; emacs already.  This allows us to use non-default emacs for
>>> +         ;; building.
>>> +         (build-inputs (if (find (match-lambda
>>> +                                   (("emacs" _ ...) #t)
>>> +                                   (_ #f))
>>> +                                 native-inputs)
>>> +                           native-inputs
>>> +                           `(("emacs" ,emacs)
>>> +                             ,@native-inputs)))
>>
>> Note that for the interpreter we normally use a keyword, here #:emacs
>> (in a similar way as, say, for the python-build-system there is
>> #:python).  Your code overwrites its effect in a non-transparent way.
>
> Seconded, I prefer #:emacs, which is consistent with cmake-build-system,
> python-build-system, etc.

OK, I understand.  So we have to stick to a full-featured "emacs" for
emacs-build-system, right?  Or do you have ideas how we could use
"emacs-minimal" as the default emacs for building, and replace it with
the full "emacs" for particular packages?

-- 
Alex

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

* Re: [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
  2016-05-20  7:15 [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified Federico Beffa
  2016-05-20 12:00 ` Ludovic Courtès
@ 2016-05-20 21:37 ` Alex Kost
  1 sibling, 0 replies; 8+ messages in thread
From: Alex Kost @ 2016-05-20 21:37 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa (2016-05-20 10:15 +0300) wrote:

> Alex Kost <alezost@gmail.com> writes:
>
>> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>>   build-inputs if it is already specified in the native-inputs.
>> @@ -73,8 +75,16 @@
>>
>>                          ;; Keep the standard inputs of 'gnu-build-system'.
>>                          ,@(standard-packages)))
>> -         (build-inputs `(("emacs" ,emacs)
>> -                         ,@native-inputs))
>> +         ;; Add emacs to build-inputs only if native-inputs do not contain
>> +         ;; emacs already.  This allows us to use non-default emacs for
>> +         ;; building.
>> +         (build-inputs (if (find (match-lambda
>> +                                   (("emacs" _ ...) #t)
>> +                                   (_ #f))
>> +                                 native-inputs)
>> +                           native-inputs
>> +                           `(("emacs" ,emacs)
>> +                             ,@native-inputs)))
>
> Note that for the interpreter we normally use a keyword, here #:emacs
> (in a similar way as, say, for the python-build-system there is
> #:python).  Your code overwrites its effect in a non-transparent way.
>
> Please use the keyword in the packages where you need an emacs package
> different from the default one, or remove all the code related to the
> keyword.  If you opt for the second one, please be consistent and do the
> same for all other build systems.

Oh, silly me, now I understand how this keyword works, thanks a lot for
the explanation!  I will adjust this patchset accordingly.  Please
ignore the previous message I sent to this thread :-)

-- 
Alex

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

* Re: [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
  2016-05-20 21:24   ` Alex Kost
@ 2016-05-22 20:30     ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2016-05-22 20:30 UTC (permalink / raw)
  To: Alex Kost; +Cc: Guix-devel, Federico Beffa

Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2016-05-20 15:00 +0300) wrote:
>
>> Federico Beffa <beffa@ieee.org> skribis:
>>
>>> Alex Kost <alezost@gmail.com> writes:
>>>
>>>> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>>>>   build-inputs if it is already specified in the native-inputs.
>>>> @@ -73,8 +75,16 @@
>>>>
>>>>                          ;; Keep the standard inputs of 'gnu-build-system'.
>>>>                          ,@(standard-packages)))
>>>> -         (build-inputs `(("emacs" ,emacs)
>>>> -                         ,@native-inputs))
>>>> +         ;; Add emacs to build-inputs only if native-inputs do not contain
>>>> +         ;; emacs already.  This allows us to use non-default emacs for
>>>> +         ;; building.
>>>> +         (build-inputs (if (find (match-lambda
>>>> +                                   (("emacs" _ ...) #t)
>>>> +                                   (_ #f))
>>>> +                                 native-inputs)
>>>> +                           native-inputs
>>>> +                           `(("emacs" ,emacs)
>>>> +                             ,@native-inputs)))
>>>
>>> Note that for the interpreter we normally use a keyword, here #:emacs
>>> (in a similar way as, say, for the python-build-system there is
>>> #:python).  Your code overwrites its effect in a non-transparent way.
>>
>> Seconded, I prefer #:emacs, which is consistent with cmake-build-system,
>> python-build-system, etc.
>
> OK, I understand.  So we have to stick to a full-featured "emacs" for
> emacs-build-system, right?  Or do you have ideas how we could use
> "emacs-minimal" as the default emacs for building, and replace it with
> the full "emacs" for particular packages?

I think emacs-build-system should have a #:emacs parameter (just like
python-build-system has #:python), which would default to
‘emacs-minimal’.

Does that make sense?

Ludo’.

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

end of thread, other threads:[~2016-05-22 20:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20  7:15 [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified Federico Beffa
2016-05-20 12:00 ` Ludovic Courtès
2016-05-20 21:24   ` Alex Kost
2016-05-22 20:30     ` Ludovic Courtès
2016-05-20 21:37 ` Alex Kost
  -- strict thread matches above, loose matches on Subject: below --
2016-05-16 18:20 [PATCH 0/6] Modifications in building emacs packages Alex Kost
2016-05-16 18:20 ` [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified Alex Kost
2016-05-19 11:54   ` Ludovic Courtès
2016-05-20 21:21     ` Alex Kost

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