[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#30147] Simplify “scripts/guix”
From: |
Mathieu Lirzin |
Subject: |
[bug#30147] Simplify “scripts/guix” |
Date: |
Tue, 23 Jan 2018 12:06:40 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Eric Bavier <address@hidden> writes:
> On Wed, 17 Jan 2018 20:25:14 +0100
> Mathieu Lirzin <address@hidden> 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 $@ address@hidden \
>> + && $(MKDIR_P) $(@D) \
>> + && $(do_subst) <$(srcdir)/address@hidden >address@hidden \
>> + && chmod a+x,a-w address@hidden && mv -f address@hidden $@
>
> 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