From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: [PATCH 06/13] build: Generate man pages after compiling guile objects. Date: Sun, 24 Jan 2016 21:19:24 +0100 Message-ID: <1453666771-16869-7-git-send-email-mthl@gnu.org> References: <1453666771-16869-1-git-send-email-mthl@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.7.0.rc3" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNR97-0003aA-5S for guix-devel@gnu.org; Sun, 24 Jan 2016 15:20:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNR95-0005cY-R3 for guix-devel@gnu.org; Sun, 24 Jan 2016 15:20:25 -0500 In-Reply-To: <1453666771-16869-1-git-send-email-mthl@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org This is a multi-part message in MIME format. --------------2.7.0.rc3 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: quoted-printable This improves compilation speed since scripts are not compiled twice. When building with =E2=80=98make -j4=E2=80=98 from a clean repository on = an Intel i5-2540M, the time of compilation gets from: real 5m7.220s user 18m49.788s sys 0m12.964s down to: real 2m20.820s user 7m25.992s sys 0m7.464s * configure.ac (BUILD_FROM_GIT): New Automake conditional. * doc.am (SUBCOMMANDS): Delete variable. (dist_man1_MANS): List all subcommands man pages. (doc/guix.1): Build only if BUILD_FROM_GIT. Depend on 'scripts/guix' instead of all subcommands. [BUILD_DAEMON] (doc/guix-daemon): Likewise. Replace the 'nix/nix-daemon/guix-daemon.cc' prerequisite with 'guix-daemon'. [BUILD_FROM_GIT] (gen_man): New variable. [BUILD_FROM_GIT] (doc/guix-%.1): New target. (CLEANFILES) [BUILD_FROM_GIT]: Add $(dist_man1_MANS). --- configure.ac | 4 +++ doc.am | 90 +++++++++++++++++++++++++++++-------------------------= ------ 2 files changed, 47 insertions(+), 47 deletions(-) --------------2.7.0.rc3 Content-Type: text/x-patch; name="0006-build-Generate-man-pages-after-compiling-guile-objec.patch" Content-Disposition: inline; filename="0006-build-Generate-man-pages-after-compiling-guile-objec.patch" Content-Transfer-Encoding: quoted-printable diff --git a/configure.ac b/configure.ac index f61c04c..0bd9144 100644 --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,10 @@ AC_CACHE_SAVE =20 m4_include([config-daemon.ac]) =20 +dnl Are we building from git checked-out sources, or a tarball ? This a= llows +dnl specifying some rules used only when bootstrapping. +AM_CONDITIONAL([BUILD_FROM_GIT], [test -d "$srcdir/.git"]) + dnl `dot' (from the Graphviz package) is only needed for maintainers. dnl See `Building from Git' in the manual for more info. AM_MISSING_PROG([DOT], [dot]) diff --git a/doc.am b/doc.am index f15efcc..9214405 100644 --- a/doc.am +++ b/doc.am @@ -2,6 +2,7 @@ # Copyright =C2=A9 2012, 2013, 2014, 2015, 2016 Ludovic Court=C3=A8s # Copyright =C2=A9 2013 Andreas Enge # Copyright =C2=A9 2016 Taylan Ulrich Bay=C4=B1rl=C4=B1/Kammer +# Copyright =C2=A9 2016 Mathieu Lirzin # # This file is part of GNU Guix. # @@ -91,55 +92,50 @@ ps-local: $(DOT_FILES=3D%.dot=3D$(top_srcdir)/%.eps) = \ $(top_srcdir)/doc/images/coreutils-size-map.eps dvi-local: ps-local =20 -=0C -# Manual pages. - -doc/guix.1: $(SUBCOMMANDS:%=3Dguix/scripts/%.scm) - -LANGUAGE=3D $(top_builddir)/pre-inst-env \ - $(HELP2MAN) --output=3D"$@" guix - -# Note: Do not depend on 'guix-daemon' since that would trigger a rebuil= d even -# for people building from a tarball. -doc/guix-daemon.1: nix/nix-daemon/guix-daemon.cc - -LANGUAGE=3D $(top_builddir)/pre-inst-env \ - $(HELP2MAN) --output=3D"$@" guix-daemon - -define subcommand-manual-target - -doc/guix-$(1).1: guix/scripts/$(1).scm - -LANGUAGE=3D $(top_builddir)/pre-inst-env \ - $(HELP2MAN) --output=3D"$$@" "guix $(1)" - -endef - -SUBCOMMANDS :=3D \ - archive \ - build \ - challenge \ - download \ - edit \ - environment \ - gc \ - hash \ - import \ - lint \ - package \ - publish \ - pull \ - refresh \ - size \ - system - -$(eval $(foreach subcommand,$(SUBCOMMANDS), \ - $(call subcommand-manual-target,$(subcommand)))) - -dist_man1_MANS =3D \ - doc/guix.1 \ - $(SUBCOMMANDS:%=3Ddoc/guix-%.1) +## ------------ ## +## Man pages. ## +## ------------ ## + +# The man pages are generated using 'help2man'. +dist_man1_MANS =3D \ + doc/guix.1 \ + doc/guix-archive.1 \ + doc/guix-build.1 \ + doc/guix-challenge.1 \ + doc/guix-download.1 \ + doc/guix-edit.1 \ + doc/guix-environment.1 \ + doc/guix-gc.1 \ + doc/guix-hash.1 \ + doc/guix-import.1 \ + doc/guix-lint.1 \ + doc/guix-package.1 \ + doc/guix-publish.1 \ + doc/guix-pull.1 \ + doc/guix-refresh.1 \ + doc/guix-size.1 \ + doc/guix-system.1 =20 if BUILD_DAEMON +dist_man1_MANS +=3D doc/guix-daemon.1 +endif + +# Avoid re-generating the man pages when building from tarballs. +if BUILD_FROM_GIT + +gen_man =3D LANGUAGE=3D $(top_builddir)/pre-inst-env $(HELP2MAN) + +doc/guix.1: scripts/guix + $(gen_man) --output=3D"$@" `basename $<` =20 -dist_man1_MANS +=3D \ - doc/guix-daemon.1 +doc/guix-%.1: guix/scripts/%.go + $(gen_man) --output=3D"$@" "guix `basename $< .go`" =20 +if BUILD_DAEMON +doc/guix-daemon.1: guix-daemon + $(gen_man) --output=3D"$@" "$<" endif + +CLEANFILES +=3D $(dist_man1_MANS) + +endif BUILD_FROM_GIT --------------2.7.0.rc3--