Commit Graph

85 Commits (bfe5264aa10c1af64adc5c24d0cf091562e3e09c)

Author SHA1 Message Date
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
Ludovic Courtès f05bdc9412 gnu: Don't use --strip-all in cases where this is problematic.
This is a followup to 856ae5e.  See <http://hydra.gnu.org/build/180506>
for an example of build failure.

* guix/build/gnu-build-system.scm (strip): Add #:archive-strip-flags
  parameter.  Use it when (ar-file? path).
* guix/build-system/gnu.scm (gnu-build): Add #:archive-strip-flags
  parameter and pass it down.
* gnu/packages/commencement.scm (gcc-boot0)[arguments]: Add
  #:strip-flags.
* gnu/packages/base.scm (glibc)[arguments]: Likewise.
2014-12-28 23:46:59 +01:00
Ludovic Courtès 7ec02d374d build-support/gnu: Add support for file patterns in search paths.
* guix/build/utils.scm (search-path-as-list): Add #:pattern parameter
  and honor it.
  (set-path-environment-variable): Likewise, and pass it to
  'search-path-as-list'.
* guix/packages.scm (search-path-specification->sexp): Add PATTERN slot.
* guix/build/gnu-build-system.scm (set-paths): Adjust accordingly.
2014-12-27 23:22:55 +01:00
Ludovic Courtès 856ae5e6c7 build-system/gnu: Strip with '--strip-all' instead of '--strip-debug'.
This saves 19% on the 'bin' directory of Coreutils, and certainly
helpful for things like Git's 'libexec' directory.

* guix/build-system/gnu.scm (gnu-build): Change default value for
  #:strip-flags to '("--strip-all").
* guix/build/gnu-build-system.scm (strip): Ditto.
* gnu/packages/linux.scm (linux-libre)[arguments]: Add #:strip-flags.
2014-12-27 19:20:18 +01:00
Ludovic Courtès 6aa47e3883 build-system/gnu: Add support for non-directory search paths.
Partly fixes <http://bugs.gnu.org/18033>.

* guix/build/utils.scm (search-path-as-list): Rename 'sub-directories'
  parameter to 'files'.  Add #:type parameter and honor it.
  (set-path-environment-variable): Likewise.  Pass #:type to
  'search-path-as-list'.
* guix/packages.scm (search-path-specification->sexp): Add 'directory as
  the last item of the tuple.
* guix/build/gnu-build-system.scm (set-paths): Add 'type' to search-path
  pattern.  Pass #:type to 'set-path-environment-variable'.
2014-12-27 12:25:31 +01:00
Ludovic Courtès 7cc7dec139 build-system/gnu: Add 'compress-documentation' phase.
* guix/build/gnu-build-system.scm (compress-documentation): New
  procedure.
  (%standard-phases): Add it.
2014-12-01 16:50:28 +01:00
Ludovic Courtès d68fe74162 build-system/gnu: Add 'validate-documentation-location' phase.
* guix/build/gnu-build-system.scm (validate-documentation-location): New
  procedure.
  (%standard-phases): Add it.
2014-12-01 14:09:36 +01:00
Ludovic Courtès f8bcf1935a build-system/gnu: Gracefully handle dangling symlinks in the 'strip' phase.
* guix/build/gnu-build-system.scm (strip): Check whether 'file-exists?'
  before calling 'elf-file?' and 'ar-file?'.  This should fix build
  failures in the presence of dangling symlinks, as in
  <http://hydra.gnu.org/build/167521/nixlog/1/raw>.
2014-11-24 22:45:41 +01:00
Ludovic Courtès e8c7fdda5d build-system/gnu: Strip 'ar' archives as well.
* guix/build/gnu-build-system.scm (strip): Also strip when (ar-file?
  PATH) is true.
2014-11-22 21:54:27 +01:00
Ludovic Courtès 50b87bd54b build-system/gnu: Strip only ELF files.
Suggested by Mark H Weaver <mhw@netris.org>
at <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00395.html>.

* guix/build/gnu-build-system.scm (strip)[strip-dir]: Strip only
  when (elf-file? PATH) is true.
