Commit Graph

105 Commits

Author SHA1 Message Date
Efraim Flashner
1b2b7765a0
build: gnu-build-system: Adjust NOCONFIGURE variable.
This ia a follow-up to 481a0f1a7c.

* guix/build/gnu-build-system.scm (bootstrap): Set NOCONFIGURE for all
bootstrap scripts. Clean up variable after use.
2020-02-16 18:45:37 +02:00
Brendan Tildesley
a21bd6d5c2
build-system/gnu: Don't try executing directories in bootstrap phase.
* guix/build/gnu-build-system.scm: (bootstrap): Change the file-exists?
procedure to one that excludes directories, so that we do not mistake it for a
script. For example if the source includes a bootstrap/ directory.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
2020-02-16 15:48:37 +01:00
Efraim Flashner
481a0f1a7c
build: gnu-build-system: Don't run configure during bootstrap.
* guix/build/gnu-build-system.scm (bootstrap): Add NOCONFIGURE
environment variable before running bootstrap scripts.
2020-02-16 09:05:32 +02:00
Ludovic Courtès
cfd4e4d06e
build-system/gnu: Make 'first-subdirectory' deterministic.
Fixes <https://bugs.gnu.org/35387>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/build/gnu-build-system.scm (first-subdirectory): Rewrite using
'scandir' so that the result is deterministic.
2019-06-14 23:02:28 +02:00
Ludovic Courtès
6db044db45
build-system/gnu: Copy license files to all the outputs.
Fixes <https://bugs.gnu.org/34702>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/build/gnu-build-system.scm (install-license-files)[copy-to-directories]:
New procedure.
Call it to copy license files to all the outputs.
2019-03-10 22:24:08 +01:00
Ludovic Courtès
278409e7e9
build-system/gnu: Always look for license files in the source tree.
Fixes <https://bugs.gnu.org/31103>.

* guix/build/gnu-build-system.scm (install-license-files): Add #:out-of-source?.
[find-source-directory]: New procedure.
Use it to Determine the source directory and look for license files
there.
2019-03-10 22:24:08 +01:00
Ludovic Courtès
f380f9d55e
build-system/gnu: Report invocation errors in a human-friendly way.
* guix/build/utils.scm (report-invoke-error): New procedure.
* guix/build/gnu-build-system.scm (gnu-build): Guard against
'invoke-error?'.
2019-01-29 11:00:42 +01:00
Ludovic Courtès
782f1ea9f6
utils: Switch to the new 'setvbuf' API.
* guix/build/utils.scm (setvbuf) [(and guile-2 (not guile-2.2))]: New
procedure.
(remove-store-references): Use the 2.2 'setvbuf' API style.
* guix/build/gnu-build-system.scm (gnu-build): Likewise.
2019-01-29 09:49:33 +01:00
Mark H Weaver
82230603ce
build-system/gnu: If a phase returns #f, the build fails.
Fixes <https://bugs.gnu.org/31974>.
Introduced by commit d8a3b1b9e8.

* guix/build/gnu-build-system.scm (gnu-build): Use 'every' instead
of 'for-each'.
2018-08-03 23:12:33 -04:00
Ludovic Courtès
d0a2db47fb
ld-wrapper: Allow linking with non-store libraries by default.
This was suggested on several occasions, notably
<https://bugs.gnu.org/24544>.

* gnu/packages/ld-wrapper.in (%allow-impurities?): Default to #t and
parse the value of 'GUIX_LD_WRAPPER_ALLOW_IMPURITIES'.
* guix/build/gnu-build-system.scm (set-paths): Set
'GUIX_LD_WRAPPER_ALLOW_IMPURITIES'.
2018-03-29 17:58:16 +02:00
Ludovic Courtès
248871e006
build-system/gnu: Fix typo.
* guix/build/gnu-build-system.scm (dump-file-contents): Fix typo in
'string-pad' argument.
2018-03-20 17:01:41 +01:00
Ludovic Courtès
88b87c352f
build-system/gnu: Dump test suite logs upon 'check' failure.
Suggested by Mark H Weaver <mhw@netris.org>.

* guix/build/gnu-build-system.scm (dump-file-contents): New procedure.
(%test-suite-log-regexp): New variable.
(check): Add #:test-suite-log-regexp.  Catch 'invoke-error?' and call
'dump-file-contents' upon error.
2018-03-20 13:29:37 +01:00
Mark H Weaver
99aaeaa00b
build-system/gnu: Tolerate errors during the 'strip' phase.
This is a followup to commit 9a87649c86.

