unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* emacs irony-mode
@ 2018-08-12 18:53 Tim Gesthuizen
  2018-08-13 10:30 ` Pierre Neidhardt
  2018-08-13 19:23 ` fis trivial
  0 siblings, 2 replies; 9+ messages in thread
From: Tim Gesthuizen @ 2018-08-12 18:53 UTC (permalink / raw)
  To: guix-devel

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

Hi,

I am trying to package irony-mode for emacs and quickly

noticed that I need more input on how packages like this should

be seperated or handled.

Maybe somebody wants to take my approach and integrate the

package definition(s) into guix or provide some information

towards how such packages should be integrated.

You find the script with my package definition attached.

Mentioning packages with similar problems would also be helpful.


Best regards,

Tim Gesthuizen


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: irony-mode.scm --]
[-- Type: text/x-scheme; name="irony-mode.scm", Size: 2210 bytes --]

(define-module (irony-mode)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build utils)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system emacs)
  #:use-module (guix build-system cmake)
  #:use-module (gnu packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages llvm))

(define irony-mode-version "1.2.0")
(define irony-mode-url
  (string-append "https://github.com/Sarcasm/irony-mode/archive/v"
		 irony-mode-version ".tar.gz"))
(define irony-mode-base
	     (base32 "1f68zi0glkg2aly66s07rx3w0b0hdi1znxan02h6dbabaadylk99"))
  
