From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edwQx-0001k6-ET for guix-patches@gnu.org; Tue, 23 Jan 2018 06:08:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edwQs-0001pS-EW for guix-patches@gnu.org; Tue, 23 Jan 2018 06:08:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:59415) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edwQs-0001pN-9n for guix-patches@gnu.org; Tue, 23 Jan 2018 06:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1edwQs-00085C-3f for guix-patches@gnu.org; Tue, 23 Jan 2018 06:08:02 -0500 Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-Message-ID: From: Mathieu Lirzin References: <87inc0i8yt.fsf@gnu.org> <20180122121958.2eb9d1b4@centurylink.net> Date: Tue, 23 Jan 2018 12:06:40 +0100 In-Reply-To: <20180122121958.2eb9d1b4@centurylink.net> (Eric Bavier's message of "Mon, 22 Jan 2018 12:19:58 -0600") Message-ID: <87mv1496m7.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Eric Bavier Cc: 30147@debbugs.gnu.org Eric Bavier writes: > On Wed, 17 Jan 2018 20:25:14 +0100 > Mathieu Lirzin wrote: > >> This moves the complexity of Autotools variable expansion outside of the >> application code. >>=20 >> * scripts/guix.in (config-lookup): Delete. >> (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables >> instead of calling =E2=80=98config-lookup=E2=80=99. >> * configure.ac: Don't use AC_CONFIG_FILES for =E2=80=98scripts/guix=E2= =80=99. >> * 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 =E2=80=98make install=E2=80=99. --=20 Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37