* guix/build/gnu-build-system.scm (strip)[strip-dir]: If an invoke error
occurs, issue a warning and continue to the next file.  This restores the
tolerance of stripping errors prior to commit 9a87649.
2018-03-16 20:02:59 -04:00
Mark H Weaver
d8a3b1b9e8
gnu-build: Issue a warning unless every phase returns #t.
* guix/build/gnu-build-system.scm (gnu-build): Issue a warning if a phase
returns a value other than #t.
2018-03-16 09:08:25 -04:00
Mark H Weaver
e9b23fe8bd
build-system/gnu: Return a boolean from all phase procedures.
* guix/build/gnu-build-system.scm (patch-source-shebangs)
(patch-generated-file-shebangs, strip): Return #t.
(validate-runpath): Raise an exception if validation fails.  Never return #f.
2018-03-16 06:44:09 -04:00
Mark H Weaver
9a87649c86
build-system/gnu: Use invoke instead of system*.
* guix/build/gnu-build-system.scm (unpack, configure, build, check, install)
(strip, compress-documentation): Use invoke and remove vestigial plumbing.
2018-03-16 05:01:45 -04:00
Ludovic Courtès
189be331ac
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.
2018-03-11 22:04:40 +01:00
Ludovic Courtès
a864d56302
build-system/gnu: Add 'install-license-files' phase.
Suggested by Dave Love <fx@gnu.org>.

* guix/build-system/gnu.scm (%license-file-regexp): New variable.
(gnu-build): Add #:license-file-regexp and use it.
(gnu-cross-build): Likewise.
* guix/build/gnu-build-system.scm (%license-file-regexp): New variable.
(install-license-files): New procedure.
(%standard-phases): Add it.
2017-11-08 22:43:56 +01:00
Ludovic Courtès
2ac6998063
build-system/gnu: Work around 'time-monotonic' bug in Guile 2.2.2.
Fixes <http://bugs.gnu.org/27303>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/build/gnu-build-system.scm (time-monotonic) [guile-2.2]: Define.
2017-06-11 22:52:23 +02:00
Maxim Cournoyer
facac29280
build-system/gnu: 'compress-documentation' phase handles double symlinks.
The compress-documentation phase was breaking recursive symbolic links used
for manuals, which was made visible by the `find-files' call in the recently
added `manual-database' profile hook.  See <http://bugs.gnu.org/26771>.

* guix/build/gnu-build-system.scm (compress-documentation)
[points-to-symbolic-link?]: New procedure.
[maybe-compress-directory]: Use `points-to-symbolic-link?' to filter out
symbolic links that shouldn't be retargetted, and re-order the calls to
`retarget-symlink' and `documentation-compressor'.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-05-30 21:56:20 +02:00
Marius Bakke
5a64a79131
utils: Add helper method to make files writable.
* gnu/build/activation.scm (make-file-writable): Move this to ...
* guix/build/utils.scm (make-file-writable): ... here. Export it.
* guix/build/gnu-build-system.scm (strip): Use it.
2017-01-26 22:19:16 +01:00
Ludovic Courtès
1d636d6319
build-system/gnu: Add 'reset-gzip-timestamps' phase.
* guix/build/gnu-build-system.scm (reset-gzip-timestamps): New
procedure.
(%standard-phases): Add it.
2017-01-26 22:05:49 +01:00
Ludovic Courtès
0363474a0b
build-system/gnu: 'strip' phase now skips symlinks.
This avoids a situation where the "debug" output would contain separate
(and different) .debug files for "libfoo.so" and "libfoo.so.0.0", even
though "libfoo.so" is actually a symlink to "libfoo.so.0.0".

* guix/build/gnu-build-system.scm (strip): Remove 'file-exists?' call in
'for-each' lambda.  Pass a predicate to 'find-files' to restrict the
result to regular files.
2017-01-26 11:29:38 +01:00
Marius Bakke
c254ac3200
build-system/gnu: Make libraries writable before stripping.
* guix/build/gnu-build-system.scm (strip)[strip-dir]: Change mode of
files before running strip-command.
2016-11-26 09:07:07 +01:00
John Darrington
d31860b9de
build-system/gnu: Add 'patch-dot-desktop-files' phase.
* guix/build/gnu-build-system.scm (patch-dot-desktop-files): New
procedure.
(%standard-phases): Add it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-10-01 11:55:06 +02:00
Ludovic Courtès
5c9632c75a
build-system/gnu: Do not patch symlinks in the source.
This is a followup to 13a9feb5b64fd819eaed38a17da0284bbe2b8d9.

* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove call
to 'remove'.  Pass a second argument to 'find-files' to filter out
symlinks; pass #:stat lstat.
(patch-generated-file-shebangs): Likewise, and also filter out
non-executable files.
2016-09-12 21:51:25 +02:00
Ludovic Courtès
ff43e353a1
build-system/gnu: 'strip' phase lists files in sorted order.
This fixes a bug whereby the choice between stripping 'libfoo.so.0.1.2'
and stripping 'libfoo.so' (the symlink) would be non-deterministic.