(define-public emacs-irony-mode
  (package
   (name "emacs-irony-mode")
   (version irony-mode-version)
   (source (origin
	    (method url-fetch)
	    (uri irony-mode-url)
	    (sha256 irony-mode-base)
	    (modules '((guix build utils)))
	    (snippet '(begin
			(for-each delete-file-recursively
				  '("server/src" "server/docs"
				    "server/cmake" "server/build-aux"
				    "screenshots"))))))
   (build-system emacs-build-system)
   (arguments '())
   (propagated-inputs
    `(("emacs-irony-mode-server" ,emacs-irony-mode-server)))
   (home-page "https://github.com/Sarcasm/irony-mode")
   (synopsis "Clang autocompletion and syntax checking integration for GNU Emacs")
   (description "Guten Tag")
   (license license:gpl3)))

(define-public emacs-irony-mode-server
  (package
   (name "emacs-irony-mode-server")
   (version irony-mode-version)
   (source (origin
	    (method url-fetch)
	    (uri irony-mode-url)
	    (sha256 irony-mode-base)))
   (propagated-inputs
    `(("clang" ,clang)))
   (arguments
    `(#:phases
    (modify-phases %standard-phases
		   (replace 'configure
			    (lambda* (#:key outputs #:allow-other-keys)
			      (let ((out (assoc-ref outputs "out")))
				(invoke "cmake"
					"server"
					(string-append "-DCMAKE_INSTALL_PREFIX=" out))))))))
   (build-system cmake-build-system)
   (home-page "https://github.com/Sarcasm/irony-mode")
   (synopsis "Clang autocompletion and syntax checking integration for GNU Emacs")
   (description "*TODO*")
   (license license:gpl3)))







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

* Re: emacs irony-mode
  2018-08-12 18:53 emacs irony-mode Tim Gesthuizen
@ 2018-08-13 10:30 ` Pierre Neidhardt
  2018-08-13 18:04   ` Tim Gesthuizen
  2018-08-13 19:23 ` fis trivial
  1 sibling, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2018-08-13 10:30 UTC (permalink / raw)
  To: Tim Gesthuizen; +Cc: guix-devel

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

Hi,

What do you mean with "separated or handled"?  What troubles you?

I think what you want here is a single package, maybe with several outputs.  For
instance, the server would be the "out" output while the Emacs mode would be the
"emacs" output.

Test with ~guix size ...~ if it makes a significant difference to separate the
two.  If not, stick to a single output.

Have a look at other packages with several outputs if you need an example
(e.g. git).

Hope that helps!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: emacs irony-mode
  2018-08-13 10:30 ` Pierre Neidhardt
@ 2018-08-13 18:04   ` Tim Gesthuizen
  2018-08-13 18:11     ` Pierre Neidhardt
  0 siblings, 1 reply; 9+ messages in thread
From: Tim Gesthuizen @ 2018-08-13 18:04 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 745 bytes --]

Hi Pierre,

that was basically my question: Whether the server and the client belong

into a single package definition with a modified build procedure and two
outputs

or whether server and client should be different package definitions
because they

are quite different but dependent.

I would not want to make the server part the "out" output because the
emacs part

is what people are really interested in and the server is just a work
around for the

missing foreign function interface in older emacs  versions and should
be installed

as a dependency of the emacs part.

I need to figure out how to modify the build process accordingly but
your reply

answered my questions :)


Thank you for your answer



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: emacs irony-mode
  2018-08-13 18:04   ` Tim Gesthuizen
@ 2018-08-13 18:11     ` Pierre Neidhardt
  2018-08-13 18:55       ` Tim Gesthuizen
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2018-08-13 18:11 UTC (permalink / raw)
  To: Tim Gesthuizen; +Cc: guix-devel

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


> the server is just a work around for the missing foreign function interface in
> older emacs

Well, Guix packages the latest Emacs, so can't you just skip the server
altogether?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: emacs irony-mode
  2018-08-13 18:11     ` Pierre Neidhardt
@ 2018-08-13 18:55       ` Tim Gesthuizen
  0 siblings, 0 replies; 9+ messages in thread
From: Tim Gesthuizen @ 2018-08-13 18:55 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 685 bytes --]

On 13.08.2018 20:11, Pierre Neidhardt wrote:
>> the server is just a work around for the missing foreign function interface in
>> older emacs
> Well, Guix packages the latest Emacs, so can't you just skip the server
> altogether?
>

I guess not.
That would require rewriting the server part to make emacs aware of
libclang and
how to use it.
I am a user of irony-mode who would enjoy having the package available
through
Guix but I am definitely not a developer who knows how to handle LLVM /
clang.
While it would be nice it would be out of the scope of packaging
irony-mode as it
would require upstream changes to irony-mode itself that break
compatibility.
 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: emacs irony-mode
  2018-08-12 18:53 emacs irony-mode Tim Gesthuizen
  2018-08-13 10:30 ` Pierre Neidhardt
@ 2018-08-13 19:23 ` fis trivial
  2018-08-13 19:48   ` Tim Gesthuizen
  1 sibling, 1 reply; 9+ messages in thread
From: fis trivial @ 2018-08-13 19:23 UTC (permalink / raw)
  To: Tim Gesthuizen; +Cc: guix-devel@gnu.org


Tim Gesthuizen writes:

> Hi,
>
> I am trying to package irony-mode for emacs and quickly
>
> noticed that I need more input on how packages like this should
>
> be seperated or handled.
>
> Maybe somebody wants to take my approach and integrate the
>
> package definition(s) into guix or provide some information
>
> towards how such packages should be integrated.
>
> You find the script with my package definition attached.
>
> Mentioning packages with similar problems would also be helpful.
>
>
> Best regards,
>
> Tim Gesthuizen

I'm not helping. But there are other candidates than irony-mode now. For two
scenarios:

    1. You have a way to generate compilation database:

       Use cquery with lsp-mode. cquery is a fully featured c/c++/objective-c
       language server.

       or

       Use rtags.  The server is packaged in Guix. Personal experience tells
       that cquery is better at its job.  But you can be the judge. :)

    2. You can't generate a compilation database:

       Just use company-clang and flycheck, which combined should do everything
       irony could.

If this doesn't convince you to give up irony-mode. Then your packaging looks
good to me.  If there really is room to improve, maybe you can extract the
"source" part out?  Note that I'm not proficient as others here.

--
Jiaming

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

* Re: emacs irony-mode
  2018-08-13 19:23 ` fis trivial
@ 2018-08-13 19:48   ` Tim Gesthuizen
  2018-08-13 19:53     ` Pierre Neidhardt
  0 siblings, 1 reply; 9+ messages in thread
From: Tim Gesthuizen @ 2018-08-13 19:48 UTC (permalink / raw)
  To: fis trivial; +Cc: guix-devel@gnu.org

On 13.08.2018 21:23, fis trivial wrote:
> Tim Gesthuizen writes:
>
>> Hi,
>>
>> I am trying to package irony-mode for emacs and quickly
>>
>> noticed that I need more input on how packages like this should
>>
>> be seperated or handled.
>>
>> Maybe somebody wants to take my approach and integrate the
>>
>> package definition(s) into guix or provide some information
>>
>> towards how such packages should be integrated.
>>
>> You find the script with my package definition attached.
>>
>> Mentioning packages with similar problems would also be helpful.
>>
>>
>> Best regards,
>>
>> Tim Gesthuizen
> I'm not helping. But there are other candidates than irony-mode now. For two
> scenarios:
>
>     1. You have a way to generate compilation database:
>
>        Use cquery with lsp-mode. cquery is a fully featured c/c++/objective-c
>        language server.
>
>        or
>
>        Use rtags.  The server is packaged in Guix. Personal experience tells
>        that cquery is better at its job.  But you can be the judge. :)
>
>     2. You can't generate a compilation database:
>
>        Just use company-clang and flycheck, which combined should do everything
>        irony could.
>
> If this doesn't convince you to give up irony-mode. Then your packaging looks
> good to me.  If there really is room to improve, maybe you can extract the
> "source" part out?  Note that I'm not proficient as others here.
>
> --
> Jiaming

Hi,
thank you for mentioning lsp.
I did not know that it is that feature rich so I will definitely give it
a try.
When it does not convince me to be a proper replacement I will keep
packaging irony-mode.
The "source" part will be gone when I pick up the tips from Pierre:

> I think what you want here is a single package, maybe with several outputs.  For
> instance, the server would be the "out" output while the Emacs mode would be the
> "emacs" output. 


It was just an attempt to show that both packages use the same source.

For now I will stop working on irony-mode and maybe pick it up at a later
point.
Also I do not know how many other people are using irony-mode so maybe
it's just me and packaging it is pointless anyway.

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

* Re: emacs irony-mode
  2018-08-13 19:48   ` Tim Gesthuizen
@ 2018-08-13 19:53     ` Pierre Neidhardt
  2018-08-13 20:11       ` Tim Gesthuizen
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2018-08-13 19:53 UTC (permalink / raw)
  To: Tim Gesthuizen; +Cc: guix-devel@gnu.org

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

Something else you can do it make one package inherit from the other.  This way
you don't need to declare the source globally.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: emacs irony-mode
  2018-08-13 19:53     ` Pierre Neidhardt
@ 2018-08-13 20:11       ` Tim Gesthuizen
  0 siblings, 0 replies; 9+ messages in thread
From: Tim Gesthuizen @ 2018-08-13 20:11 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: guix-devel@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 529 bytes --]

On 13.08.2018 21:53, Pierre Neidhardt wrote:
> Something else you can do it make one package inherit from the other.  This way
> you don't need to declare the source globally.
> 

That would also work but I think making it a single package is probably
the best way of handling the package.
The server part consists of a single executable after building.
In my local guix build it takes ~100k disk size so "inlining" it into
the emacs package (maybe in a separate output) seems to be the best
option in my opinion.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2018-08-13 20:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-12 18:53 emacs irony-mode Tim Gesthuizen
2018-08-13 10:30 ` Pierre Neidhardt
2018-08-13 18:04   ` Tim Gesthuizen
2018-08-13 18:11     ` Pierre Neidhardt
2018-08-13 18:55       ` Tim Gesthuizen
2018-08-13 19:23 ` fis trivial
2018-08-13 19:48   ` Tim Gesthuizen
2018-08-13 19:53     ` Pierre Neidhardt
2018-08-13 20:11       ` Tim Gesthuizen

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