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

Eric Bavier <ericbavier@centurylink.net> writes:

> 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

Thanks for sharing your Joy. :-)

>> +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 had this in mind too, but I am not sure how to achieve that.
Generating scripts that depend on $(prefix) at make time is indeed a
first start in conforming to that GCS requirement.  However in practice
I don't know any GNU package that conform to it.

> I bring it up because adding '$(prefix)/bin/guix' to the above rule
> might be a start.

If you mean:

--8<---------------cut here---------------start------------->8---
$(prefix)/bin/guix scripts/guix: scripts/guix.in Makefile
	...
--8<---------------cut here---------------end--------------->8---

I don't think it would work.  Installed files are not part of the
dependency graph, so I don't think this rule would be triggered when
doing ‘make install’.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

  reply	other threads:[~2018-01-23 11:08 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
2018-01-23 11:06   ` Mathieu Lirzin [this message]
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=87mv1496m7.fsf@gnu.org \
    --to=mthl@gnu.org \
    --cc=30147@debbugs.gnu.org \
    --cc=ericbavier@centurylink.net \
    /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.