* guix/build/gnu-build-system.scm (strip)[strip-dir]: Use 'find-files'
instead of 'file-system-fold' so that files are picked in deterministic
order.
2016-09-01 23:48:08 +02:00
Jan Nieuwenhuizen
c13a9feb5b build-system/gnu: Do not patch symlinks.
This fixes location-aware scripts.

* guix/build/gnu-build-system.scm (patch-shebangs)[list-of-files]: Use
'lstat' instead of 'stat'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-02-09 11:39:30 +01:00
Ludovic Courtès
0beb65b450 build-system/gnu: Add 'set-SOURCE-DATE-EPOCH' phase.
This phase is inherited by other build systems, which ensures
'SOURCE_DATE_EPOCH' is always set in practice.

* guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): Remove.
(%standard-phases): Don't add it.
* guix/build/gnu-build-system.scm (set-SOURCE-DATE-EPOCH): New
procedure.
(%standard-phases): Add it.
(gnu-build): Remove 'setenv' call for "SOURCE_DATE_EPOCH".
2016-01-05 15:52:42 +01:00
Ludovic Courtès
7165a91c7d build-system/gnu: Use the long option name for deterministic archives.
This is a followup to 3eb34c6.

* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Use
"--enable-deterministic-archives" instead of "-D" to work around
Binutils bug <https://sourceware.org/bugzilla/show_bug.cgi?id=17671>.
* guix/build/gnu-build-system.scm (strip): Likewise.
2016-01-01 00:49:05 +01:00
Ludovic Courtès
3eb34c631a build-system/gnu: Always pass "-D" to strip/objcopy.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Add "-D" to
  #:strip-flags.
* guix/build/gnu-build-system.scm (strip): Likewise.  Also pass "-D" to
  OBJCOPY-COMMAND.
2015-12-18 23:58:51 +01:00
Alex Kost
f7dbeb376b build-system/gnu: Set 'SOURCE_DATE_EPOCH'.
Suggested by Ludovic Courtès <ludo@gnu.org>.

* guix/build/gnu-build-system.scm (gnu-build): Set SOURCE_DATE_EPOCH for
  deterministic builds.
2015-11-14 21:59:37 +03:00
Ludovic Courtès
afd3d9316c Use "normalized codesets" everywhere.
In other words, change "xx_YY.UTF-8" to "xx_YY.utf8".

* guix/profiles.scm (ca-certificate-bundle): Use "en_US.utf8" instead of
  "en_US.UTF-8".
* guix/packages.scm (patch-and-repack): Likewise.
* guix/build/gnu-build-system.scm (install-locale): Likewise.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise.
* gnu/packages/python.scm (python-ipython): Likewise.
* gnu/packages/gawk.scm (gawk): Likewise.
* build-aux/hydra/demo-os.scm: Likewise.
* gnu/packages/guile.scm (guile-ncurses)[arguments]: Remove
  'change-locale' phase.
2015-10-04 00:10:03 +02:00
Ludovic Courtès
57aff6476e utils: Add 'every*'.
* guix/build/gnu-build-system.scm (every*): Move to...
* guix/build/utils.scm (every*): ... here.  New procedure.
2015-10-03 14:36:12 +02:00
Ludovic Courtès
5c962e93e5 build-system/gnu: Use monotic time to measure elapsed time.
* guix/build/gnu-build-system.scm (gnu-build)[elapsed-time]: New
  procedure.
  Use it, and use (current-time time-monotonic) instead
  of (gettimeofday).  Show one digit after the comma for the elapsed
  time.
2015-08-30 17:07:45 +02:00
Mark H Weaver
3c7d023d64 build-system/gnu: Pass --build=<triplet> to configure by default.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Accept #:build
  keyword argument.  Pass it to 'gnu-build' on the build side.
* guix/build/gnu-build-system.scm (configure): Accept #:build keyword
  argument.  Unless it is false, pass --build to configure.
2015-07-13 18:54:40 -04:00
Ludovic Courtès
0bd4377566 build-system/gnu: #:validate-runpath? now defaults to #t.
* guix/build/gnu-build-system.scm (validate-runpath): Change default
  value of VALIDATE-RUNPATH? to #t.
2015-04-23 18:52:40 +02:00
Ludovic Courtès
cb85eb5e65 build-system/gnu: Gracefully handle dangling symlinks.
Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <tcech@suse.cz>.

* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove files
  that don't pass 'file-exists?'.
  (patch-generated-file-shebangs): Likewise.
