summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-03-11 21:46:30 +0100
committerLudovic Courtès <ludo@gnu.org>2018-03-11 22:04:40 +0100
commit189be331acfda1c242a9c85fca8d2a0356742f48 (patch)
treeeba84cadba69ac4be51f7d4d81676d945437cf1f /guix/build
parent5c6391b33acaaae75746f6ae30089d4aec14c349 (diff)
build-system/gnu: Add 'bootstrap' phase.
This factorizes what has become a widespread idiom. * guix/build/gnu-build-system.scm (%bootstrap-scripts): New variable. (bootstrap): New procedure. (%standard-phases): Add it after 'unpack'. * guix/build/ant-build-system.scm (%standard-phases): Delete 'bootstrap. * guix/build/asdf-build-system.scm (%standard-phases/source) (%standard-phases): Likewise. * guix/build/cargo-build-system.scm (%standard-phases): Likewise. * guix/build/cmake-build-system.scm (%standard-phases): Likewise. * guix/build/dub-build-system.scm (%standard-phases): Likewise. * guix/build/emacs-build-system.scm (%standard-phases): Likewise. * guix/build/font-build-system.scm (%standard-phases): Likewise. * guix/build/go-build-system.scm (%standard-phases): Likewise. * guix/build/haskell-build-system.scm (%standard-phases): Likewise. * guix/build/minify-build-system.scm (%standard-phases): Likewise. * guix/build/ocaml-build-system.scm (%standard-phases): Likewise. * guix/build/perl-build-system.scm (%standard-phases): Likewise. * guix/build/python-build-system.scm (%standard-phases): Likewise. * guix/build/r-build-system.scm (%standard-phases): Likewise. * guix/build/ruby-build-system.scm (%standard-phases): Likewise. * guix/build/scons-build-system.scm (%standard-phases): Likewise. * guix/build/texlive-build-system.scm (%standard-phases): Likewise. * guix/build/waf-build-system.scm (%standard-phases): Likewise. * gnu/packages/audio.scm (faad2)[arguments]: Replace 'bootstrap. (soundtouch, cuetools, bluez-alsa): Remove 'arguments'. (cava)[arguments]: Replace 'bootstrap. * gnu/packages/backup.scm (rdup): Remove 'bootstrap. * gnu/packages/bioinformatics.scm (seek)[arguments]: Replace 'bootstrap. * gnu/packages/bioinformatics.scm (htslib-for-sambamba): Remove 'arguments'. * gnu/packages/ci.scm (hydra, cuirass): Remove 'bootstrap'. * gnu/packages/crypto.scm (libb2): Remove #:phases. * gnu/packages/databases.scm (guile-wiredtiger): Likewise. * gnu/packages/debug.scm (stress-make): Remove 'bootstrap'. * gnu/packages/documentation.scm (asciidoc): Likewise. * gnu/packages/fontutils.scm (libuninameslist): Remove 'arguments'. * gnu/packages/ftp.scm (weex): Remove 'arguments'. * gnu/packages/game-development.scm (ois): Remove 'arguments'. * gnu/packages/games.scm (pioneer): Remove 'bootstrap. * gnu/packages/gnome.scm (vte-ng, byzanz): Replace 'bootstrap. (arc-theme): Remove 'arguments'. (faba-icon-theme): Remove 'bootstrap. (arc-icon-theme): Remove 'arguments'. * gnu/packages/gnunet.scm (guile-gnunet): Likewise. * gnu/packages/gtk.scm (guile-rsvg): Likewise. * gnu/packages/guile.scm (mcron2): Remove 'bootstrap. (guile-bash): Remove #:phases. (guile-git): Remove 'bootstrap. (guile-syntax-highlight): Remove 'arguments'. (guile-sjson): Likewise. * gnu/packages/java.scm (classpath-devel): Remove 'bootstrap. * gnu/packages/kodi.scm (libdvdnav/kodi) (libdvdread/kodi, libdvdcss/kodi): Likewise. * gnu/packages/libreoffice.scm (hunspell): Remove 'arguments'. * gnu/packages/libusb.scm (hidapi): Likewise. * gnu/packages/linux.scm (bridge-utils): Rename 'bootstrap' to 'patch-stuff'; move it before 'bootstrap', without autoreconf invocation. (eudev): Rename 'bootstrap' to 'patch-file-names', without 'autogen.sh' invocation; move it before 'bootstrap. (gpm): Replace 'bootstrap'. (f2fs-tools): Remove 'arguments'. (rng-tools): Remove #:phases. * gnu/packages/messaging.scm (hexchat): Rename 'bootstrap' to 'copy-intltool-makefile'; remove "autoreconf" invocation and move before 'bootstrap'. (libmesode): Remove 'arguments'. (libstrophe): Likewise. * gnu/packages/microcom.scm (microcom): Likewise. * gnu/packages/networking.scm (libnet): Remove 'bootstrap. * gnu/packages/onc-rpc.scm (libnsl): Remove 'arguments'. * gnu/packages/package-management.scm (guix): Replace 'bootstrap. * gnu/packages/sawfish.scm (librep): Remove 'arguments'. * gnu/packages/version-control.scm (findnewest): Likewise. * gnu/packages/video.scm (liba52, handbrake, motion): Replace 'bootstrap. * gnu/packages/web.scm (fcgiwrap): Remove #:phases. (tidy): Replace 'bootstrap. (gumbo-parser): Remove #:phases. * gnu/packages/wget.scm (wget2): Replace 'bootstrap. * gnu/packages/wm.scm (i3lock-color): Remove #:phases. * gnu/packages/xdisorg.scm (xclip): Likewise. * gnu/packages/xml.scm (libxls): Replace 'bootstrap'. * gnu/packages/xorg.scm (xf86-video-freedreno) (xf86-video-intel): Remove #:phases. * gnu/packages/zile.scm (zile-on-guile): Replace 'bootstrap.
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/ant-build-system.scm1
-rw-r--r--guix/build/asdf-build-system.scm2
-rw-r--r--guix/build/cargo-build-system.scm1
-rw-r--r--guix/build/cmake-build-system.scm3
-rw-r--r--guix/build/dub-build-system.scm1
-rw-r--r--guix/build/emacs-build-system.scm1
-rw-r--r--guix/build/font-build-system.scm1
-rw-r--r--guix/build/gnu-build-system.scm40
-rw-r--r--guix/build/go-build-system.scm1
-rw-r--r--guix/build/haskell-build-system.scm1
-rw-r--r--guix/build/minify-build-system.scm1
-rw-r--r--guix/build/ocaml-build-system.scm1
-rw-r--r--guix/build/perl-build-system.scm3
-rw-r--r--guix/build/python-build-system.scm3
-rw-r--r--guix/build/r-build-system.scm1
-rw-r--r--guix/build/ruby-build-system.scm1
-rw-r--r--guix/build/scons-build-system.scm1
-rw-r--r--guix/build/texlive-build-system.scm1
-rw-r--r--guix/build/waf-build-system.scm1
19 files changed, 61 insertions, 4 deletions
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index 6ce813a001..a6da530dab 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -228,6 +228,7 @@ repack them. This is necessary to ensure that archives are reproducible."
(define %standard-phases
(modify-phases gnu:%standard-phases
(replace 'unpack unpack)
+ (delete 'bootstrap)
(replace 'configure configure)
(replace 'build build)
(replace 'check check)
diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm
index c5e820a00a..dd6373b33a 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -220,6 +220,7 @@ valid."
(define %standard-phases/source
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(delete 'configure)
(delete 'check)
(delete 'build)
@@ -227,6 +228,7 @@ valid."
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(delete 'configure)
(delete 'install)
(replace 'build build)
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 139b40321f..f52444f61c 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -172,6 +172,7 @@ SRC-NAME as if it was part of the directory DIR-NAME with name
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(replace 'configure configure)
(replace 'build build)
(replace 'check check)
diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm
index c82d9fef87..6f4e05f948 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
@@ -86,6 +86,7 @@
;; Everything is as with the GNU Build System except for the `configure'
;; and 'check' phases.
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(replace 'check check)
(replace 'configure configure)))
diff --git a/guix/build/dub-build-system.scm b/guix/build/dub-build-system.scm
index ed86635708..9a72e3d544 100644
--- a/guix/build/dub-build-system.scm
+++ b/guix/build/dub-build-system.scm
@@ -121,6 +121,7 @@
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(replace 'configure configure)
(replace 'build build)
(replace 'check check)
diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm
index b779847424..7c3b635139 100644
--- a/guix/build/emacs-build-system.scm
+++ b/guix/build/emacs-build-system.scm
@@ -262,6 +262,7 @@ second hyphen. This corresponds to 'name-version' as used in ELPA packages."
(modify-phases gnu:%standard-phases
(add-after 'set-paths 'set-emacs-load-path set-emacs-load-path)
(replace 'unpack unpack)
+ (delete 'bootstrap)
(delete 'configure)
;; Move the build phase after install: the .el files are byte compiled
;; directly in the store.
diff --git a/guix/build/font-build-system.scm b/guix/build/font-build-system.scm
index f2a646f6f4..6726595fe1 100644
--- a/guix/build/font-build-system.scm
+++ b/guix/build/font-build-system.scm
@@ -59,6 +59,7 @@ archive, or a font file."
(define %standard-phases
(modify-phases gnu:%standard-phases
(replace 'unpack unpack)
+ (delete 'bootstrap)
(delete 'configure)
(delete 'check)
(delete 'build)
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 7b43361f99..420fe815f9 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -159,6 +159,43 @@ working directory."
(zero? (system* "tar" "xvf" source)))
(chdir (first-subdirectory ".")))))
+(define %bootstrap-scripts
+ ;; Typical names of Autotools "bootstrap" scripts.
+ '("bootstrap" "bootstrap.sh" "autogen.sh"))
+
+(define* (bootstrap #:key (bootstrap-scripts %bootstrap-scripts)
+ #:allow-other-keys)
+ "If the code uses Autotools and \"configure\" is missing, run
+\"autoreconf\". Otherwise do nothing."
+ ;; Note: Run that right after 'unpack' so that the generated files are
+ ;; visible when the 'patch-source-shebangs' phase runs.
+ (if (not (file-exists? "configure"))
+
+ ;; First try one of the BOOTSTRAP-SCRIPTS. If none exists, and it's
+ ;; clearly an Autoconf-based project, run 'autoreconf'. Otherwise, do
+ ;; nothing (perhaps the user removed or overrode the 'configure' phase.)
+ (let ((script (find file-exists? bootstrap-scripts)))
+ ;; GNU packages often invoke the 'git-version-gen' script from
+ ;; 'configure.ac' so make sure it has a valid shebang.
+ (false-if-file-not-found
+ (patch-shebang "build-aux/git-version-gen"))
+
+ (if script
+ (let ((script (string-append "./" script)))
+ (format #t "running '~a'~%" script)
+ (if (executable-file? script)
+ (begin
+ (patch-shebang script)
+ (invoke script))
+ (invoke "sh" script)))
+ (if (or (file-exists? "configure.ac")
+ (file-exists? "configure.in"))
+ (invoke "autoreconf" "-vif")
+ (format #t "no 'configure.ac' or anything like that, \
+doing nothing~%"))))
+ (format #t "GNU build system bootstrapping not needed~%"))
+ #t)
+
;; See <http://bugs.gnu.org/17840>.
(define* (patch-usr-bin-file #:key native-inputs inputs
(patch-/usr/bin/file? #t)
@@ -672,6 +709,7 @@ which cannot be found~%"
(let-syntax ((phases (syntax-rules ()
((_ p ...) `((p . ,p) ...)))))
(phases set-SOURCE-DATE-EPOCH set-paths install-locale unpack
+ bootstrap
patch-usr-bin-file
patch-source-shebangs configure patch-generated-file-shebangs
build check install
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 3114067aa9..7c833a616f 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -261,6 +261,7 @@ files in OUTPUTS."
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(delete 'configure)
(delete 'patch-generated-file-shebangs)
(replace 'unpack unpack)
diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index 3afc37e16d..268d59c1be 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -266,6 +266,7 @@ given Haskell package."
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(add-before 'configure 'setup-compiler setup-compiler)
(add-before 'install 'haddock haddock)
(add-after 'install 'register register)
diff --git a/guix/build/minify-build-system.scm b/guix/build/minify-build-system.scm
index 3580deda07..563def88e9 100644
--- a/guix/build/minify-build-system.scm
+++ b/guix/build/minify-build-system.scm
@@ -60,6 +60,7 @@
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(delete 'configure)
(replace 'build build)
(delete 'check)
diff --git a/guix/build/ocaml-build-system.scm b/guix/build/ocaml-build-system.scm
index f77251ca09..d10431d8ef 100644
--- a/guix/build/ocaml-build-system.scm
+++ b/guix/build/ocaml-build-system.scm
@@ -103,6 +103,7 @@
;; Everything is as with the GNU Build System except for the `configure'
;; , `build', `check' and `install' phases.
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(add-before 'configure 'ocaml-findlib-environment
ocaml-findlib-environment)
(add-before 'install 'prepare-install prepare-install)
diff --git a/guix/build/perl-build-system.scm b/guix/build/perl-build-system.scm
index b2024e4406..5c9cbdf912 100644
--- a/guix/build/perl-build-system.scm
+++ b/guix/build/perl-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2015, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -76,6 +76,7 @@
;; Everything is as with the GNU Build System except for the `configure',
;; `build', `check', and `install' phases.
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(replace 'install install)
(replace 'check check)
(replace 'build build)
diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index dd07986b94..0366571c2f 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
@@ -247,6 +247,7 @@ installed with setuptools."
;; 'configure' phase is not needed.
(modify-phases gnu:%standard-phases
(add-after 'unpack 'ensure-no-mtimes-pre-1980 ensure-no-mtimes-pre-1980)
+ (delete 'bootstrap)
(delete 'configure)
(replace 'install install)
(replace 'check check)
diff --git a/guix/build/r-build-system.scm b/guix/build/r-build-system.scm
index 24aa73d4f2..5e18939d22 100644
--- a/guix/build/r-build-system.scm
+++ b/guix/build/r-build-system.scm
@@ -99,6 +99,7 @@
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(delete 'configure)
(delete 'build)
(delete 'check) ; tests must be run after installation
diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index 09ae2390a5..abef6937bc 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -308,6 +308,7 @@ extended with definitions for VARS."
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(delete 'configure)
(replace 'unpack unpack)
(add-before 'build 'extract-gemspec extract-gemspec)
diff --git a/guix/build/scons-build-system.scm b/guix/build/scons-build-system.scm
index a8760968d8..96c653966d 100644
--- a/guix/build/scons-build-system.scm
+++ b/guix/build/scons-build-system.scm
@@ -52,6 +52,7 @@
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(delete 'configure)
(replace 'build build)
(replace 'check check)
diff --git a/guix/build/texlive-build-system.scm b/guix/build/texlive-build-system.scm
index f6b9b96b87..78141b48d8 100644
--- a/guix/build/texlive-build-system.scm
+++ b/guix/build/texlive-build-system.scm
@@ -81,6 +81,7 @@
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(replace 'configure configure)
(replace 'build build)
(delete 'check)
diff --git a/guix/build/waf-build-system.scm b/guix/build/waf-build-system.scm
index 85f0abcfd6..f0364e867d 100644
--- a/guix/build/waf-build-system.scm
+++ b/guix/build/waf-build-system.scm
@@ -70,6 +70,7 @@
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (delete 'bootstrap)
(replace 'configure configure)
(replace 'build build)
(replace 'check check)