aboutsummaryrefslogtreecommitdiff
#! /bin/sh
# -*-scheme-*-
export LANG=C LANGUAGE=C LC_TIME=C
export TZ=UTC0
exec guile --no-auto-compile -L $srcdir -C $srcdir -e '(mdate-from-git)' -s "$0" "$@"
!#

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; This program is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;;; Commentary:
;;;
;;; Usage: mdate-from-git.scm FILE
;;;
;;; This script is compatible with Automake's `mdate-sh' but uses the timestamp
;;; from Git instead of from the file system.  Also, it can be appended to
;;; mdate-sh.

;;; As a special exception for Guix, it caters for doc/guix.LANG.texi files that
;;; are not stored in Git, by using po/doc/guix-manual.LANG.po for the Git
;;; timestamp.  Test doing something like:
;;;
;;; build-aux/mdate-from-git.scm doc/guix.de.texi
;;;
;;;; Code:

(define-module (mdate-from-git)
  #:use-module (ice-9 match)
  #:use-module (ice-9 popen)
  #:use-module (ice-9 rdelim)
  #:use-module (ice-9 regex)
  #:export (main))

(define (pipe-command command)
  (let* ((port (apply open-pipe* OPEN_READ command))
         (output (read-string port)))
    (close-port port)
    output))

(define (guix.LANG.texi->guix-manual.LANG.po file-name)
  "Translated manuals doc/guix.LANG.texi are not tracked in Git and are
generated from po/doc/guix-manual.LANG.po.  For such an untraced .TEXI file,
return its .PO counterpart."
  (let ((m (string-match "doc/guix.([^.]+).texi" file-name)))
    (if (not m) file-name
        (let ((lang (match:substring m 1)))
          (format #f "po/doc/guix-manual.~a.po" lang)))))


;;;
;;; Entry point.
;;;
(define (main args)
  (match args
    ((script file-name)
     (let* ((command `("git" "ls-files" "--error-unmatch" "--" ,file-name))
            (tracked? (zero? (with-error-to-port (%make-void-port "w")
                               (lambda _
                                 (with-output-to-port (%make-void-port "w")
                                   (lambda _ (apply system* command)))))))
            (file-name (if tracked? file-name
                           (guix.LANG.texi->guix-manual.LANG.po file-name)))
            (command `("git" "log" "--pretty=format:%ct" "-n1" "--" ,file-name))
            (timestamp (with-error-to-port  (%make-void-port "w")
                         (lambda _ (pipe-command command))))
            (source-date-epoch (or (getenv "SOURCE_DATE_EPOCH") "1"))
            (timestamp (if (string-null? timestamp) source-date-epoch
                           timestamp))
            (time (gmtime (string->number timestamp)))
            (d-m-y (strftime "%-d %B %Y" time)))
       (display d-m-y)))
    (_
     (format (current-error-port) "Usage: mdate-from-git.scm FILE\n")
     (exit 2))))
ng.texi?id=deb6276dda81a69da38e842d269c5370a28fa5cf'>Remove Emacs interface....* emacs/guix-about.el: Remove file. * emacs/guix-backend.el: Likewise. * emacs/guix-base.el: Likewise. * emacs/guix-buffer.el: Likewise. * emacs/guix-build-log.el: Likewise. * emacs/guix-command.el: Likewise. * emacs/guix-config.el.in: Likewise. * emacs/guix-devel.el: Likewise. * emacs/guix-entry.el: Likewise. * emacs/guix-external.el: Likewise. * emacs/guix-geiser.el: Likewise. * emacs/guix-guile.el: Likewise. * emacs/guix-help-vars.el: Likewise. * emacs/guix-helper.scm.in: Likewise. * emacs/guix-history.el: Likewise. * emacs/guix-hydra-build.el: Likewise. * emacs/guix-hydra-jobset.el: Likewise. * emacs/guix-hydra.el: Likewise. * emacs/guix-info.el: Likewise. * emacs/guix-init.el: Likewise. * emacs/guix-license.el: Likewise. * emacs/guix-list.el: Likewise. * emacs/guix-location.el: Likewise. * emacs/guix-main.scm: Likewise. * emacs/guix-messages.el: Likewise. * emacs/guix-pcomplete.el: Likewise. * emacs/guix-popup.el: Likewise. * emacs/guix-prettify.el: Likewise. * emacs/guix-profiles.el: Likewise. * emacs/guix-read.el: Likewise. * emacs/guix-ui-generation.el: Likewise. * emacs/guix-ui-license.el: Likewise. * emacs/guix-ui-location.el: Likewise. * emacs/guix-ui-package.el: Likewise. * emacs/guix-ui-system-generation.el: Likewise. * emacs/guix-ui.el: Likewise. * emacs/guix-utils.el: Likewise. * emacs/local.mk: Likewise. * doc/emacs.texi: Likewise. * doc/guix.texi: Remove cross-references to Emacs nodes. (Package Management): Mention 'emacs-guix' package. * doc/contributing.texi (The Perfect Setup): Remove the reference. * doc/htmlxref.cnf: Add 'emacs-guix' URL. * Makefile.am: Remove Emacs stuff. * configure.ac: Likewise. * gnu/packages/package-management.scm (guix-0.12.0)[native-inputs]: Remove "emacs". [propagated-inputs]: Remove "geiser" and "emacs-magit-popup". Co-authored-by: Ludovic Courtès <ludo@gnu.org> Alex Kost 2016-12-14doc: Fix typo in Submitting Patches section....* doc/contributing.texi (Submitting Patches): Fix "could could" typo. Signed-off-by: Leo Famulari <leo@famulari.name> Maxim Cournoyer 2016-07-28doc: Discourage software bundling....Fixes <http://bugs.gnu.org/24008>. Suggested by ng0 <ng0@we.make.ritual.n0.is>. * doc/contributing.texi (Submitting Patches): Add item about bundling. Ludovic Courtès 2016-07-28doc: Send changes in your patch which are related....* doc/contributing.texi (Submitting Patches): New @item: This gives information about sending related changes and examples on what we view as related changes. Co-authored-by: Ludovic Courtès <ludo@gnu.org> ng0 2016-07-28doc: Mention separate branch for packages with many dependents....Suggested by ng0 <ng0@we.make.ritual.n0.is>. * doc/contributing.texi (Submitting Patches): Add note on packages with more than 100 dependents. Ludovic Courtès 2016-07-24doc: Point out preference of message format....* doc/contributing.texi (Submitting Patches): Includes a note on preference of plain text messages with either inline or MIME attachments and advise contributers to pay attention if their email client breaks the patches. Signed-off-by: Ludovic Courtès <ludo@gnu.org> ng0 2016-07-24doc: Explain that contributors can use a pseudonym....Suggested by ng0 <ng0@we.make.ritual.n0.is>. * doc/contributing.texi (Contributing): Explain that using a legal name is not required. Ludovic Courtès 2016-07-22doc: Add note on gender-neutral wording....Suggested by ng0 <ng0@we.make.ritual.n0.is>. * doc/contributing.texi (Submitting Patches): Add @item regarding gender-neutral wording. Ludovic Courtès 2016-04-16doc: Mention --localstatedir for when building from Git....Reported by Hartmut Goebel <h.goebel@crazy-compilers.com>. * doc/contributing.texi (Building from Git): Mention --localstatedir. Ludovic Courtès 2016-03-11doc: Add footnote about pointing ~/.config/guix/latest at user's checkout...* doc/contributing.texi (Running Guix Before It Is Installed): New footnote. Christopher Allan Webber 2016-02-24doc: Fix minor typos and add missing words....* doc/guix.texi (Shepherd Services): Add missing words. (Invoking guix system): Fix typo. (Service Types and Services): Fix typo. * doc/contributing.texi (Submitting Patches): Fix typo. Signed-off-by: Andreas Enge <andreas@enge.fr> Chris Marusich 2015-12-09doc: rephrase code of conduct....* doc/contributing.texi (Contributing): Rephrase 'code of conduct' section. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Alex Sassmannshausen 2015-12-09Add "Contributor Covenant"....* CODE-OF-CONDUCT: New file, adapted from <http://contributor-covenant.org/version/1/3/0/code_of_conduct.txt>. * doc/contributing.texi (Contributing): Mention it. * Makefile.am (EXTRA_DIST): Add it. Ludovic Courtès 2015-12-08guix build: Add '--rounds'....* guix/scripts/build.scm (show-build-options-help) (%standard-build-options): Add --rounds. (set-build-options-from-command-line): Honor it. * doc/guix.texi (Invoking guix build): Document it. * doc/contributing.texi (Submitting Patches): Mention it. Ludovic Courtès 2015-11-22doc: Mention 'guix environment guix'....* doc/contributing.texi (Building from Git): Mention 'guix environment guix'. Remove outdated description of ./bootstrap. Clarify a few things. Ludovic Courtès 2015-11-21doc: Remove extraneous "See."...* doc/contributing.texi (Building from Git): Remove extra "See" and use @xref instead of @pxref. Ludovic Courtès 2015-11-21doc: Fix 'geiser-guile-load-path' example....Reported by marusich on #guix. * doc/contributing.texi (The Perfect Setup): Wrap modifying 'geiser-guile-load-path' into 'with-eval-after-load'. Alex Kost 2015-11-03doc: './pre-inst-env guix pull' won't upgrade local source tree....* doc/contributing.texi (Running Guix Before It Is Installed): Clarify './pre-inst-env guix pull' won't upgrade local source tree. * doc/guix.texi (Invoking guix pull): Mention ~/.config/guix/latest. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Alex Vong 2015-10-28doc: Add texinfo to the requirements when building from git....* doc/contributing.texi (Building from Git): Add GNU Texinfo to the list of additional requirements. Mark H Weaver 2015-10-27doc: Add a REPL example....* doc/contributing.texi (Running Guix Before It Is Installed): Add REPL example. * doc/emacs.texi (Emacs General info): Add @cindex. Ludovic Courtès 2015-10-20Add 'guix challenge'....* guix/scripts/challenge.scm, tests/challenge.scm: New files. * Makefile.am (MODULES): Add the former. (SCM_TESTS): Add the latter. * doc.am (SUBCOMMANDS): Add 'challenge'. * doc/guix.texi (Substitutes): Add xref to 'guix challenge'. (Invoking guix challenge): New node. * doc/contributing.texi (Submitting Patches): Add note about using 'guix challenge'. * po/guix/POTFILES.in: Add guix/scripts/challenge.scm. Ludovic Courtès 2015-09-23emacs: Add development utils....* emacs/guix-guile.el (guix-guile-current-module): New function. * emacs/guix-devel.el: New file. * emacs.am (ELFILES): Add it. * doc/emacs.texi (Emacs Development): New node. (Emacs Interface): Add it. * doc/contributing.texi (The Perfect Setup): Mention it. * doc/guix.texi (Top): Add it. * emacs/guix-init.el: Add 'guix-devel-activate-mode-maybe' to 'scheme-mode-hook'. Alex Kost 2015-09-15doc: Add guidelines for synopses and descriptions....* doc/guix.texi (Synopses and Descriptions): New node. * doc/contributing.texi (Submitting Patches): Add item that cross-references it. Ludovic Courtès 2015-06-18Add 'guix size'....* guix/scripts/size.scm: New file. * Makefile.am (MODULES): Add it. (SCM_TESTS): Add tests/size.scm. * doc.am (SUBCOMMANDS): Add 'size'. * po/guix/POTFILES.in: Add guix/scripts/size.scm. * tests/size.scm: New file. * doc/guix.texi (Packages with Multiple Outputs): Add xref to "Invoking guix size". (Invoking guix size): New node. (Invoking guix gc): Add index for "closure" and xref to the above. * doc/contributing.texi (Submitting Patches): Use @enumerate for the check list. Add item about 'guix size'. Ludovic Courtès 2015-06-14doc: Move most 'HACKING' informations into the manual....* HACKING (Contributing): New section. (Building from Git, The Perfect Setup, Coding Style, Submitting Patches): Move to ... * doc/guix.texi (Running Guix Before It Is Installed): Likewise. * doc/contributing.texi: ... here. New file. * doc.am (EXTRA_DIST): Use it. * README (Installation): Adapt to it. * configure.ac (DOT): Likewise. Mathieu Lirzin