aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/texlive.scm
blob: d8200846ac623ddd8d0cfabc591b0b3c9e2d5a87 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix 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.
;;;
;;; GNU Guix 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 GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages texlive)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system trivial)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages gd)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages icu4c)
  #:use-module (gnu packages image)
  #:use-module (gnu packages lua)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages pdf)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages ruby)
  #:use-module (gnu packages tcsh)
  #:use-module (gnu packages base)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages zip)
  #:autoload   (gnu packages texinfo) (texinfo)
  #:use-module (ice-9 ftw)
  #:use-module (srfi srfi-1))

(define texlive-extra-src
  (origin
    (method url-fetch)
    (uri "ftp://tug.org/historic/systems/texlive/2015/texlive-20150523-extra.tar.xz")
    (sha256 (base32
              "1dkhhacga8h1v2m9xv1w02glbdda2m8lfp1la1y1zb9yjj8jsa6i"))))

(define texlive-texmf-src
  (origin
    (method url-fetch)
    (uri "ftp://tug.org/historic/systems/texlive/2015/texlive-20150523-texmf.tar.xz")
    (sha256 (base32
              "1a3hpcg6x69ysqx432v6sk4alg0x34813cwk41frmvzprdajpyqy"))))

(define-public texlive-bin
  (package
   (name "texlive-bin")
   (version "2015")
   (source
    (origin
     (method url-fetch)
      (uri "ftp://tug.org/historic/systems/texlive/2015/texlive-20150521-source.tar.xz")
      (sha256 (base32
               "0sa6kmz4jwhv6lw702gxszhhjkvw071wba0ngk1c76g8vixwv6zd"))))
   (build-system gnu-build-system)
   (inputs
    `(("texlive-extra-src" ,texlive-extra-src)
      ("cairo" ,cairo)
      ("fontconfig" ,fontconfig)
      ("fontforge" ,fontforge)
      ("freetype" ,freetype)
      ("gd" ,gd)
      ("gmp" ,gmp)
      ("ghostscript" ,ghostscript)
      ("graphite2" ,graphite2)
      ("harfbuzz" ,harfbuzz)
      ("icu4c" ,icu4c)
      ("libpaper" ,libpaper)
      ("libpng" ,libpng)
      ("libxaw" ,libxaw)
      ("libxt" ,libxt)
      ("mpfr" ,mpfr)
      ("perl" ,perl)
      ("pixman" ,pixman)
      ("poppler" ,poppler)
      ("potrace" ,potrace)
      ("python" ,python-2) ; incompatible with Python 3 (print syntax)
      ("ruby" ,ruby)
      ("tcsh" ,tcsh)
      ("teckit" ,teckit)
      ("zlib" ,zlib)
      ("zziplib" ,zziplib)))
   (native-inputs
    `(("pkg-config" ,pkg-config)))
   (arguments
    `(#:out-of-source? #t
      #:configure-flags
       `("--disable-native-texlive-build"
         "--with-system-cairo"
         "--with-system-freetype2"
         "--with-system-gd"
         "--with-system-gmp"
         "--with-system-graphite2"
         "--with-system-harfbuzz"
         "--with-system-icu"
         "--with-system-libgs"
         "--with-system-libpaper"
         "--with-system-libpng"
         "--with-system-mpfr"
         "--with-system-pixman"
         "--with-system-poppler"
         "--with-system-potrace"
         "--with-system-teckit"
         "--with-system-xpdf"
         "--with-system-zlib"
         "--with-system-zziplib")

      ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
      ;; XXX FIXME fix luajit properly on mips64.
      #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
                                                  (%current-system))))
      #:phases
       (modify-phases %standard-phases
         (add-after 'install 'postint
           (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
             (let* ((out (assoc-ref outputs "out"))
                    (share (string-append out "/share"))
                    (texlive-extra (assoc-ref inputs "texlive-extra-src"))
                    (unpack (assoc-ref %standard-phases 'unpack))
                    (patch-source-shebangs
                      (assoc-ref %standard-phases 'patch-source-shebangs)))
               ;; Create symbolic links for the latex variants and their
               ;; man pages.
               (with-directory-excursion (string-append out "/bin/")
                 (for-each symlink
                 '("pdftex" "pdftex"   "xetex"   "luatex")
                 '("latex"  "pdflatex" "xelatex" "lualatex")))
               (with-directory-excursion (string-append share "/man/man1/")
                 (symlink "luatex.1" "lualatex.1"))
               ;; Unpack texlive-extra and install tlpkg.
               (mkdir "texlive-extra")
               (with-directory-excursion "texlive-extra"
                 (apply unpack (list #:source texlive-extra))
                 (apply patch-source-shebangs (list #:source texlive-extra))
                 (system* "mv" "tlpkg" share))))))))
   (synopsis "TeX Live, a package of the TeX typesetting system")
   (description
    "TeX Live provides a comprehensive TeX document production system.
It includes all the major TeX-related programs, macro packages, and fonts
that are free software, including support for many languages around the
world.

This package contains the binaries.")
   (license (license:fsf-free "http://tug.org/texlive/copying.html"))
   (home-page "http://www.tug.org/texlive/")))

(define-public texlive-texmf
  (package
   (name "texlive-texmf")
   (version "2015")
   (source texlive-texmf-src)
   (build-system gnu-build-system)
   (inputs
    `(("texlive-bin" ,texlive-bin)
      ("lua" ,lua)
      ("perl" ,perl)
      ("python" ,python-2) ; incompatible with Python 3 (print syntax)
      ("ruby" ,ruby)
      ("tcsh" ,tcsh)))
   (arguments
    `(#:modules ((guix build gnu-build-system)
                 (guix build utils)
                 (srfi srfi-26))
      #:phases
        (modify-phases (map (cut assq <> %standard-phases)
                            '(set-paths unpack patch-source-shebangs))
          (add-after 'patch-source-shebangs 'install
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((share (string-append (assoc-ref outputs "out") "/share")))
                (mkdir-p share)
                (system* "mv" "texmf-dist" share))))
          (add-after 'install 'texmf-config
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (share (string-append out "/share"))
                     (texmfroot (string-append share "/texmf-dist/web2c"))
                     (texmfcnf (string-append texmfroot "/texmf.cnf"))
                     (texlive-bin (assoc-ref inputs "texlive-bin"))
                     (texbin (string-append texlive-bin "/bin"))
                     (tlpkg (string-append texlive-bin "/share/tlpkg")))
                ;; Register SHARE as TEXMFROOT in texmf.cnf.
                (substitute* texmfcnf
                  (("TEXMFROOT = \\$SELFAUTOPARENT")
                  (string-append "TEXMFROOT = " share)))
                ;; Register paths in texmfcnf.lua, needed for context.
                (substitute* (string-append texmfroot "/texmfcnf.lua")
                  (("selfautodir:") out)
                  (("selfautoparent:") (string-append share "/")))
                ;; Set path to TeXLive Perl modules
                (setenv "PERL5LIB"
                        (string-append (getenv "PERL5LIB") ":" tlpkg))
                ;; Configure the texmf-dist tree; inspired from
                ;; http://slackbuilds.org/repository/13.37/office/texlive/
                (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
                (setenv "TEXMFCNF" texmfroot)
                (system* "updmap-sys" "--nohash" "--syncwithtrees")
                (system* "mktexlsr")
                (system* "fmtutil-sys" "--all")))))))
   (synopsis "TeX Live, a package of the TeX typesetting system")
   (description
    "TeX Live provides a comprehensive TeX document production system.
It includes all the major TeX-related programs, macro packages, and fonts
that are free software, including support for many languages around the
world.

This package contains the complete tree of texmf-dist data.")
   (license (license:fsf-free "http://tug.org/texlive/copying.html"))
   (home-page "http://www.tug.org/texlive/")))

(define-public texlive
  (package
   (name "texlive")
   (version "2015")
   (source #f)
   (build-system trivial-build-system)
   (inputs `(("bash" ,bash) ; for wrap-program
             ("texlive-bin" ,texlive-bin)
             ("texlive-texmf" ,texlive-texmf)))
   (arguments
    `(#:modules ((guix build utils))
      #:builder
        ;; Build the union of texlive-bin and texlive-texmf, but take the
        ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
        (begin
          (use-modules (guix build utils))
          (let ((out (assoc-ref %outputs "out"))
                (bin (assoc-ref %build-inputs "texlive-bin"))
                (texmf (assoc-ref %build-inputs "texlive-texmf"))
                (bash (assoc-ref %build-inputs "bash")))
               (mkdir out)
               (with-directory-excursion out
                 (for-each
                   (lambda (name)
                     (symlink (string-append bin "/" name) name))
                   '("include" "lib"))
                 (mkdir "bin")
                 (with-directory-excursion "bin"
                   (setenv "PATH" (string-append bash "/bin"))
                   (for-each
                     (lambda (name)
                       (symlink name (basename name))
                       (wrap-program
                         (basename name)
                         `("TEXMFCNF" =
                           (,(string-append texmf "/share/texmf-dist/web2c")))))
                     (find-files (string-append bin "/bin/") "")))
                 (mkdir "share")
                 (with-directory-excursion "share"
                   (for-each
                     (lambda (name)
                       (symlink (string-append bin "/share/" name) name))
                     '("info" "man" "tlpkg"))
                   (for-each
                     (lambda (name)
                       (symlink (string-append texmf "/share/" name) name))
                     '("texmf-dist" "texmf-var"))))))))
   (synopsis "TeX Live, a package of the TeX typesetting system")
   (description
    "TeX Live provides a comprehensive TeX document production system.
It includes all the major TeX-related programs, macro packages, and fonts
that are free software, including support for many languages around the
world.

This package contains the complete TeX Live distribution.")
   (license (license:fsf-free "http://tug.org/texlive/copying.html"))
   (home-page "http://www.tug.org/texlive/")))


;; texlive-texmf-minimal is a pruned, small version of the texlive tree,
;; in particular dropping documentation and fonts.
(define texlive-texmf-minimal
  (package (inherit texlive-texmf)
   (name "texlive-texmf-minimal")
   (arguments
    (substitute-keyword-arguments
     (package-arguments texlive-texmf)
     ((#:modules modules)
      `((ice-9 ftw)
        (srfi srfi-1)
        ,@modules))
     ((#:phases phases)
      `(modify-phases ,phases
         (add-after 'unpack 'prune
           (lambda _
             (define (delete subdir exclude)
               "Delete all files and directories in SUBDIR except for those
given in the list EXCLUDE."
               (with-directory-excursion subdir
                 (for-each delete-file-recursively
                           (lset-difference equal?
                                            (scandir ".")
                                            (append '("." "..")
                                                    exclude)))))
             (with-directory-excursion "texmf-dist"
               (for-each delete-file-recursively
                         '("doc" "source" "tex4ht"))
               ;; Delete all subdirectories of "fonts", except for "tfm" and
               ;; any directories named "cm".
               (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
               (delete "fonts/afm" '("public"))
               (delete "fonts/afm/public" '("amsfonts"))
               (delete "fonts/afm/public/amsfonts" '("cm"))
               (delete "fonts/map" '("dvips"))
               (delete "fonts/map/dvips" '("cm"))
               (delete "fonts/source" '("public"))
               (delete "fonts/source/public" '("cm"))
               (delete "fonts/tfm" '("public"))
               (delete "fonts/type1" '("public"))
               (delete "fonts/type1/public" '("amsfonts"))
               (delete "fonts/type1/public/amsfonts" '("cm")))
             #t))))))
   (description
    "TeX Live provides a comprehensive TeX document production system.
It includes all the major TeX-related programs, macro packages, and fonts
that are free software, including support for many languages around the
world.

This package contains a small subset of the texmf-dist data.")))


;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal
;; instead of the full texlive-texmf. It can be used, for instance, as a
;; native input to packages that need texlive to build their documentation.
(define-public texlive-minimal
  (package (inherit texlive)
   (name "texlive-minimal")
   (inputs
    `(("texlive-texmf" ,texlive-texmf-minimal)
      ,@(alist-delete "texlive-texmf" (package-inputs texlive))))
   (description
    "TeX Live provides a comprehensive TeX document production system.
It includes all the major TeX-related programs, macro packages, and fonts
that are free software, including support for many languages around the
world.

This package contains a small working part of the TeX Live distribution.")))


(define-public rubber
  (package
    (name "rubber")
    (version "1.1")
    (source (origin
             (method url-fetch)
             (uri (list (string-append "https://launchpad.net/rubber/trunk/"
                                       version "/+download/rubber-"
                                       version ".tar.gz")
                        (string-append "http://ebeffara.free.fr/pub/rubber-"
                                       version ".tar.gz")))
             (sha256
              (base32
               "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
    (build-system gnu-build-system)
    (arguments '(#:tests? #f))                    ; no `check' target
    (inputs `(("texinfo" ,texinfo)
              ("python" ,python-2) ; incompatible with Python 3 (print syntax)
              ("which" ,which)))
    (home-page "https://launchpad.net/rubber")
    (synopsis "Wrapper for LaTeX and friends")
    (description
     "Rubber is a program whose purpose is to handle all tasks related to the
compilation of LaTeX documents.  This includes compiling the document itself,
of course, enough times so that all references are defined, and running BibTeX
to manage bibliographic references.  Automatic execution of dvips to produce
PostScript documents is also included, as well as usage of pdfLaTeX to produce
PDF documents.")
    (license license:gpl2+)))
s;ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short # enough for shebangs. AM_DISTCHECK_CONFIGURE_FLAGS = \ --localstatedir="$$dc_install_base/var" \ --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \ --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \ --enable-daemon \ ac_cv_guix_test_root="$(GUIX_TEST_ROOT)" # The self-contained tarball. guix-binary.%.tar.xz: $(AM_V_GEN)GUIX_PACKAGE_PATH= \ tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \ --fallback \ -s "$*" --localstatedir --profile-name=current-guix \ guix` ; \ cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@" # The `dist' target has other dependencies when building from Git # to assert and achieve reproducibility. if in_git_p # The dependency on dist-doc-pot-update is to clean possibly stale doc and po # files and only then generate the .pot files, which are not checked in. dist: dist-doc-pot-update dist-doc-pot-update: auto-clean $(MAKE) guile$(EXEEXT) $(MAKE) -C po/guix all $(MAKE) -C po/packages all $(MAKE) doc-pot-update dist-hook: gen-ChangeLog gen-AUTHORS # Assert that Autotools cache is up to date with Git, by checking # PACKAGE_VERSION against HEAD. Indented to get past Automake. ifeq ($(MAKECMDGOALS),dist) git_version = $(shell build-aux/git-version-gen .tarball-version) ifneq ($(PACKAGE_VERSION),$(git_version)) $(warning Autotools cache out of date.) $(info Autotools cache version: $(PACKAGE_VERSION).) $(info Git version: $(git_version).) $(info Please run ./bootstrap && ./configure $(DIST_CONFIGURE_FLAGS)) ifneq ($(GUIX_ALLOW_IRREPRODUCIBLE_TARBALL),yes) $(error Cannot create reproducible tarball) else $(warning Tarball will be irreproducible; distdir will not get removed!) endif # !GUIX_ALLOW_IRREPRODUCIBLE_TARBALL endif # PACKAGE_VERSION != git_version endif # MAKECMDGOALS dist else # !in_git_p dist: doc-pot-update ifeq ($(MAKECMDGOALS),dist) $(warning Not using Git, tarball will likely be irreproducible!) endif # MAKECMDGOALS dist endif # !in_git_p dist-hook: gen-tarball-version dist-hook: assert-no-store-file-names distcheck-hook: assert-binaries-available assert-final-inputs-self-contained EXTRA_DIST += $(top_srcdir)/.version BUILT_SOURCES += $(top_srcdir)/.version $(top_srcdir)/.version: config.status $(AM_V_GEN)echo $(VERSION) > "$@-t" && mv "$@-t" "$@" gen-tarball-version: echo $(VERSION) > "$(distdir)/.tarball-version" echo $(SOURCE_DATE_EPOCH) > $(distdir)/.tarball-timestamp gen-ChangeLog: $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \ set -e; \ export LC_ALL=en_US.UTF-8; \ export TZ=UTC0; \ $(top_srcdir)/build-aux/gitlog-to-changelog \ > $(distdir)/ChangeLog.tmp; \ rm -f $(distdir)/ChangeLog; \ mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \ fi gen-AUTHORS: $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \ set -e; \ rm -f "$(distdir)/AUTHORS"; \ export LC_ALL=en_US.UTF-8; \ export TZ=UTC0; \ $(top_builddir)/pre-inst-env "$(GUILE)" \ "$(top_srcdir)/build-aux/generate-authors.scm" \ "$(top_srcdir)" "$(distdir)/AUTHORS"; # Like 'dist', but regenerate 'configure' so we get an up-to-date # 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to # do that whenever a 'dist' target is used.) dist-with-updated-version: @echo "Running './bootstrap' for new version string..." $(top_srcdir)/bootstrap $(MAKE) $(AM_MAKEFLAGS) $(top_srcdir)/.version dist .PHONY: dist-with-updated-version # # Release management. # # Reproducible tarball override GZIP_ENV = --best --no-name # Be friendly to Debian; avoid using EPOCH override am__tar = $${TAR-tar} \ --format=ustar \ --sort=name \ --mode=go=rX,u+rw,a-s \ --mtime=@$$(cat "$$tardir"/.tarball-timestamp) \ --owner=0 --group=0 --numeric-owner \ -cf - \ "$$tardir" releasedir = release-$(PACKAGE_VERSION) PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) # List of source tarballs produced. This must be kept in sync with the # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'. SOURCE_TARBALLS = \ $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext)) # Systems supported by Guix. SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \ powerpc64le-linux # Guix binary tarballs. BINARY_TARBALLS = \ $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz) # Systems supported by Guix System. GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux # Systems for which we build Guix VMs. GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux # Prefix of the Guix installation image file name. GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION) # Prefix of the Guix VM image file name. GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION) # Flags for 'guix system vm-image'. By default create a VM image that appears # to have a 20G hard disk. GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G # Return the sequence of '-s' flags for the given systems. system_flags = $(foreach system,$(1),-s $(system)) # The release process works in several phases: # # 0. We assume the developer created a 'vX.Y.Z' tag. # 1. Build the source tarball. # 2. Update the 'guix' package so that it corresponds to the 'vX.Y.Z' tag. # 3. Build the binary tarballs for that 'guix' package. # 4. Update the 'guix' package again. # 5. Build the installation and VM images. The images will run 'guix' # corresponding to 'vX.Y.Z' + 1 commit, and they will install 'vX.Y.Z'. # # This 'release' target takes care of everything and copies the resulting # files to $(releasedir). # # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext # issue described at <https://savannah.gnu.org/bugs/index.php?51027>. release: dist-with-updated-version all @if ! git diff-index --quiet HEAD; then \ echo "There are uncommitted changes; stopping." >&2 ; \ exit 1 ; \ fi $(MKDIR_P) "$(releasedir)" rm -f "$(releasedir)"/* mv $(SOURCE_TARBALLS) "$(releasedir)" # Bump the Guix package version and build it. GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \ $(top_builddir)/pre-inst-env "$(GUILE)" \ $(top_srcdir)/build-aux/update-guix-package.scm \ "`git rev-parse HEAD`" "$(PACKAGE_VERSION)" git add $(top_srcdir)/gnu/packages/package-management.scm git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)." $(top_builddir)/pre-inst-env guix build guix \ $(call system_flags,$(SUPPORTED_SYSTEMS)) \ -v1 --no-grafts --fallback # Generate the binary release tarballs. rm -f $(BINARY_TARBALLS) $(MAKE) $(BINARY_TARBALLS) for system in $(SUPPORTED_SYSTEMS) ; do \ mv "guix-binary.$$system.tar.xz" \ "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \ done # Build 'current-guix' to speed things up for the next step. $(top_builddir)/pre-inst-env guix build \ -e '((@ (gnu packages package-management) current-guix))' \ $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \ -v1 --no-grafts --fallback # Generate the ISO installation images. for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \ GUIX_DISPLAYED_VERSION="`git describe --match=v* | sed -'es/^v//'`" ; \ image=`$(top_builddir)/pre-inst-env \ guix system image -t iso9660 \ --label="GUIX_$${system}_$(VERSION)" \ --system=$$system --fallback \ gnu/system/install.scm` ; \ if [ ! -f "$$image" ] ; then \ echo "failed to produce Guix installation image for $$system" >&2 ; \ exit 1 ; \ fi ; \ cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \ mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \ "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \ done # Generate the VM images. for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \ GUIX_DISPLAYED_VERSION="`git describe --match=v* | sed -'es/^v//'`" ; \ image=`$(top_builddir)/pre-inst-env \ guix system image -t qcow2 $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \ --save-provenance \ --system=$$system --fallback \ gnu/system/examples/vm-image.tmpl` ; \ if [ ! -f "$$image" ] ; then \ echo "failed to produce Guix VM image for $$system" >&2 ; \ exit 1 ; \ fi ; \ cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \ done @echo @echo "Congratulations! All the release files are now in $(releasedir)." @echo update-guix-package: git rev-parse HEAD $(top_builddir)/pre-inst-env "$(GUILE)" \ $(top_srcdir)/build-aux/update-guix-package.scm \ "`git rev-parse HEAD`" # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>. # Package data from this checkout is used by 'update-NEWS.scm'. GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance update-NEWS: $(GOBJECTS) $(top_builddir)/pre-inst-env "$(GUILE)" \ $(top_srcdir)/build-aux/update-NEWS.scm \ $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data" # Make sure we're not shipping a file that embeds a local /gnu/store file name. assert-no-store-file-names: $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \ --exclude=*.info-[0-9] --exclude=*.dot \ --exclude=*.eps --exclude-dir=bootstrap \ --exclude=guix-manual.pot --exclude=guix-manual.*.po \ --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \ --exclude=guix-prettify.el \ --exclude=ChangeLog* \ --exclude=binutils-boot-2.20*.patch \ -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \ then \ echo "error: store file names embedded in the distribution" >&2 ; \ exit 1 ; \ fi # Make sure important substitutes are available. Check only the primary # server so that '--display-missing' doesn't print two lists. assert-binaries-available: $(GOBJECTS) $(AM_V_at)$(top_builddir)/pre-inst-env \ guix weather -m "$(top_srcdir)/etc/release-manifest.scm" \ --substitute-urls="https://ci.guix.gnu.org" \ --display-missing # Make sure the final inputs don't refer to bootstrap tools. assert-final-inputs-self-contained: $(GOBJECTS) $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \ "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm" # Validate channel news. check-channel-news: $(GOBJECTS) $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \ "$(top_srcdir)/build-aux/check-channel-news.scm" # Compute the Cuirass jobs. cuirass-jobs: $(GOBJECTS) rm -rf "$@" $(AM_V_at)$(MKDIR_P) "$@" $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \ "$(top_srcdir)/build-aux/cuirass/evaluate.scm" "$@" .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version .PHONY: assert-no-store-file-names assert-binaries-available .PHONY: assert-final-inputs-self-contained check-channel-news .PHONY: clean-go make-go as-derivation .PHONY: update-guix-package update-NEWS cuirass-jobs release # Git auto-configuration. .git/hooks/%: etc/git/% $(AM_V_at)if test -d .git; then \ cp "$<" "$@"; \ fi .git/config: etc/git/gitconfig $(AM_V_at)if command -v git >/dev/null && test -d .git; then \ git config --fixed-value --replace-all include.path \ ../etc/git/gitconfig ../etc/git/gitconfig; \ fi COMMIT_MSG_MAGIC = VGhpcyBpcyB0aGUgY29tbWl0LW1zZyBob29rIG9mIEd1aXg= .git/hooks/commit-msg: etc/git/commit-msg $(AM_V_at)if test -d .git; then \ if test -f $@ && ! grep -qF $(COMMIT_MSG_MAGIC) $@; then \ mkdir -p $@.d && mv $@ $@.d && \ @ echo user commit-msg hook moved to $@.d/commit-msg; \ fi; \ cp etc/git/commit-msg $@; \ fi # The etc/git/ config files are not distributed and have no use when building # from a tarball. Do not add dependencies on these to *_DATA when building # from a tarball, as that breaks the build. if in_git_p nodist_noinst_DATA = \ .git/hooks/pre-push \ .git/hooks/post-merge \ .git/config \ .git/hooks/commit-msg endif # Downloading up-to-date PO files. WEBLATE_REPO = https://framagit.org/tyreunom/guix-translations # Shallow clone the Git repository behind Weblate and copy files from it if # they contain at least one translation, and they are well-formed (Scheme # format only), warn otherwise. Copied files are converted to a canonical # form. download-po: dir=$$(mktemp -d); \ git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations" && \ for domain in po/doc po/guix po/packages; do \ for po in "$$dir/translations/$$domain"/*.po; do \ translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \ untranslated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | rev | cut -f3 -d' ' | rev); \ untranslated=$${untranslated:-0}; \ total=$$(($$translated+$$untranslated)); \ target=$$(basename "$$po"); \ target="$$domain/$$target"; \ msgfmt -c "$$po"; \ if msgfmt -c "$$po" && [ "$$translated" != "0" ] && ([ "$$domain" != "po/doc" ] || [ "$$translated" -gt $$(($$total/10)) ] || [ -f $$target ]); then \ msgfilter --no-wrap -i "$$po" cat > "$$po".tmp; \ mv "$$po".tmp "$$target"; \ echo "copied $$target."; \ else \ echo "WARN: $$target ($$translated translated messages ($$((translated/total*100))%)) was not added/updated."; \ fi; \ done; \ done; \ for po in po/doc/*.po; do \ translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \ untranslated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | rev | cut -f3 -d' ' | rev); \ untranslated=$${untranslated:-0}; \ total=$$(($$translated + $$untranslated)); \ if [ "$$translated" -lt "$$(($$total/20))" ]; then \ echo "WARN: $$po was removed because it is below the 5% threshold: $$((translated/total*100))%"; \ rm $$po; \ fi; \ done; \ rm -rf "$$dir" .PHONY: download-po ## -------------- ## ## Silent rules. ## ## -------------- ## AM_V_DL = $(AM_V_DL_$(V)) AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY)) AM_V_DL_0 = @echo " DL " $@; AM_V_DOT = $(AM_V_DOT_$(V)) AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY)) AM_V_DOT_0 = @echo " DOT " $@; AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V)) AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY)) AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@; AM_V_PO4A = $(AM_V_PO4A_$(V)) AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY)) AM_V_PO4A_0 = @echo " PO4A " $@; AM_V_POXREF = $(AM_V_POXREF_$(V)) AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY)) AM_V_POXREF_0 = @echo " POXREF " $@;