Commit Graph

4008 Commits (95207e70d561517c8db8992f61552004f8213b04)

Author SHA1 Message Date
Ludovic Courtès 95207e70d5
store: 'with-store' expands to a single procedure call.
* guix/store.scm (call-with-store): New procedure.
(with-store): Write in terms of 'call-with-store'.
2019-04-10 12:40:58 +02:00
Ludovic Courtès 21b3c0ca87
guix package: Use absolute file names in search path recommendations.
Suggested by Chris Marusich.

* guix/scripts/package.scm (absolutize): New procedure.
(display-search-paths): Use it.
2019-04-10 12:40:58 +02:00
Ivan Petkov 1d3acde508
build-system/cargo: refactor phases to successfully build
* guix/build-system/cargo.scm (%cargo-build-system-modules):
Add (json parser).
(cargo-build):
[vendor-dir]: Define flag and pass it to builder code.
[cargo-test-flags]: Likewise.
[skip-build?]: Likewise.
* guix/build/cargo-build/system.scm (#:use-module): use (json parser).
(package-name->crate-name): Delete it.
(manifest-targets): Add it.
(has-executable-target?): Add it.
(configure): Add #:vendor-dir name and use it.
Don't touch Cargo.toml.
Don't symlink to duplicate inputs.
Remove useless registry line from cargo config.
Define RUSTFLAGS to lift lint restrictions.
(build): Add #:skip-build? flag and use it.
(check): Likewise.
Add #:cargo-test-flags and pass it to cargo.
(install): Factor source logic to install-source.
Define #:skip-build? flag and use it.
Only install if executable targets are present.
(install-source): Copy entire crate directory not just src.
[generate-checksums] pass dummy file for unused second argument.
(%standard-phases): Add install-source phase.

Signed-off-by: Chris Marusich <cmmarusich@gmail.com>
2019-04-09 03:09:00 -07:00
Ludovic Courtès b227457f62
licenses: Remove 'bsd-style'.
This procedure had been deprecated since March 2015.

* guix/licenses.scm (bsd-style): Remove.
2019-04-08 10:42:51 +02:00
Ludovic Courtès 1199da08aa
size: Optimize dependency size computation.
This reduces 'guix size' run time by ~4% here:

  items="$(guix build icecat inkscape emacs libreoffice)"
  guix size $items

* guix/scripts/size.scm (store-profile): Define 'size-table' and use it
to lookup the size of ITEM in 'dependency-size'.
2019-04-07 11:36:00 +02:00
Katherine Cox-Buday cd0a9c91b2
licenses: Add Lisp Lesser General Public License.
* gnu/licenses.scm (llgpl): New variable.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2019-04-07 09:14:41 +08:00
Ludovic Courtès 985730c1af
scripts: More commands default to verbosity level 1.
* guix/scripts/environment.scm (%default-options): Change 'verbosity' to 1.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/system.scm (guix-system): Likewise, except for the
'build' command.
2019-04-04 17:47:02 +02:00
Ludovic Courtès c1ef50ac79
gexp: Remove workarounds for <https://bugs.gnu.org/15602>.
* gnu/services/base.scm (hydra-key-authorization)[aaa]: Remove.
[default-acl]: Don't import it.
* guix/scripts/pack.scm (store-database)[build]: Don't import
(gnu build install).
2019-04-04 17:47:02 +02:00
Ludovic Courtès a31174e896
gexp: 'compiled-modules' loads modules before compiling them.
This works around <https://bugs.gnu.org/15602> in the context of
modules specified with 'with-imported-modules'.

* guix/gexp.scm (gexp->derivation): Add #:pre-load-modules? parameter
and pass it to 'compiled-modules'.
(compiled-modules): Add #:pre-load-modules? parameter and honor it.
* guix/packages.scm (patch-and-repack): Pass #:pre-load-modules? to
'gexp->derivation'.
2019-04-04 17:47:02 +02:00
Ludovic Courtès 5a6e04c53c
self: Ship all the (gnu bootloader …) modules.
* guix/self.scm (compiled-guix)[*system-modules*]: Explicitly add all of
gnu/bootloader/*.
2019-04-03 18:21:43 +02:00
Ludovic Courtès 1ccc0f807d
environment: '-C' creates namespaces where the user is not root.
* guix/scripts/environment.scm (launch-environment/container): Add UID
and GID.  Use them in PASSWD and GROUPS.  Pass them as #:guest-uid and
 #:guest-gid to 'call-with-container'.
* tests/guix-environment-container.sh: Test the inner UID.
In '--user' test, replace hard-coded 0 with 1000.
* doc/guix.texi (Invoking guix environment): Adjust accordingly.
2019-04-02 18:15:37 +02:00
Ludovic Courtès 154f1f0937
packages: Remove 'maintainers' field.
This field was never used and doesn't match the way we collectively
maintain packages.

* guix/packages.scm (<package>)[maintainers]: Remove.
2019-03-30 15:19:32 +01:00
Ludovic Courtès a7646bc5e1
packages: Remove 'self-native-input?' field.
This field has become unnecessary with the addition of 'this-package'.

* guix/packages.scm (<package>)[self-native-input?]: Remove.
(package->bag): Adjust accordingly.
* doc/guix.texi (package Reference): Remove 'self-native-input?'.
2019-03-30 15:19:32 +01:00
Ludovic Courtès adb6462c4c
packages: Define 'this-package' and 'this-origin'.
* guix/packages.scm (<origin>): Choose 'this-origin' as the 'this'
identifier.
(<package>): Choose 'this-package'.
* gnu/packages/gnucash.scm (gnucash)[arguments]: Use 'this-package'
instead of 'this-record'.
* gnu/packages/version-control.scm (git)[arguments]: Likewise.
2019-03-30 11:08:39 +01:00
Ludovic Courtès d2be7e3c4b
records: Support custom 'this' identifiers.
This lets record users choose an identifier other than 'this-record'.

* guix/records.scm (make-syntactic-constructor): Add #:this-identifier.
[wrap-field-value]: Honor it.
(define-record-type*): Add form with extra THIS-IDENTIFIER and honor
it.
* tests/records.scm ("define-record-type* & thunked & inherit & custom this"):
New test.
2019-03-30 11:08:39 +01:00
Ludovic Courtès 539af7f257
pull: Truncate the list of packages displayed on completion.
Previously, if you'd run 'guix pull' after a couple of weeks, it would
fill your screen with package names, which is unhelpful.

* guix/scripts/pull.scm (ellipsis): New procedure.
(display-new/upgraded-packages): Add #:concise?.
[list->enumeration]: New procedure.
Use it instead of 'string-join'.
(display-profile-news): Pass #:concise? #t.
2019-03-28 23:06:59 +01:00
Ludovic Courtès 9f4169f6c8
pull: Factorize pretty-printing for new/upgraded package lists.
* guix/scripts/pull.scm (display-new/upgraded-packages)[pretty]: New
procedure.
Use it.
2019-03-28 23:06:58 +01:00
Ludovic Courtès 42314ffa07
refresh: Update the source code URL.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>
in <https://bugs.gnu.org/35010>.

* guix/upstream.scm (update-package-source): Take 'source' instead of
'version' as the second argument.
[update-expression]: Change to take 'replacements', a list of
replacement pairs.
Compute OLD-URL and NEW-URL and replace the dirname of the OLD-URL with
that of NEW-URL.
* guix/scripts/refresh.scm (update-package): Adjust call to
'update-package-source' accordingly.
2019-03-27 14:59:42 +01:00
Ludovic Courtès 1ee3d2dcb8
upstream: 'package-update' returns the <upstream-source> object.
Fixes a regression introduced in
abd4d6b33d, where CHANGES would no longer
be a thunk.

Reported by Ricardo Wurmus.

* guix/upstream.scm (package-update/url-fetch): Return SOURCE as the
third value instead of CHANGES.
* guix/scripts/refresh.scm (update-package): Adjust accordingly.
2019-03-27 14:59:41 +01:00
Ludovic Courtès 9e5f2060ad
scripts: Skip 'guix pull' suggestion when running code from a checkout.
* guix/scripts.scm (warn-about-old-distro): Do not warn when
GUIX_UNINSTALLED is set.
2019-03-27 11:54:06 +01:00
Ludovic Courtès 952afb6f8c
environment: Create /etc/group in containers.
Reported by Pierre Neidhardt <mail@ambrevar.xyz>.

* guix/scripts/environment.scm (launch-environment/container): Create
GROUPS and call 'write-group'.
* tests/guix-environment-container.sh: Test it.
2019-03-26 18:11:52 +01:00
Ludovic Courtès 8a9922bdee
environment: Use (gnu build accounts) for /etc/passwd handling.
* guix/scripts/environment.scm (launch-environment/container): Remove
call to 'mock-passwd'; instantiate a <password-entry> instead.  Call
'write-passwd' to write the pasword database instead of using custom
code.
(mock-passwd): Remove.
* tests/guix-environment-container.sh: Test 'getpwuid'.
2019-03-26 18:11:52 +01:00
Ludovic Courtès e6301fb76d
packages: Adjust to new calling convention for "thunked" fields.
Fixes <https://bugs.gnu.org/34995>.

This is a followup to abd4d6b33d.

* guix/packages.scm (package->bag): Adjust calls to INPUTS,
PROPAGATED-INPUTS, NATIVE-INPUTS, and ARGS, passing them SELF as an
argument.
* gnu/packages/gnucash.scm (gnucash)[arguments]: Use (package-inputs
this-record) intead of (inputs).
* gnu/packages/version-control.scm (git)[arguments]: Likewise.
2019-03-26 10:26:02 +01:00
Ludovic Courtès abd4d6b33d
records: Allow thunked fields to refer to 'this-record'.
* guix/records.scm (this-record): New syntax parameter.
(make-syntactic-constructor)[wrap-field-value]: When F is thunked,
return a one-argument lambda instead of a thunk, and parameterize
THIS-RECORD.
(define-record-type*)[thunked-field-accessor-definition]: Pass X
to (real-get X).
* tests/records.scm ("define-record-type* & thunked & this-record")
("define-record-type* & thunked & default & this-record")
("define-record-type* & thunked & inherit & this-record"): New tests.
2019-03-25 23:37:06 +01:00
Ludovic Courtès 94aeec0aef
ui: Bypass Texinfo parsing and rendering for searches.
This makes search queries such as:

  LANGUAGE=fr guix package -s utilitaire -s recherche

about 6 times faster.

* guix/ui.scm (%package-metrics): Do not use 'package-synopsis-string'
and 'package-description-string' to bypass Texinfo parsing and
rendering.
2019-03-24 00:13:53 +01:00
Julien Lepiller 78b3748c1c
guix: dune-build-system: Add a package parameter.
* guix/build-system/dune.scm: Add a package parameter.
* guix/build/dune.scm (build, test, install): Use it.
* doc/guix.texi: Document it.
2019-03-23 22:58:52 +01:00
Efraim Flashner 4e4c311465
build: Add rakudo-build-system.
* guix/build-system/rakudo.scm,
guix/build/rakudo-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build System): Document it.
2019-03-23 22:26:48 +02:00
Julien Lepiller a506a4c380
import: opam: Also update dune packages.
* guix/import/opam.scm (opam-package?): Also accept packages that use the
dune build system.
2019-03-23 18:37:29 +01:00
Ludovic Courtès a53ecfc897
graph: Factorize calls to 'fold-packages'.
* guix/scripts/graph.scm (all-packages): New procedure.
(%reverse-package-node-type, %reverse-bag-node-type): Use 'all-packages'
instead of 'fold-packages'.
2019-03-23 18:15:36 +01:00
Ludovic Courtès 2b81eac01e
graph: Add the 'reverse-bag' graph.
Suggested by Julien Lepiller.

* guix/scripts/graph.scm (%reverse-bag-node-type): New variable.
(%node-types): Add it.
* tests/graph.scm ("reverse bag DAG"): New test.
* doc/guix.texi (Invoking guix graph): Document it.
2019-03-23 18:15:36 +01:00
Marius Bakke ad4910eec0
build-system/meson: Add #:allowed-references and #:disallowed-references.
* guix/build-system/meson.scm (meson-build): Add support for
  #:allowed-references and #:disallowed-references.
2019-03-21 19:23:47 +01:00
Ludovic Courtès 6c5e618ca0
pack: Create an empty /home directory for '-f squashfs'.
Fixes <https://bugs.gnu.org/34914>.

* guix/scripts/pack.scm (squashfs-image)[build]: Pass "-p /home d 555 0 0".
2019-03-19 11:30:34 +01:00
Ludovic Courtès 427c87d0bd
pack: Produce relative symlinks when using '-f squashfs'.
Fixes <https://bugs.gnu.org/34913>.

* guix/scripts/pack.scm (squashfs-image)[build]: Use
'relative-file-name' when creating SYMLINKS.
* guix/scripts/pack.scm (guix-pack): Pass #:relative-symlinks? #t when
PACK-FORMAT is 'squashfs.
2019-03-19 11:30:34 +01:00
Arun Isaac ae031d453c
import: Add Launchpad updater.
* guix/import/launchpad.scm: New file.
* Makefile.am (MODULES): Register it.
* doc/guix.texi (Invoking guix refresh): Mention the Launchpad updater.
2019-03-18 20:55:55 +05:30
ng0 47956fa0c2
Correct name and email address for ng0.
* .mailmap, Makefile.am, doc/guix.de.texi, doc/guix.fr.texi,
doc/guix.texi, etc/completion/fish/guix.fish,
gnu/packages/accessibility.scm, gnu/packages/admin.scm,
gnu/packages/audio.scm, gnu/packages/autotools.scm,
gnu/packages/cdrom.scm, gnu/packages/check.scm,
gnu/packages/cinnamon.scm, gnu/packages/compression.scm,
gnu/packages/crypto.scm, gnu/packages/databases.scm,
gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/elixir.scm,
gnu/packages/emacs-xyz.scm, gnu/packages/emacs.scm,
gnu/packages/enlightenment.scm, gnu/packages/erlang.scm,
gnu/packages/fonts.scm, gnu/packages/fontutils.scm,
gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm,
gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm,
gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/gtk.scm,
gnu/packages/guile-wm.scm,gnu/packages/guile-xyz.scm,
gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm,
gnu/packages/haskell.scm, gnu/packages/image-viewers.scm,
gnu/packages/image.scm, gnu/packages/irc.scm,
gnu/packages/language.scm, gnu/packages/libcanberra.scm,
gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm,
gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm,
gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm,
gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm,
gnu/packages/ncurses.scm, gnu/packages/networking.scm,
gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm,
gnu/packages/perl-check.scm, gnu/packages/perl.scm,
gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm,
gnu/packages/python-web.scm, gnu/packages/python-xyz.scm,
gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm,
gnu/packages/rust.scm, gnu/packages/scheme.scm,
gnu/packages/serialization.scm, gnu/packages/shells.scm,
gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm,
gnu/packages/telephony.scm, gnu/packages/text-editors.scm,
gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm,
gnu/packages/tor.scm, gnu/packages/version-control.scm,
gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm,
gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm,
gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm,
gnu/services/desktop.scm, gnu/services/version-control.scm,
gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm:
Correct name and email address for ng0.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2019-03-18 15:05:08 +01:00
Ludovic Courtès b6fd086a61
describe: Warn about 'GUIX_PACKAGE_PATH' in json and recutils format.
Fixes <https://bugs.gnu.org/34884>.
Reported by Pierre Neidhardt <mail@ambrevar.xyz>.

* guix/scripts/describe.scm (display-package-search-path): Add catch-all
case for FMT.
2019-03-18 10:51:05 +01:00
Ludovic Courtès d831b19079
guix build: '--with-branch' strips slashes from the version string.
This fixes things like:

  guix build glibc \
    --with-git-url=glibc=git://sourceware.org/git/glibc.git \
    --with-branch=glibc=release/2.25/master

whereby slashes would before go straight to the 'version' field, leading
to an invalid store file name.

* guix/scripts/build.scm (transform-package-source-branch)[replace]:
Replace slashes with hyphens in BRANCH when building the version
string.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 845c44012c
guix build: '--with-commit' makes recursive checkouts.
This was an omission from commit
024a6bfba9.

* guix/scripts/build.scm (transform-package-source-commit): Add
'recursive?' field to SOURCE.
* tests/scripts-build.scm ("options->transformation, with-branch")
("options->transformation, with-commit"): New tests.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 14328b81a2
guix build: Transformation options match packages by spec.
This allows us to combine several transformations on a given package, in
particular '--with-git-url' and '--with-branch'.

Previously transformations would ignore each other since they would all
take (specification->package SOURCE) as their replacement source,
compare it by identity, which doesn't work if a previous transformation
has already changed SOURCE.

* guix/scripts/build.scm (evaluate-replacement-specs): Adjust to produce
an alist as expected by 'package-input-rewriting/spec', with a package
spec as the first element of each pair.
(evaluate-git-replacement-specs): Likewise.
(transform-package-inputs):  Adjust accordingly and use
'package-input-rewriting/spec'.
(transform-package-inputs/graft): Likewise.
(transform-package-source-branch, transform-package-source-commit): Use
'package-input-rewriting/spec'.
(transform-package-source-git-url): Likewise, and adjust the
REPLACEMENTS alist accordingly.
(options->transformation): Iterate over OPTS instead of over
%TRANSFORMATIONS.  Invoke transformations one by one.
* tests/scripts-build.scm ("options->transformation, with-input"):
Adjust test to compare packages by name rather than by identity.
("options->transformation, with-git-url + with-branch"): New test.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 0c0ff42a24
guix build: Factorize 'package-git-url'.
* guix/scripts/build.scm (package-git-url): New procedure.
(evaluate-git-replacement-specs): Use it.
2019-03-17 22:55:01 +01:00
Ludovic Courtès f258d88628
packages: Add 'package-input-rewriting/spec'.
* guix/packages.scm (package-input-rewriting/spec): New procedure.
* tests/packages.scm ("package-input-rewriting/spec")
("package-input-rewriting/spec, partial match"): New tests.
* doc/guix.texi (Defining Packages): Document it.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 880916ac52
guix build: Add '--with-git-url'.
* guix/scripts/build.scm (%not-equal): New variable.
(evaluate-git-replacement-specs): Use it instead of local variable
'not-equal'.
(transform-package-source-git-url): New procedure.
(%transformations): Add 'with-git-url'.
(%transformation-options, show-transformation-options-help): Add
'--with-git-url'.
* tests/scripts-build.scm ("options->transformation, with-git-url"):
New test.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 55da450a1f
scripts: 'warn-about-old-distro' looks at the age of the running Guix.
This fixes a discrepancy that could be seen when running:

  sudo guix system …

where 'guix' would warn about the age of root's Guix, even though the
running Guix is the user's, not root's.

* guix/scripts.scm (warn-about-old-distro)[false-if-not-found]: Remove.
Obtain the profile date by calling 'current-profile-date' instead of
stat'ing "current-guix".
2019-03-17 22:55:01 +01:00
Ludovic Courtès cd2e4b2a8d
describe: Add 'current-profile-date'.
* guix/describe.scm (current-profile-date): New procedure.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 8ffab257dd
guix system: Fix success report of the bootloader installation.
Fixes <https://bugs.gnu.org/34890>.
Reported by Jack Hill <jackhill@jackhill.us>.

Regression introduced in 21fcfe1ee9.

* guix/scripts/system.scm (bootloader-installer-script): Ungexp DEVICE.
2019-03-17 16:30:00 +01:00
Tobias Geerinckx-Rice b56d160944
guix: Match package names case-insensitively.
* guix/scripts/package.scm (options->upgrade-predicate, process-query):
Use REGEXP/ICASE when matching package names.
2019-03-16 23:32:41 +01:00
Ludovic Courtès 21fcfe1ee9
bootloader: Use 'invoke/quiet' when running 'grub-install' and co.
This hides potentially confusing GRUB messages from the user, such as
"Installing for i386-pc platform."

* gnu/bootloader/extlinux.scm (install-extlinux): Use 'invoke/quiet'
instead of 'system*' and 'error'.
* gnu/bootloader/grub.scm (install-grub, install-grub-efi): Likewise.
* guix/scripts/system.scm (bootloader-installer-script): Guard against
'message-condition?' and handle them properly.
2019-03-16 18:15:13 +01:00
Ludovic Courtès 22f95e028f
tests: Add 'with-environment-variable'.
* tests/scripts.scm (with-environment-variable): Move to...
* guix/tests.scm (with-environment-variable): ... here.
* tests/build-utils.scm ("wrap-program, one input, multiple calls"):
Use it instead of 'setenv'.
2019-03-16 18:15:09 +01:00
P.C. Shyamshankar 41dfe40f5d
pack: Construct inferior package names correctly.
* guix/scripts/pack.scm (wrapped-package): now correctly constructs full
names of inferior packages.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2019-03-15 23:27:59 +01:00
Ludovic Courtès 99aec37a78
pack: "-RR" produces PRoot-enabled relocatable binaries.
* gnu/packages/aux-files/run-in-namespace.c (exec_with_proot): New
function.
(main): When 'clone' fails, call 'rm_rf'.
[PROOT_PROGRAM]: When 'clone' fails, call 'exec_with_proot'.
* guix/scripts/pack.scm (wrapped-package): Add #:proot?.
[proot]: New procedure.
[build]: Compile with -DPROOT_PROGRAM when PROOT? is true.
* guix/scripts/pack.scm (%options): Set the 'relocatable?' value to
'proot when "-R" is passed several times.
(guix-pack): Pass #:proot? to 'wrapped-package'.
* tests/guix-pack-relocatable.sh: Use "-RR" on Intel systems that lack
user namespace support.
* doc/guix.texi (Invoking guix pack): Document -RR.
2019-03-15 23:27:59 +01:00