2015-04-23 18:52:40 +02:00
Federico Beffa
b198545df6 build-system/gnu: Add docstring to 'delete-info-dir-file'.
* guix/build/gnu-build-system.scm (delete-info-dir-file): Add docstring.
2015-04-06 10:47:31 +02:00
Federico Beffa
26b261ecfe build-system/gnu: Add 'delete-info-dir-file' phase.
* guix/build/gnu-build-system.scm (delete-info-dir-file): New procedure.
  (%standard-phases): Use it.
2015-04-06 10:22:21 +02:00
Ludovic Courtès
112da58875 build-system/gnu: Add 'validate-runpath' phase.
* guix/build/gnu-build-system.scm (every*, validate-runpath): New
  procedures.
  (%standard-phases): Add 'validate-runpath'.
* guix/build-system/gnu.scm (%gnu-build-system-modules): Add (guix build
  gremlin) and (guix elf).
  (gnu-build): Add #:validate-runpath?.
  [builder]: Pass it.
  (gnu-cross-build): Likewise.
* gnu/packages/base.scm (glibc)[arguments]: Add #:validate-runpath? #f.
2015-04-01 16:47:49 +02:00
Ludovic Courtès
bbe7a2ce0c Revert "build-system/gnu: Keep the sloppy conversion strategy during bootstrap."
This reverts commit b479c3ddaf.
This commit was the result of an incorrect characterization of the
problem; see the log of commit 87c8b92 for details.
2015-03-01 17:05:41 +01:00
Ludovic Courtès
b479c3ddaf build-system/gnu: Keep the sloppy conversion strategy during bootstrap.
* guix/build/gnu-build-system.scm (gnu-build): Leave
  %DEFAULT-PORT-CONVERSION-STRATEGY unchanged when 'string->bytevector'
  fails to convert to ISO-8859-1.  This is an attempt to work around the
  build failures at <http://hydra.gnu.org/build/263002>.
2015-03-01 00:23:07 +01:00
Ludovic Courtès
4db87162e6 packages: Set the port conversion strategy to 'error'.
Suggested by Mark H Weaver.

* guix/build/gnu-build-system.scm (gnu-build): Set
  %DEFAULT-PORT-CONVERSION-STRATEGY to 'error.
* guix/packages.scm (patch-and-repack)[builder]: Likewise.
2015-02-28 01:10:24 +01:00
Ludovic Courtès
251e8b2ee8 build-system/gnu: Set $LC_ALL (or similar) to the chosen locale.
Suggested by Mark H Weaver.

* guix/build/utils.scm (locale-category->string): New procedure.
* guix/build/gnu-build-system.scm (install-locale): Add 'setenv' call.
2015-02-27 15:08:37 +01:00
Ludovic Courtès
5335c56e8e build-system/gnu: Add 'install-locale' phase.
* guix/build/gnu-build-system.scm (install-locale): New procedure.
  (%standard-phases): Add it.
* guix/build-system/gnu.scm (gnu-build): Add #:locale and pass it to
  the build script.
  (gnu-cross-build): Likewise.
2015-02-26 23:36:55 +01:00
Ludovic Courtès
cd0385b61a build-system/gnu: Add support for zip archives.
Fixes <http://bugs.gnu.org/19866>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/build/gnu-build-system.scm (unpack): Use 'unzip' when SOURCE ends
  in '.zip'.
2015-02-26 22:48:33 +01:00
Ludovic Courtès
4eb01e5442 build-system/gnu: Patch /usr/bin/file in all 'configure' files.
* guix/build/utils.scm (patch-/usr/bin/file): New procedure.
* guix/build/gnu-build-system.scm (patch-usr-bin-file): Rewrite using
  it.  Patch all the files returned by 'find-files' that are executable.
* gnu/packages/gawk.scm (gawk)[arguments]: Remove use of 'substitute*'
  for 'extension/configure'.
2015-01-09 23:29:20 +01:00
Ludovic Courtès
ac70048be2 build-system/gnu: Use executables from the target inputs in 'patch-shebangs'.
Fixes <http://bugs.gnu.org/18895>.

* guix/build/gnu-build-system.scm (patch-shebangs): Add #:inputs
  parameter.  Remove 'bindirs'.  Add 'bin-directories',
  'output-bindirs', and 'input-bindirs'.  Use them instead of (getenv
  "PATH") to as the argument to 'patch-shebang'.
2015-01-04 18:16:16 +01:00
Ludovic Courtès
7da473b757 gnu: Revert use of '--strip-all'.
This reverts commits f05bdc9412
and 856ae5e6c7.

This broke all sorts of things.  See <http://hydra.gnu.org/eval/102058>,
for example.
2014-12-29 21:54:12 +01:00