2014-11-22 12:49:14 +01:00
Ludovic Courtès e6039b9c70 utils: Export 'parallel-job-count'.
* guix/build/utils.scm (parallel-job-count): New procedure.
* guix/build/gnu-build-system.scm (%parallel-job-count): Remove.
  (build, check): Use 'parallel-job-count' instead.
2014-11-22 12:32:32 +01:00
Mark H Weaver 8a0576f175 gnu-build-system: Add 'patch-usr-bin-file' to %standard-phases.
* guix/build/gnu-build-system.scm (patch-usr-bin-file): New procedure.
  (%standard-phases): Add it.
2014-08-23 20:48:18 -04:00
Ludovic Courtès 8d846470f2 build-system/gnu: Reset timestamps on build tree when source is a directory.
* guix/build/utils.scm (copy-recursively): Add #:keep-mtime? parameter
  and honor it.
* guix/build/gnu-build-system.scm (unpack): Use #:keep-mtime? #t.
* gnu/packages/admin.scm (shadow)[arguments]: Remove 'reset-timestamps'
  phase.
2014-04-14 00:09:42 +02:00
Ludovic Courtès 17919a5801 build-system/gnu: Allow the source to be a directory.
* guix/build/gnu-build-system.scm (unpack): Check if SOURCE is a
  directory, and copy it locally if it is.
* gnu/packages/libwebsockets.scm (libwebsockets)[arguments]: Remove
  'unpack' phase.
2014-02-22 00:34:49 +01:00
John Darrington c2e6516721 build-system/gnu: Set the docdir to "share/doc"
* guix/build/gnu-build-system.scm (configure):
  Change docdir directory from "doc" to "share/doc".

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-02-10 22:22:53 +01:00
Ludovic Courtès 49a8b80da6 Revert "build-system/gnu: Pass --localstatedir=/var --sharedstatedir=/com."
This reverts commit 65529e49ff.
2014-01-28 08:57:37 +01:00
Ludovic Courtès 65529e49ff build-system/gnu: Pass --localstatedir=/var --sharedstatedir=/com.
Suggested by John Darrington <john@darrington.wattle.id.au>
and Mark H Weaver <mhw@netris.org>.

* guix/build/gnu-build-system.scm (configure): Pass --localstatedir=/var
  --sharedstatedir=/com.
* gnu/packages/admin.scm (dmd): Remove 'arguments' field.
* gnu/packages/avahi.scm (avahi): Remove --localstatedir flag.
* gnu/packages/glib.scm (dbus): Likewise.
* gnu/packages/package-management.scm (guix): Likewise.
* gnu/packages/pulseaudio.scm (pulseaudio): Likewise.
2014-01-27 23:45:59 +01:00
John Darrington db6190899e gnu: gnu-build-system: Add CC_FOR_BUILD to configure flags.
* guix/build/gnu-build-system.scm: Add new configure flag: CC_FOR_BUILD=gcc

* gnu/packages/gnupg.scm, gnu/packages/guile.scm, gnu/packages/make-bootstrap.scm:
  remove CC_FOR_BUILD from these package descriptions.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2013-12-17 21:28:07 +01:00
Ludovic Courtès 7e2b10a53f build-system/{gnu,cmake}: Remove #:patches and #:patch-flags parameters.
* guix/build/gnu-build-system.scm (patch): Remove.
  (%standard-phases): Remove 'patch'.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Remove
  #:patches and #:patch-flags parameters.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/python.scm (package-with-explicit-python): Update
  comment.
2013-10-10 23:15:57 +02:00
Ludovic Courtès be58d01a7e build-system/gnu: Write debug files to the "debug" sub-derivation, if any.
* guix/build/gnu-build-system.scm (strip): Add `objcopy-command' keyword
  parameter.
  [debug-output, debug-file-extension]: New variables.
  [debug-file, make-debug-file, add-debug-link]: New procedures.
  [strip-dir]: Use them.
2013-07-03 23:53:31 +02:00
Ludovic Courtès 2f41f51c40 build-system/gnu: Set #:tests? to #f when cross-compiling.
* guix/build/gnu-build-system.scm (check): Add `target' formal
  parameter.  Change `tests?' to default to (not target).
2013-06-22 16:15:23 +02:00