unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Christopher Allan Webber <cwebber@dustycloud.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] Attempt at packaging guile-emacs (needs help)
Date: Sun, 10 May 2015 17:51:23 -0400	[thread overview]
Message-ID: <8738345cf8.fsf@netris.org> (raw)
In-Reply-To: <87r3qo5idm.fsf@earlgrey.lan> (Christopher Allan Webber's message of "Sun, 10 May 2015 14:35:32 -0500")

Christopher Allan Webber <cwebber@dustycloud.org> writes:

> I started working on an attempt to package guile-emacs, based on
>   http://www.emacswiki.org/emacs/GuileEmacs
>
> This includes both a package for guilemacs-guile and guilemacs-emacs,
> both BT Templeton's WIP branches.

Excellent! :)

> Unfortunately, guilemacs-guile does not complete building.  It compiles,
> but then fails "make check":
>   http://pamrel.lu/2aa8f/

These are known issues.  Perhaps we should just disable tests for now.

> From 4182f8c22f1ca4eea453e61a90c77b790f573d8a Mon Sep 17 00:00:00 2001
> From: Christopher Allan Webber <cwebber@dustycloud.org>
> Date: Sun, 10 May 2015 09:29:54 -0500
> Subject: [PATCH] guilemacs attempt, failing on "make check"
>
> ---
>  gnu/packages/guile.scm     |  3 +-
>  gnu/packages/guilemacs.scm | 83 ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 85 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/packages/guilemacs.scm
>
>
> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
> index 751002f..33d5773 100644
> --- a/gnu/packages/guile.scm
> +++ b/gnu/packages/guile.scm
> @@ -41,7 +41,8 @@
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system trivial)
>    #:use-module (guix utils)
> -  #:use-module (ice-9 match))
> +  #:use-module (ice-9 match)
> +  #:export (guile-2.0))

No need for this, because 'define-public' is used to define guile-2.0.

> diff --git a/gnu/packages/guilemacs.scm b/gnu/packages/guilemacs.scm
> new file mode 100644
> index 0000000..c370200
> --- /dev/null
> +++ b/gnu/packages/guilemacs.scm

I believe that bipt calls it "guile-emacs", so that's what we should
call it too.

This file needs to be added to GNU_SYSTEM_MODULES in gnu-system.am.

> +(define-public guilemacs-guile

I think the main package should just be called "guile-emacs", but I'm
not sure what to name this branch of guile.  "guile-for-guile-emacs"
comes to mind, but I admit that's not great.  Maybe it doesn't matter
since users are unlikely to install it directly.

> +  (package (inherit guile-2.0)
> +    (name "guilemacs-guile")
> +    (version "20150212.a930be6")
> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'autogen
> +                    (lambda _
> +                      (zero? (system* "sh" "autogen.sh"))))
> +         (add-before 'autogen 'patch-/bin/sh
> +           (lambda _
> +             (substitute* "build-aux/git-version-gen"
> +               (("#!/bin/sh") (string-append "#!" (which "sh")))))))))

Phases are supposed to return a boolean indicating whether the phase
succeeded, but the return value of 'substitute*' is not specified.  In
practice it tends to work, but I'd prefer to put an explicit #t in
there, like this:

--8<---------------cut here---------------start------------->8---
           (lambda _
             (substitute* "build-aux/git-version-gen"
               (("#!/bin/sh") (string-append "#!" (which "sh"))))
             #t)))))
--8<---------------cut here---------------end--------------->8---

> +    (native-inputs
> +     (append
> +      `(("autoconf" ,autoconf)
> +        ("automake" ,automake)
> +        ("libtool" ,libtool)
> +        ("flex" ,flex)
> +        ("texinfo" ,texinfo))
> +      (package-native-inputs guile-2.0)))
> +    (inputs
> +     (append
> +      `(("gettext" ,gnu-gettext))
> +      (package-inputs guile-2.0)))

This is okay, but it would be more consistent with our usual style to
let the quasiquote do the append, like this:

--8<---------------cut here---------------start------------->8---
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ("libtool" ,libtool)
       ("flex" ,flex)
       ("texinfo" ,texinfo)
       ,@(package-native-inputs guile-2.0)))
    (inputs
     `(("gettext" ,gnu-gettext)
       ,@(package-inputs guile-2.0)))))
--8<---------------cut here---------------end--------------->8---

> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "git://git.hcoop.net/git/bpt/guile.git")
> +                    (commit "a930be6f0f0d1594873c7eb9d2316ecf926da67d")))
> +              (sha256
> +               (base32
> +                "1l520n482cq8h8qbkp11j5xcz5vf6fnbpc24i0xmd3ngj2ga3gh7"))))))

For consistency, we usually put the 'source' field just below the
'version' field, although it's not a big deal.

> +(define-public guilemacs-emacs
> +  (package (inherit emacs)
> +    (name "guilemacs-emacs")

Let's call it "guile-emacs" (both the variable and in the 'name' field).

> +    (version "20150212.a930be6")

This should be "20150212.8f2e203".

> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "git://git.hcoop.net/git/bpt/emacs.git")
> +                    (commit "8f2e20304cbfdc046f4e3d3fca7b844f07e65076")))
> +              (sha256
> +               (base32
> +                "0f0i7ax0wi5q2w2kvr4bdzkcbzvcqvnbni0n8vdsrxc7ayl8zdi3"))))
> +    (inputs
> +     (cons
> +      `("guile" ,guilemacs-guile)
> +      (package-inputs emacs)))))

See my suggestion above about using ,@ within the quasiquote to do this.

Thanks for working on this!

      Mark

  reply	other threads:[~2015-05-10 21:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10 19:35 [PATCH] Attempt at packaging guile-emacs (needs help) Christopher Allan Webber
2015-05-10 21:51 ` Mark H Weaver [this message]
2015-05-11  2:29   ` Christopher Allan Webber
2015-05-14  0:01 ` [PATCH] Add guile-emacs! Christopher Allan Webber
2015-05-14  8:56   ` Taylan Ulrich Kammer
2015-05-14 15:53     ` Christopher Allan Webber
2015-05-14 20:06       ` Taylan Ulrich Kammer
2015-05-14 20:52         ` Taylan Ulrich Kammer
2015-05-15 10:13       ` Ludovic Courtès
2015-05-19 17:29     ` Christopher Allan Webber
2015-05-19 18:29       ` Taylan Ulrich Bayırlı/Kammer
2015-05-19 19:41         ` Christopher Allan Webber
2015-05-19 20:24           ` Taylan Ulrich Bayırlı/Kammer
2015-05-20 12:22             ` Ludovic Courtès
2015-05-23  7:26   ` Feng Shu
2015-05-23 17:21     ` Christopher Allan Webber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8738345cf8.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=cwebber@dustycloud.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).