all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Bavier <ericbavier@centurylink.net>
To: Mathieu Lirzin <mthl@gnu.org>
Cc: 30147@debbugs.gnu.org
Subject: [bug#30147] Simplify “scripts/guix”
Date: Mon, 22 Jan 2018 12:19:58 -0600	[thread overview]
Message-ID: <20180122121958.2eb9d1b4@centurylink.net> (raw)
In-Reply-To: <87inc0i8yt.fsf@gnu.org>

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

On Wed, 17 Jan 2018 20:25:14 +0100
Mathieu Lirzin <mthl@gnu.org> wrote:

> This moves the complexity of Autotools variable expansion outside of the
> application code.
> 
> * scripts/guix.in (config-lookup): Delete.
> (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables
> instead of calling ‘config-lookup’.
> * configure.ac: Don't use AC_CONFIG_FILES for ‘scripts/guix’.
> * Makefile.am (scripts/guix): New rule.
> (do_subst): New variable.
> (CLEANFILES, EXTRA_DIST): Adapt.

FWIW this is what my Joy compiler does for its entry script.  It works
well.

https://notabug.org/bavier/joy-in-the-morning.git

> +scripts/guix: scripts/guix.in Makefile
> +	$(AM_V_GEN)rm -f $@ $@-t \
> +	  && $(MKDIR_P) $(@D) \
> +	  && $(do_subst) <$(srcdir)/$@.in >$@-t \
> +	  && chmod a+x,a-w $@-t && mv -f $@-t $@

I think. since there's no state variables that needs to carry accross
commands, that this would read better without the line continuations and
appropriate use of $(AM_V_at).

While we're looking at it: I'm not certain, but I think Guix currently
work if one overrides the "prefix" variable when invoking 'make
install', which is a use-case suggested by the GNU Coding Standards
(Section 7.2.5).  I bring it up because adding '$(prefix)/bin/guix' to
the above rule might be a start.

> +;; Run Guix.
> +(let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main)))
> +  (bindtextdomain "guix" "@localedir@")
> +  (bindtextdomain "guix-packages" "@localedir@")
>    ;; XXX: It would be more convenient to change it to:
>    ;;   (exit (run-guix-main))
>    ;; but since the 'guix' command is not updated by 'guix pull', we cannot
>    ;; really do it now.
> -  (run-guix-main))
> +  (apply guix-main (command-line)))

If we're going to be patching scripts/guix.in, would now be the time to
add the '(exit ...)'?

Otherwise LGTM!

`~Eric

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

  reply	other threads:[~2018-01-22 23:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 19:25 [bug#30147] Simplify “scripts/guix” Mathieu Lirzin
2018-01-22 18:19 ` Eric Bavier [this message]
2018-01-23 11:06   ` Mathieu Lirzin
2018-01-23  9:13 ` bug#30147: " Ludovic Courtès
2018-01-23 12:29   ` [bug#30147] " Mathieu Lirzin
2018-01-23 14:01     ` Ludovic Courtès
2018-01-24 11:45       ` Mathieu Lirzin
2018-01-24 13:46         ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=20180122121958.2eb9d1b4@centurylink.net \
    --to=ericbavier@centurylink.net \
    --cc=30147@debbugs.gnu.org \
    --cc=mthl@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 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.