all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Which Emacs version used to build Emacs packages with emacs-checkout?
@ 2017-09-07 18:49 Oleg Pykhalov
  2017-09-08 20:31 ` Alex Kost
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Pykhalov @ 2017-09-07 18:49 UTC (permalink / raw)
  To: help-guix

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

Hello Guix,

Here is a =emacs-checkout= snippet which works for me.  Enjoy it if
somebody need it.

I'm little bit confused about Emacs **version** that is used inside
=emacs-build-systems= and inputs which use =emacs-minimal=.

If I define a new package with =-checkout= suffix and install it, for
example =guix package -i emacs@26.0.50-1.f0eb70d= it works fine.

As I notice all packages which uses =emacs-build-system= will use
original Guix Emacs version package.  Am I right?

Then, all Emacs packages will be build by =emacs-minimal= which is
original Guix Emacs version.

I found =(setq load-prefer-newer t)= way to avoid loading old compiled
elisp files, but it's not what I really want.

Thoughts?  :-)


[-- Attachment #2: emacs-checkout --]
[-- Type: text/plain, Size: 3312 bytes --]

(define-public emacs-checkout
  (let ((commit "f0eb70d8935be90f7c03e187c12d9b60e7214cc6")
	(revision "1"))
    (package
      (inherit emacs)
      (name "emacs")
      (version (string-append "26.0.50" "-" revision "."
			      (string-take commit 7)))
      (source
       (origin
	 (method git-fetch)
	 (uri (git-reference
	       ;; "git://git.savannah.gnu.org/emacs.git"
	       (url "git://localhost/~natsu/src/emacs")
	       (commit commit)))
	 (file-name (string-append name "-" version "-checkout"))
	 (patches (search-patches "emacs-exec-path.patch"
				  "emacs-source-date-epoch.patch"))
	 (modules '((guix build utils)))
	 (snippet
	  ;; Delete the bundled byte-compiled elisp files and
	  ;; generated autoloads.
	  '(with-directory-excursion "lisp"
	     (for-each delete-file
		       (append (find-files "." "\\.elc$")
			       (find-files "." "loaddefs\\.el$")))

	     ;; Make sure Tramp looks for binaries in the right places on
	     ;; remote GuixSD machines, where 'getconf PATH' returns
	     ;; something bogus.
	     (substitute* "net/tramp-sh.el"
	       ;; Patch the line after "(defcustom tramp-remote-path".
	       (("\\(tramp-default-remote-path")
		(format #f "(tramp-default-remote-path ~s ~s ~s ~s "
			"~/.guix-profile/bin" "~/.guix-profile/sbin"
			"/run/current-system/profile/bin"
			"/run/current-system/profile/sbin")))))
	 (sha256
	  (base32 "1s2b9qahcqgp085fadsjys3w60z9dczh0y0jhnsp0axwi27ssmzc"))))
      (native-inputs
       `(("autoconf" ,autoconf)
	 ("automake" ,automake)
	 ("bash" ,bash-minimal)
	 ("perl" ,perl)
	 ("rc" ,rc)
	 ("python" ,python-2.7)
	 ("chez-scheme" ,chez-scheme)
	 ,@(package-native-inputs emacs)))
      (arguments
       (substitute-keyword-arguments
	   `(#:parallel-build? #t
			       #:tests? #f
			       ,@(package-arguments emacs))
	 ((#:phases phases)
	  `(modify-phases ,phases
	     (add-after 'unpack 'autogen
	       (lambda _
		 (zero? (system* "sh" "autogen.sh"))))
	     (delete 'reset-gzip-timestamps))))))))

(define-public geiser-checkout
  (let ((commit "9581e61f9d8839281fe42344dd5fe885ea7359ea")
	(revision "1"))
    (package
      (inherit geiser)
      (name "geiser")
      (version (string-append "0.9" "-" revision "."
			      (string-take commit 7)))
      (source
       (origin
	 (method git-fetch)
	 (uri (git-reference
	       (url "git://git.savannah.gnu.org/geiser.git")
	       (commit commit)))
	 (file-name (string-append name "-" version "-checkout"))
	 (sha256
	  (base32 "0nx86pzncab0b7700m8sc7k3nzml4v9frrq77lljjcjhw71gnvnn"))))
      (native-inputs
       `(("autoconf" ,autoconf)
	 ("automake" ,automake)
	 ("texinfo" ,texinfo)
	 ,@(package-native-inputs geiser)))
      (arguments
       (substitute-keyword-arguments
	   `(#:parallel-build? #t
			       #:tests? #f
			       ,@(package-arguments geiser))
	 ((#:phases phases)
	  `(modify-phases ,phases
	     (add-after 'unpack 'autogen
	       (lambda _
		 (zero? (system* "sh" "autogen.sh"))))
	     (delete 'reset-gzip-timestamps))))))))

(define-public emacs-guix-checkout
  (package
    (inherit emacs-guix)
    (version (string-append (package-version emacs-guix) "-checkout"))
    (propagated-inputs
     `(("geiser" ,geiser-checkout)
       ("dash" ,emacs-dash)
       ("bui" ,emacs-bui)
       ("magit-popup" ,emacs-magit-popup)))))


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

* Re: Which Emacs version used to build Emacs packages with emacs-checkout?
  2017-09-07 18:49 Which Emacs version used to build Emacs packages with emacs-checkout? Oleg Pykhalov
@ 2017-09-08 20:31 ` Alex Kost
  2017-09-22 13:49   ` Oleg Pykhalov
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Kost @ 2017-09-08 20:31 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: help-guix

Oleg Pykhalov (2017-09-07 21:49 +0300) wrote:

> Hello Guix,
>
> Here is a =emacs-checkout= snippet which works for me.  Enjoy it if
> somebody need it.
>
> I'm little bit confused about Emacs **version** that is used inside
> =emacs-build-systems= and inputs which use =emacs-minimal=.
>
> If I define a new package with =-checkout= suffix and install it, for
> example =guix package -i emacs@26.0.50-1.f0eb70d= it works fine.
>
> As I notice all packages which uses =emacs-build-system= will use
> original Guix Emacs version package.  Am I right?

Right, by default 'emacs-build-system' uses the current 'emacs-minimal'
package.

> Then, all Emacs packages will be build by =emacs-minimal= which is
> original Guix Emacs version.

Yes.  Note that this default emacs can be overrided on a package level
by using #:emacs keyword in the arguments.  See 'emacs-auctex' package
for example.

> I found =(setq load-prefer-newer t)= way to avoid loading old compiled
> elisp files, but it's not what I really want.

This (I mean 'load-prefer-newer') is one of my favourite setting :-)
But it is not clear for me, what do you really want?

> Thoughts?  :-)

Sorry, but I don't understand what you are asking about :-)

-- 
Alex

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

* Re: Which Emacs version used to build Emacs packages with emacs-checkout?
  2017-09-08 20:31 ` Alex Kost
@ 2017-09-22 13:49   ` Oleg Pykhalov
  2017-09-29 10:57     ` Alex Kost
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Pykhalov @ 2017-09-22 13:49 UTC (permalink / raw)
  To: Alex Kost; +Cc: help-guix

Hello Alex,

Alex Kost <alezost@gmail.com> writes:

> Oleg Pykhalov (2017-09-07 21:49 +0300) wrote:
>
>> Hello Guix,
>>
>> Here is a =emacs-checkout= snippet which works for me.  Enjoy it if
>> somebody need it.
>>
>> I'm little bit confused about Emacs **version** that is used inside
>> =emacs-build-systems= and inputs which use =emacs-minimal=.
>>
>> If I define a new package with =-checkout= suffix and install it, for
>> example =guix package -i emacs@26.0.50-1.f0eb70d= it works fine.
>>
>> As I notice all packages which uses =emacs-build-system= will use
>> original Guix Emacs version package.  Am I right?
>
> Right, by default 'emacs-build-system' uses the current 'emacs-minimal'
> package.

OK, I made a new emacs-minimal-checkout package based on emacs-checkout.

--8<---------------cut here---------------start------------->8---
(define-public emacs-minimal-checkout
  ;; This is the version that you should use as an input to packages that just
  ;; need to byte-compile .el files.
  (package
    (inherit emacs-checkout)
    (name "emacs-minimal")
    (synopsis "The extensible text editor (used only for byte-compilation)")
    (build-system gnu-build-system)
    (arguments
     (substitute-keyword-arguments (package-arguments emacs)
       ((#:phases phases)
        `(modify-phases ,phases
           (delete 'install-site-start)))))
    (inputs
     `(("ncurses" ,ncurses)))
    (native-inputs
     `(("pkg-config" ,pkg-config)))))
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
(define-public emacs-checkout
  (let ((commit "6d6dc246f93486fc8370399b6e1af8a17f371e4f")
        (revision "1"))
    (package
      (inherit emacs)
      (name "emacs")
      (version (string-append (package-version emacs) "-" revision "."
                              (string-take commit 7)))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               ;; "git://git.savannah.gnu.org/emacs.git"
               (url "git://localhost/~natsu/src/emacs")
               (commit commit)))
         (file-name (string-append name "-" version "-checkout"))
         (patches (search-patches "emacs-exec-path.patch"
                                  "emacs-source-date-epoch.patch"))
         (modules '((guix build utils)))
         (snippet
          ;; Delete the bundled byte-compiled elisp files and
          ;; generated autoloads.
          '(with-directory-excursion "lisp"
             (for-each delete-file
                       (append (find-files "." "\\.elc$")
                               (find-files "." "loaddefs\\.el$")))

             ;; Make sure Tramp looks for binaries in the right places on
             ;; remote GuixSD machines, where 'getconf PATH' returns
             ;; something bogus.
             (substitute* "net/tramp-sh.el"
               ;; Patch the line after "(defcustom tramp-remote-path".
               (("\\(tramp-default-remote-path")
                (format #f "(tramp-default-remote-path ~s ~s ~s ~s "
                        "~/.guix-profile/bin" "~/.guix-profile/sbin"
                        "/run/current-system/profile/bin"
                        "/run/current-system/profile/sbin")))))
         (sha256
          (base32 "17x0jpyg6wrdh5wn9yf1135gkdcprbcx1hj2wiwla57dh7rihils"))))
      (native-inputs
       `(("autoconf" ,autoconf)
         ("automake" ,automake)
         ("bash" ,bash-minimal)
         ("perl" ,perl)
         ("rc" ,rc)
         ("python" ,python-2.7)
         ("chez-scheme" ,chez-scheme)
         ,@(package-native-inputs emacs)))
      (arguments
       (substitute-keyword-arguments
           `(#:parallel-build? #t
                               #:tests? #f
                               ,@(package-arguments emacs))
         ((#:phases phases)
          `(modify-phases ,phases
             (add-after 'unpack 'autogen
               (lambda _
                 (zero? (system* "sh" "autogen.sh"))))
             (delete 'reset-gzip-timestamps))))))))
--8<---------------cut here---------------end--------------->8---

>> Then, all Emacs packages will be build by =emacs-minimal= which is
>> original Guix Emacs version.
>
> Yes.  Note that this default emacs can be overrided on a package level
> by using #:emacs keyword in the arguments.  See 'emacs-auctex' package
> for example.

Ah, this is bad for me.  Now I need to redefine all those “#:emacs
,emacs” to “#:emacs ,emacs-checkout” as I guess.  Or I need to redefine
“emacs” variable instead of inherit it in “emacs-checkout”.

>> I found =(setq load-prefer-newer t)= way to avoid loading old compiled
>> elisp files, but it's not what I really want.
>
> This (I mean 'load-prefer-newer') is one of my favourite setting :-)
> But it is not clear for me, what do you really want?
>
>> Thoughts?  :-)
>
> Sorry, but I don't understand what you are asking about :-)

I want to have Emacs builded from my local Git repository.  And I also
want Emacs packages builded with this my Emacs version.

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

* Re: Which Emacs version used to build Emacs packages with emacs-checkout?
  2017-09-22 13:49   ` Oleg Pykhalov
@ 2017-09-29 10:57     ` Alex Kost
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Kost @ 2017-09-29 10:57 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: help-guix

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

Oleg Pykhalov (2017-09-22 16:49 +0300) wrote:

> Hello Alex,
Hi!

> Alex Kost <alezost@gmail.com> writes:
[...]
>> Yes.  Note that this default emacs can be overrided on a package level
>> by using #:emacs keyword in the arguments.  See 'emacs-auctex' package
>> for example.
>
> Ah, this is bad for me.  Now I need to redefine all those “#:emacs
> ,emacs” to “#:emacs ,emacs-checkout” as I guess.  Or I need to redefine
> “emacs” variable instead of inherit it in “emacs-checkout”.

I think making your packages with #:emacs argument is the right way.
And it is not so bad as it may seem, as you can use some Guile code to
reduce the duplication.  For example, look at the attached file: it
shows how you may inherit the packages you need from the original emacs
packages.  To check it, put it into your GUIX_PACKAGE_PATH and call
"guix package --show=my-emacs-paredit".  This is just an example, but I
think you get the idea ;-)

> I want to have Emacs builded from my local Git repository.  And I also
> want Emacs packages builded with this my Emacs version.

Actually, why do you want to do this?  I mean it doesn't matter what
version of Emacs you use to compile .el files.  There is no difference:
if you build a package with Emacs 24 it will still work with Emacs 26.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: my-emacs.scm --]
[-- Type: text/x-scheme, Size: 550 bytes --]

(define-module (my-emacs)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages emacs))

(define-syntax-rule (define-my-packages (var-name pkg) ...)
  (begin
    (define-public var-name
      (package (inherit pkg)
        (name (string-append "my-" (package-name pkg)))
        (arguments
         (cons* #:emacs emacs-no-x
                (package-arguments pkg)))))
    ...))

(define-my-packages
  (my-emacs-ag emacs-ag)
  (my-paredit paredit)
  (my-smex emacs-smex)
  ;; ...and the other packages you need.
  )

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

end of thread, other threads:[~2017-09-29 10:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 18:49 Which Emacs version used to build Emacs packages with emacs-checkout? Oleg Pykhalov
2017-09-08 20:31 ` Alex Kost
2017-09-22 13:49   ` Oleg Pykhalov
2017-09-29 10:57     ` Alex Kost

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.