mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-07-30 14:11:31 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c18c53117f |
+1
-8
@@ -24,7 +24,6 @@
|
||||
(eval . (put 'guard 'scheme-indent-function 1))
|
||||
(eval . (put 'lambda* 'scheme-indent-function 1))
|
||||
(eval . (put 'substitute* 'scheme-indent-function 1))
|
||||
(eval . (put 'match-record 'scheme-indent-function 2))
|
||||
|
||||
;; 'modify-phases' and its keywords.
|
||||
(eval . (put 'modify-phases 'scheme-indent-function 1))
|
||||
@@ -45,7 +44,6 @@
|
||||
(eval . (put 'manifest-pattern 'scheme-indent-function 0))
|
||||
(eval . (put 'substitute-keyword-arguments 'scheme-indent-function 1))
|
||||
(eval . (put 'with-store 'scheme-indent-function 1))
|
||||
(eval . (put 'with-external-store 'scheme-indent-function 1))
|
||||
(eval . (put 'with-error-handling 'scheme-indent-function 0))
|
||||
(eval . (put 'with-mutex 'scheme-indent-function 1))
|
||||
(eval . (put 'with-atomic-file-output 'scheme-indent-function 1))
|
||||
@@ -60,7 +58,6 @@
|
||||
(eval . (put 'emacs-substitute-variables 'scheme-indent-function 1))
|
||||
(eval . (put 'with-derivation-narinfo 'scheme-indent-function 1))
|
||||
(eval . (put 'with-derivation-substitute 'scheme-indent-function 2))
|
||||
(eval . (put 'with-status-report 'scheme-indent-function 1))
|
||||
|
||||
(eval . (put 'mlambda 'scheme-indent-function 1))
|
||||
(eval . (put 'mlambdaq 'scheme-indent-function 1))
|
||||
@@ -75,16 +72,12 @@
|
||||
(eval . (put 'run-with-state 'scheme-indent-function 1))
|
||||
(eval . (put 'wrap-program 'scheme-indent-function 1))
|
||||
(eval . (put 'with-imported-modules 'scheme-indent-function 1))
|
||||
(eval . (put 'with-extensions 'scheme-indent-function 1))
|
||||
|
||||
(eval . (put 'with-database 'scheme-indent-function 2))
|
||||
|
||||
(eval . (put 'call-with-container 'scheme-indent-function 1))
|
||||
(eval . (put 'container-excursion 'scheme-indent-function 1))
|
||||
(eval . (put 'eventually 'scheme-indent-function 1))
|
||||
|
||||
(eval . (put 'call-with-progress-reporter 'scheme-indent-function 1))
|
||||
|
||||
;; Recognize '~', '+', and '$', as used for gexps, as quotation symbols.
|
||||
;; This notably allows '(' in Paredit to not insert a space when the
|
||||
;; preceding symbol is one of these.
|
||||
(eval . (modify-syntax-entry ?~ "'"))
|
||||
|
||||
+2
-20
@@ -28,21 +28,6 @@
|
||||
/configure
|
||||
/doc/*.1
|
||||
/doc/.dirstamp
|
||||
/doc/guix.*.aux
|
||||
/doc/guix.*.cp
|
||||
/doc/guix.*.cps
|
||||
/doc/guix.*.fn
|
||||
/doc/guix.*.fns
|
||||
/doc/guix.*.html
|
||||
/doc/guix.*.info
|
||||
/doc/guix.*.info-[0-9]
|
||||
/doc/guix.*.ky
|
||||
/doc/guix.*.pg
|
||||
/doc/guix.*.toc
|
||||
/doc/guix.*.t2p
|
||||
/doc/guix.*.tp
|
||||
/doc/guix.*.vr
|
||||
/doc/guix.*.vrs
|
||||
/doc/guix.aux
|
||||
/doc/guix.cp
|
||||
/doc/guix.cps
|
||||
@@ -62,13 +47,12 @@
|
||||
/doc/os-config-desktop.texi
|
||||
/doc/stamp-vti
|
||||
/doc/version.texi
|
||||
/doc/version-*.texi
|
||||
/etc/guix-daemon.cil
|
||||
/etc/guix-daemon.conf
|
||||
/etc/guix-daemon.service
|
||||
/etc/guix-publish.conf
|
||||
/etc/guix-publish.service
|
||||
/guix-daemon
|
||||
/guix-register
|
||||
/guix/config.scm
|
||||
/libformat.a
|
||||
/libstore.a
|
||||
@@ -90,11 +74,10 @@
|
||||
/nix/config.h.in
|
||||
/nix/nix-daemon/nix-daemon.cc
|
||||
/nix/nix-setuid-helper/nix-setuid-helper.cc
|
||||
/nix/scripts/authenticate
|
||||
/nix/scripts/guix-authenticate
|
||||
/nix/scripts/list-runtime-roots
|
||||
/nix/scripts/offload
|
||||
/nix/scripts/substitute
|
||||
/po/doc/*.mo
|
||||
/po/guix/*.gmo
|
||||
/po/guix/*.insert-header
|
||||
/po/guix/*.mo
|
||||
@@ -146,4 +129,3 @@ tmp
|
||||
/nix/scripts/download
|
||||
/etc/indent-code.el
|
||||
/.version
|
||||
/doc/stamp-[0-9]
|
||||
|
||||
@@ -33,7 +33,7 @@ Joshua Grant <tadni@riseup.net> <gzg@riseup.net>
|
||||
Joshua Grant <tadni@riseup.net> <jgrant@parenthetical.io>
|
||||
Joshua Grant <tadni@riseup.net> <tadnimi@gmail.com>
|
||||
Joshua Grant <tadni@riseup.net> <youlysses@riseup.net>
|
||||
Kei Kebreau <kei@openmailbox.org> <kkebreau@posteo.net>
|
||||
Kei Kebreau <kei@openmailbox.org>
|
||||
Leo Famulari <leo@famulari.name> <lfamular@gmail.com>
|
||||
Ludovic Courtès <ludo@gnu.org> <ludovic.courtes@inria.fr>
|
||||
Marek Benc <dusxmt@gmx.com> <merkur32@gmail.com>
|
||||
@@ -42,22 +42,15 @@ Mathieu Lirzin <mthl@gnu.org> <mthl@openmailbox.org>
|
||||
Mathieu Lirzin <mthl@gnu.org> <mathieu.lirzin@openmailbox.org>
|
||||
Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
Nikita Karetnikov <nikita@karetnikov.org> <nikita.karetnikov@gmail.com>
|
||||
Nils Gillmann <ng0@n0.is> ng0 <ng0@n0.is>
|
||||
Nils Gillmann <ng0@n0.is> Nils Gillmann <gillmann@infotropique.org>
|
||||
Nils Gillmann <ng0@n0.is> ng0 <ng0@crash.cx>
|
||||
Nils Gillmann <ng0@n0.is> ng0 <ng0@crash.cx>
|
||||
Nils Gillmann <ng0@n0.is> <ng0@infotropique.org>
|
||||
Nils Gillmann <ng0@n0.is> <ng0@no-reply.infotropique.org>
|
||||
Nils Gillmann <ng0@n0.is> <ng0@no-reply.pragmatique.xyz>
|
||||
Nils Gillmann <ng0@n0.is> <ng0@pragmatique.xyz>
|
||||
Nils Gillmann <ng0@n0.is> <contact.ng0@cryptolab.net>
|
||||
Nils Gillmann <ng0@n0.is> <ng0@we.make.ritual.n0.is>
|
||||
Nils Gillmann <ng0@n0.is> <ngillmann@runbox.com>
|
||||
Nils Gillmann <ng0@n0.is> <niasterisk@grrlz.net>
|
||||
Nils Gillmann <ng0@n0.is> <ng@niasterisk.space>
|
||||
Nils Gillmann <ng0@n0.is> <ng0@libertad.pw>
|
||||
Pierre Neidhardt <mail@ambrevar.xyz>
|
||||
Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
|
||||
ng0 <ng0@no-reply.infotropique.org>
|
||||
ng0 <ng0@no-reply.infotropique.org> <ng0@no-reply.pragmatique.xyz>
|
||||
ng0 <ng0@no-reply.infotropique.org> <ng0@pragmatique.xyz>
|
||||
ng0 <ng0@no-reply.infotropique.org> <contact.ng0@cryptolab.net>
|
||||
ng0 <ng0@no-reply.infotropique.org> <ng0@we.make.ritual.n0.is>
|
||||
ng0 <ng0@no-reply.infotropique.org> <ngillmann@runbox.com>
|
||||
ng0 <ng0@no-reply.infotropique.org> <niasterisk@grrlz.net>
|
||||
ng0 <ng0@no-reply.infotropique.org> <ng@niasterisk.space>
|
||||
ng0 <ng0@no-reply.infotropique.org> <ng0@libertad.pw>
|
||||
Pjotr Prins <pjotr.guix@thebird.nl> <pjotr.public01@thebird.nl>
|
||||
Pjotr Prins <pjotr.guix@thebird.nl> <pjotr.public12@thebird.nl>
|
||||
Pjotr Prins <pjotr.guix@thebird.nl> <pjotr.public12@email>
|
||||
@@ -71,7 +64,6 @@ Sou Bunnbu (宋文武) <iyzsong@gmail.com>
|
||||
Sou Bunnbu (宋文武) <iyzsong@gmail.com> <iyzsong@member.fsf.org>
|
||||
Stefan Reichör <stefan@xsteve.at>
|
||||
Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
|
||||
Theodoros Foradis <theodoros.for@openmailbox.org> <theodoros@foradis.org>
|
||||
Thomas Danckaert <thomas.danckaert@gmail.com> <post@thomasdanckaert.be>
|
||||
Tobias Geerinckx-Rice <me@tobias.gr> <tobias.geerinckx.rice@gmail.com>
|
||||
Tomáš Čech <sleep_walker@gnu.org> <sleep_walker@suse.cz>
|
||||
|
||||
+37
-64
@@ -1,78 +1,51 @@
|
||||
Contributor Covenant Code of Conduct
|
||||
Contributor Code of Conduct
|
||||
|
||||
Note: In the sequel, "project" refers to GNU Guix, and "project
|
||||
maintainer(s)" refers to maintainer(s) of GNU Guix.
|
||||
|
||||
Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
education, socio-economic status, nationality, personal appearance, race,
|
||||
religion, or sexual identity and orientation.
|
||||
|
||||
Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
As contributors and maintainers of this project, and in the interest of
|
||||
fostering an open and welcoming community, we pledge to respect all
|
||||
people who contribute through reporting issues, posting feature
|
||||
requests, updating documentation, submitting pull requests or patches,
|
||||
and other activities.
|
||||
|
||||
We are committed to making participation in this project a
|
||||
harassment-free experience for everyone, regardless of level of
|
||||
experience, gender, gender identity and expression, sexual orientation,
|
||||
disability, personal appearance, body size, race, ethnicity, age,
|
||||
religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing others’ private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
* Publishing other's private information, such as physical or electronic
|
||||
addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit,
|
||||
or reject comments, commits, code, wiki edits, issues, and other
|
||||
contributions that are not aligned to this Code of Conduct, or to ban
|
||||
temporarily or permanently any contributor for other behaviors that they
|
||||
deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Our Responsibilities
|
||||
By adopting this Code of Conduct, project maintainers commit themselves
|
||||
to fairly and consistently applying these principles to every aspect of
|
||||
managing this project. Project maintainers who do not follow or enforce
|
||||
the Code of Conduct may be permanently removed from the project team.
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
This Code of Conduct applies both within project spaces and in public
|
||||
spaces when an individual is representing the project or its community.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may
|
||||
be reported by contacting a project maintainer at guix-maintainers@gnu.org.
|
||||
All complaints will be reviewed and investigated and will
|
||||
result in a response that is deemed necessary and appropriate to the
|
||||
circumstances. Maintainers are obligated to maintain confidentiality
|
||||
with regard to the reporter of an incident.
|
||||
|
||||
Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at guix-maintainers@gnu.org. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project’s leadership.
|
||||
|
||||
Attribution
|
||||
|
||||
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
This Code of Conduct is adapted from the Contributor Covenant
|
||||
(http://contributor-covenant.org), version 1.3.0, available at
|
||||
http://contributor-covenant.org/version/1/3/0/
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
Copyright © 2012, 2013, 2014, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
Copyright © 2015, 2017 Mathieu Lirzin <mthl@gnu.org>
|
||||
Copyright © 2017 Leo Famulari <leo@famulari.name>
|
||||
Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
@@ -27,7 +26,7 @@ mailing list. When you get commit access, please make sure to follow the
|
||||
policy below (discussions of the policy can take place on guix-devel@gnu.org.)
|
||||
|
||||
Non-trivial patches should always be posted to guix-patches@gnu.org (trivial
|
||||
patches include fixing typos, etc.). This mailing list fills the
|
||||
patches include fixing typos, etc.) This mailing list fills the
|
||||
patch-tracking database at [[https://bugs.gnu.org/guix-patches]]; see
|
||||
"Contributing" in the manual for details.
|
||||
|
||||
@@ -62,12 +61,3 @@ after two weeks, and if you’re confident, it’s OK to commit.
|
||||
|
||||
That last part is subject to being adjusted, allowing individuals to commit
|
||||
directly on non-controversial changes on parts they’re familiar with.
|
||||
|
||||
* Using emacs-debbugs
|
||||
|
||||
Bug reports and patches are tracked using debbugs. If you are on emacs, you
|
||||
can use emacs-debbugs.
|
||||
|
||||
List all open bug reports on guix-patches with
|
||||
|
||||
C-u M-x debbugs-gnu <RET> <RET> guix-patches <RET> n y
|
||||
|
||||
+89
-182
@@ -1,18 +1,12 @@
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2013 Andreas Enge <andreas@enge.fr>
|
||||
# Copyright © 2015, 2017 Alex Kost <alezost@gmail.com>
|
||||
# Copyright © 2016, 2018 Mathieu Lirzin <mthl@gnu.org>
|
||||
# Copyright © 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
|
||||
# Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
|
||||
# Copyright © 2016, 2017 Mark H Weaver <mhw@netris.org>
|
||||
# Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
# Copyright © 2017 Leo Famulari <leo@famulari.name>
|
||||
# Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
|
||||
# Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
# Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
|
||||
# Copyright © 2018 Nils Gillmann <ng0@n0.is>
|
||||
# Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
|
||||
# Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
|
||||
# Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
|
||||
#
|
||||
# This file is part of GNU Guix.
|
||||
#
|
||||
@@ -29,22 +23,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
MSGMERGE_UPDATE = @MSGMERGE@ --update
|
||||
|
||||
bin_SCRIPTS = scripts/guix
|
||||
|
||||
# Handle substitution of fully-expanded Autoconf variables.
|
||||
do_subst = $(SED) \
|
||||
-e 's,[@]GUILE[@],$(GUILE),g' \
|
||||
-e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
|
||||
-e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
|
||||
-e 's,[@]localedir[@],$(localedir),g'
|
||||
|
||||
scripts/guix: scripts/guix.in Makefile
|
||||
$(AM_V_at)rm -f $@ $@-t
|
||||
$(AM_V_at)$(MKDIR_P) "$(@D)"
|
||||
$(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
|
||||
$(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
|
||||
bin_SCRIPTS = \
|
||||
scripts/guix
|
||||
|
||||
nodist_noinst_SCRIPTS = \
|
||||
pre-inst-env \
|
||||
@@ -52,22 +32,20 @@ nodist_noinst_SCRIPTS = \
|
||||
|
||||
# Modules that are not compiled but are installed nonetheless, such as
|
||||
# build-side modules with unusual dependencies.
|
||||
MODULES_NOT_COMPILED = \
|
||||
guix/man-db.scm
|
||||
MODULES_NOT_COMPILED =
|
||||
|
||||
include gnu/local.mk
|
||||
include po/doc/local.mk
|
||||
|
||||
MODULES = \
|
||||
guix/base16.scm \
|
||||
guix/base32.scm \
|
||||
guix/base64.scm \
|
||||
guix/ci.scm \
|
||||
guix/cpio.scm \
|
||||
guix/docker.scm \
|
||||
guix/records.scm \
|
||||
guix/gcrypt.scm \
|
||||
guix/hash.scm \
|
||||
guix/pk-crypto.scm \
|
||||
guix/pki.scm \
|
||||
guix/progress.scm \
|
||||
guix/combinators.scm \
|
||||
guix/memoization.scm \
|
||||
guix/utils.scm \
|
||||
@@ -77,7 +55,6 @@ MODULES = \
|
||||
guix/discovery.scm \
|
||||
guix/git-download.scm \
|
||||
guix/hg-download.scm \
|
||||
guix/swh.scm \
|
||||
guix/monads.scm \
|
||||
guix/monad-repl.scm \
|
||||
guix/gexp.scm \
|
||||
@@ -86,36 +63,24 @@ MODULES = \
|
||||
guix/nar.scm \
|
||||
guix/derivations.scm \
|
||||
guix/grafts.scm \
|
||||
guix/inferior.scm \
|
||||
guix/describe.scm \
|
||||
guix/channels.scm \
|
||||
guix/gnu-maintenance.scm \
|
||||
guix/self.scm \
|
||||
guix/upstream.scm \
|
||||
guix/licenses.scm \
|
||||
guix/glob.scm \
|
||||
guix/git.scm \
|
||||
guix/graph.scm \
|
||||
guix/cache.scm \
|
||||
guix/cve.scm \
|
||||
guix/workers.scm \
|
||||
guix/zlib.scm \
|
||||
guix/build-system.scm \
|
||||
guix/build-system/android-ndk.scm \
|
||||
guix/build-system/ant.scm \
|
||||
guix/build-system/cargo.scm \
|
||||
guix/build-system/clojure.scm \
|
||||
guix/build-system/cmake.scm \
|
||||
guix/build-system/dub.scm \
|
||||
guix/build-system/emacs.scm \
|
||||
guix/build-system/font.scm \
|
||||
guix/build-system/go.scm \
|
||||
guix/build-system/meson.scm \
|
||||
guix/build-system/minify.scm \
|
||||
guix/build-system/asdf.scm \
|
||||
guix/build-system/glib-or-gtk.scm \
|
||||
guix/build-system/gnu.scm \
|
||||
guix/build-system/guile.scm \
|
||||
guix/build-system/haskell.scm \
|
||||
guix/build-system/perl.scm \
|
||||
guix/build-system/python.scm \
|
||||
@@ -123,45 +88,34 @@ MODULES = \
|
||||
guix/build-system/waf.scm \
|
||||
guix/build-system/r.scm \
|
||||
guix/build-system/ruby.scm \
|
||||
guix/build-system/scons.scm \
|
||||
guix/build-system/texlive.scm \
|
||||
guix/build-system/trivial.scm \
|
||||
guix/ftp-client.scm \
|
||||
guix/http-client.scm \
|
||||
guix/gnupg.scm \
|
||||
guix/elf.scm \
|
||||
guix/profiling.scm \
|
||||
guix/store.scm \
|
||||
guix/cvs-download.scm \
|
||||
guix/svn-download.scm \
|
||||
guix/i18n.scm \
|
||||
guix/ui.scm \
|
||||
guix/status.scm \
|
||||
guix/build/android-ndk-build-system.scm \
|
||||
guix/build/ant-build-system.scm \
|
||||
guix/build/download.scm \
|
||||
guix/build/download-nar.scm \
|
||||
guix/build/cargo-build-system.scm \
|
||||
guix/build/cmake-build-system.scm \
|
||||
guix/build/dub-build-system.scm \
|
||||
guix/build/emacs-build-system.scm \
|
||||
guix/build/meson-build-system.scm \
|
||||
guix/build/minify-build-system.scm \
|
||||
guix/build/font-build-system.scm \
|
||||
guix/build/go-build-system.scm \
|
||||
guix/build/asdf-build-system.scm \
|
||||
guix/build/git.scm \
|
||||
guix/build/hg.scm \
|
||||
guix/build/glib-or-gtk-build-system.scm \
|
||||
guix/build/gnu-build-system.scm \
|
||||
guix/build/gnu-dist.scm \
|
||||
guix/build/guile-build-system.scm \
|
||||
guix/build/perl-build-system.scm \
|
||||
guix/build/python-build-system.scm \
|
||||
guix/build/ocaml-build-system.scm \
|
||||
guix/build/r-build-system.scm \
|
||||
guix/build/ruby-build-system.scm \
|
||||
guix/build/scons-build-system.scm \
|
||||
guix/build/texlive-build-system.scm \
|
||||
guix/build/waf-build-system.scm \
|
||||
guix/build/haskell-build-system.scm \
|
||||
@@ -169,16 +123,12 @@ MODULES = \
|
||||
guix/build/utils.scm \
|
||||
guix/build/union.scm \
|
||||
guix/build/profiles.scm \
|
||||
guix/build/compile.scm \
|
||||
guix/build/pull.scm \
|
||||
guix/build/rpath.scm \
|
||||
guix/build/cvs.scm \
|
||||
guix/build/svn.scm \
|
||||
guix/build/syscalls.scm \
|
||||
guix/build/gremlin.scm \
|
||||
guix/build/debug-link.scm \
|
||||
guix/build/clojure-build-system.scm \
|
||||
guix/build/clojure-utils.scm \
|
||||
guix/build/emacs-utils.scm \
|
||||
guix/build/java-utils.scm \
|
||||
guix/build/lisp-utils.scm \
|
||||
@@ -188,24 +138,14 @@ MODULES = \
|
||||
guix/build/make-bootstrap.scm \
|
||||
guix/search-paths.scm \
|
||||
guix/packages.scm \
|
||||
guix/import/cabal.scm \
|
||||
guix/import/cpan.scm \
|
||||
guix/import/cran.scm \
|
||||
guix/import/crate.scm \
|
||||
guix/import/elpa.scm \
|
||||
guix/import/gem.scm \
|
||||
guix/import/github.scm \
|
||||
guix/import/gnome.scm \
|
||||
guix/import/gnu.scm \
|
||||
guix/import/hackage.scm \
|
||||
guix/import/json.scm \
|
||||
guix/import/opam.scm \
|
||||
guix/import/print.scm \
|
||||
guix/import/pypi.scm \
|
||||
guix/import/snix.scm \
|
||||
guix/import/stackage.scm \
|
||||
guix/import/texlive.scm \
|
||||
guix/import/utils.scm \
|
||||
guix/import/gnu.scm \
|
||||
guix/import/snix.scm \
|
||||
guix/import/cabal.scm \
|
||||
guix/import/cran.scm \
|
||||
guix/import/hackage.scm \
|
||||
guix/import/elpa.scm \
|
||||
guix/import/texlive.scm \
|
||||
guix/scripts.scm \
|
||||
guix/scripts/download.scm \
|
||||
guix/scripts/perform-download.scm \
|
||||
@@ -217,39 +157,46 @@ MODULES = \
|
||||
guix/scripts/hash.scm \
|
||||
guix/scripts/pack.scm \
|
||||
guix/scripts/pull.scm \
|
||||
guix/scripts/processes.scm \
|
||||
guix/scripts/substitute.scm \
|
||||
guix/scripts/authenticate.scm \
|
||||
guix/scripts/refresh.scm \
|
||||
guix/scripts/repl.scm \
|
||||
guix/scripts/describe.scm \
|
||||
guix/scripts/system.scm \
|
||||
guix/scripts/system/search.scm \
|
||||
guix/scripts/lint.scm \
|
||||
guix/scripts/challenge.scm \
|
||||
guix/scripts/import/crate.scm \
|
||||
guix/scripts/import/cran.scm \
|
||||
guix/scripts/import/elpa.scm \
|
||||
guix/scripts/import/gem.scm \
|
||||
guix/scripts/import/gnu.scm \
|
||||
guix/scripts/import/hackage.scm \
|
||||
guix/scripts/import/json.scm \
|
||||
guix/scripts/import/nix.scm \
|
||||
guix/scripts/import/opam.scm \
|
||||
guix/scripts/import/pypi.scm \
|
||||
guix/scripts/import/stackage.scm \
|
||||
guix/scripts/import/hackage.scm \
|
||||
guix/scripts/import/elpa.scm \
|
||||
guix/scripts/import/texlive.scm \
|
||||
guix/scripts/environment.scm \
|
||||
guix/scripts/publish.scm \
|
||||
guix/scripts/edit.scm \
|
||||
guix/scripts/size.scm \
|
||||
guix/scripts/graph.scm \
|
||||
guix/scripts/weather.scm \
|
||||
guix/scripts/container.scm \
|
||||
guix/scripts/container/exec.scm \
|
||||
guix.scm \
|
||||
$(GNU_SYSTEM_MODULES)
|
||||
|
||||
if HAVE_GUILE_JSON
|
||||
|
||||
MODULES += \
|
||||
guix/docker.scm \
|
||||
guix/import/cpan.scm \
|
||||
guix/import/crate.scm \
|
||||
guix/import/gem.scm \
|
||||
guix/import/github.scm \
|
||||
guix/import/json.scm \
|
||||
guix/import/pypi.scm \
|
||||
guix/import/stackage.scm \
|
||||
guix/scripts/import/crate.scm \
|
||||
guix/scripts/import/gem.scm \
|
||||
guix/scripts/import/pypi.scm \
|
||||
guix/scripts/import/stackage.scm
|
||||
|
||||
endif
|
||||
|
||||
if HAVE_GUILE_SSH
|
||||
|
||||
MODULES += \
|
||||
@@ -259,6 +206,13 @@ MODULES += \
|
||||
|
||||
endif HAVE_GUILE_SSH
|
||||
|
||||
if HAVE_GUILE_GIT
|
||||
|
||||
MODULES += \
|
||||
guix/git.scm
|
||||
|
||||
endif HAVE_GUILE_GIT
|
||||
|
||||
if BUILD_DAEMON_OFFLOAD
|
||||
|
||||
MODULES += \
|
||||
@@ -266,36 +220,24 @@ MODULES += \
|
||||
|
||||
endif BUILD_DAEMON_OFFLOAD
|
||||
|
||||
# Scheme implementation of the build daemon and related functionality.
|
||||
STORE_MODULES = \
|
||||
guix/store/database.scm \
|
||||
guix/store/deduplication.scm
|
||||
|
||||
MODULES += $(STORE_MODULES)
|
||||
|
||||
# Internal modules with test suite support.
|
||||
dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
|
||||
|
||||
# Auxiliary files for packages.
|
||||
AUX_FILES = \
|
||||
gnu/packages/aux-files/emacs/guix-emacs.el \
|
||||
gnu/packages/aux-files/linux-libre/4.19-arm.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.19-i686.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.14-arm.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.14-i686.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.12-i686.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.12-x86_64.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.9-i686.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.4-i686.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
|
||||
gnu/packages/aux-files/run-in-namespace.c
|
||||
gnu/packages/aux-files/linux-libre/4.1-i686.conf \
|
||||
gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
|
||||
|
||||
# Templates, examples.
|
||||
EXAMPLES = \
|
||||
gnu/system/examples/bare-bones.tmpl \
|
||||
gnu/system/examples/beaglebone-black.tmpl \
|
||||
gnu/system/examples/desktop.tmpl \
|
||||
gnu/system/examples/lightweight-desktop.tmpl \
|
||||
gnu/system/examples/vm-image.tmpl
|
||||
@@ -303,7 +245,6 @@ EXAMPLES = \
|
||||
GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
|
||||
|
||||
nobase_dist_guilemodule_DATA = \
|
||||
guix/store/schema.sql \
|
||||
$(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
|
||||
$(MISC_DISTRO_FILES)
|
||||
nobase_nodist_guilemodule_DATA = guix/config.scm
|
||||
@@ -329,24 +270,19 @@ SCM_TESTS = \
|
||||
tests/base16.scm \
|
||||
tests/base32.scm \
|
||||
tests/base64.scm \
|
||||
tests/cpan.scm \
|
||||
tests/cpio.scm \
|
||||
tests/crate.scm \
|
||||
tests/gem.scm \
|
||||
tests/hash.scm \
|
||||
tests/pk-crypto.scm \
|
||||
tests/pki.scm \
|
||||
tests/print.scm \
|
||||
tests/sets.scm \
|
||||
tests/modules.scm \
|
||||
tests/gnu-maintenance.scm \
|
||||
tests/substitute.scm \
|
||||
tests/builders.scm \
|
||||
tests/derivations.scm \
|
||||
tests/glob.scm \
|
||||
tests/grafts.scm \
|
||||
tests/ui.scm \
|
||||
tests/status.scm \
|
||||
tests/records.scm \
|
||||
tests/processes.scm \
|
||||
tests/upstream.scm \
|
||||
tests/combinators.scm \
|
||||
tests/discovery.scm \
|
||||
@@ -366,9 +302,7 @@ SCM_TESTS = \
|
||||
tests/profiles.scm \
|
||||
tests/search-paths.scm \
|
||||
tests/syscalls.scm \
|
||||
tests/inferior.scm \
|
||||
tests/gremlin.scm \
|
||||
tests/debug-link.scm \
|
||||
tests/bournish.scm \
|
||||
tests/lint.scm \
|
||||
tests/publish.scm \
|
||||
@@ -381,27 +315,28 @@ SCM_TESTS = \
|
||||
tests/workers.scm \
|
||||
tests/zlib.scm \
|
||||
tests/file-systems.scm \
|
||||
tests/uuid.scm \
|
||||
tests/system.scm \
|
||||
tests/services.scm \
|
||||
tests/scripts-build.scm \
|
||||
tests/containers.scm \
|
||||
tests/opam.scm \
|
||||
tests/pack.scm \
|
||||
tests/import-utils.scm
|
||||
|
||||
if HAVE_GUILE_JSON
|
||||
|
||||
SCM_TESTS += \
|
||||
tests/pypi.scm \
|
||||
tests/import-utils.scm \
|
||||
tests/store-database.scm \
|
||||
tests/store-deduplication.scm
|
||||
tests/cpan.scm \
|
||||
tests/gem.scm \
|
||||
tests/crate.scm
|
||||
|
||||
endif
|
||||
|
||||
SH_TESTS = \
|
||||
tests/guix-build.sh \
|
||||
tests/guix-build-branch.sh \
|
||||
tests/guix-download.sh \
|
||||
tests/guix-gc.sh \
|
||||
tests/guix-hash.sh \
|
||||
tests/guix-pack.sh \
|
||||
tests/guix-pack-localstatedir.sh \
|
||||
tests/guix-pack-relocatable.sh \
|
||||
tests/guix-package.sh \
|
||||
tests/guix-package-net.sh \
|
||||
tests/guix-system.sh \
|
||||
@@ -410,9 +345,15 @@ SH_TESTS = \
|
||||
tests/guix-environment.sh \
|
||||
tests/guix-environment-container.sh \
|
||||
tests/guix-graph.sh \
|
||||
tests/guix-describe.sh \
|
||||
tests/guix-lint.sh
|
||||
|
||||
if BUILD_DAEMON
|
||||
|
||||
SH_TESTS += tests/guix-register.sh
|
||||
|
||||
endif BUILD_DAEMON
|
||||
|
||||
|
||||
TESTS = $(SCM_TESTS) $(SH_TESTS)
|
||||
|
||||
AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
|
||||
@@ -450,7 +391,7 @@ check-local:
|
||||
|
||||
endif !CAN_RUN_TESTS
|
||||
|
||||
check-system: $(GOBJECTS)
|
||||
check-system: $(GOBJECTS) $(BOOTSTRAP_GUILE_TARBALLS)
|
||||
$(AM_V_at)$(top_builddir)/pre-inst-env \
|
||||
$(GUILE) --no-auto-compile \
|
||||
-e '(@@ (run-system-tests) run-system-tests)' \
|
||||
@@ -458,43 +399,29 @@ check-system: $(GOBJECTS)
|
||||
|
||||
# Public key used to sign substitutes from hydra.gnu.org & co.
|
||||
dist_pkgdata_DATA = \
|
||||
etc/substitutes/hydra.gnu.org.pub \
|
||||
etc/substitutes/berlin.guixsd.org.pub \
|
||||
etc/substitutes/ci.guix.info.pub
|
||||
hydra.gnu.org.pub \
|
||||
bayfront.guixsd.org.pub
|
||||
|
||||
# Bash completion file.
|
||||
dist_bashcompletion_DATA = etc/completion/bash/guix \
|
||||
etc/completion/bash/guix-daemon
|
||||
dist_bashcompletion_DATA = etc/completion/bash/guix
|
||||
|
||||
# Zsh completion file.
|
||||
dist_zshcompletion_DATA = etc/completion/zsh/_guix
|
||||
|
||||
# Fish completion file.
|
||||
dist_fishcompletion_DATA = etc/completion/fish/guix.fish
|
||||
|
||||
# SELinux policy
|
||||
dist_selinux_policy_DATA = etc/guix-daemon.cil
|
||||
|
||||
EXTRA_DIST += \
|
||||
EXTRA_DIST = \
|
||||
HACKING \
|
||||
ROADMAP \
|
||||
TODO \
|
||||
CODE-OF-CONDUCT \
|
||||
.dir-locals.el \
|
||||
scripts/guix.in \
|
||||
etc/guix-install.sh \
|
||||
build-aux/build-self.scm \
|
||||
build-aux/compile-all.scm \
|
||||
build-aux/hydra/evaluate.scm \
|
||||
build-aux/hydra/gnu-system.scm \
|
||||
build-aux/hydra/guix.scm \
|
||||
build-aux/hydra/guix-modular.scm \
|
||||
build-aux/cuirass/gnu-system.scm \
|
||||
build-aux/cuirass/guix-modular.scm \
|
||||
build-aux/cuirass/hydra-to-cuirass.scm \
|
||||
build-aux/check-available-binaries.scm \
|
||||
build-aux/check-final-inputs-self-contained.scm \
|
||||
build-aux/compile-as-derivation.scm \
|
||||
build-aux/download.scm \
|
||||
build-aux/generate-authors.scm \
|
||||
build-aux/test-driver.scm \
|
||||
build-aux/update-guix-package.scm \
|
||||
@@ -502,6 +429,8 @@ EXTRA_DIST += \
|
||||
build-aux/run-system-tests.scm \
|
||||
d3.v3.js \
|
||||
graph.js \
|
||||
srfi/srfi-64.scm \
|
||||
srfi/srfi-64.upstream.scm \
|
||||
tests/test.drv \
|
||||
tests/signing-key.pub \
|
||||
tests/signing-key.sec \
|
||||
@@ -520,7 +449,6 @@ endif !BUILD_DAEMON_OFFLOAD
|
||||
|
||||
|
||||
CLEANFILES = \
|
||||
$(bin_SCRIPTS) \
|
||||
$(GOBJECTS) \
|
||||
$(SCM_TESTS:tests/%.scm=%.log)
|
||||
|
||||
@@ -558,13 +486,6 @@ $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
|
||||
install-data-hook: set-bootstrap-executable-permissions
|
||||
touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
|
||||
|
||||
# Assuming Guix is already installed and the daemon is up and running, this
|
||||
# rule builds from $(srcdir), creating and building derivations.
|
||||
as-derivation:
|
||||
$(AM_V_at)echo "Building Guix in Guix..." ; \
|
||||
$(GUILE) --no-auto-compile \
|
||||
"$(top_srcdir)/build-aux/compile-as-derivation.scm" \
|
||||
"$(abs_top_srcdir)"
|
||||
|
||||
SUBDIRS = po/guix po/packages
|
||||
BUILT_SOURCES =
|
||||
@@ -592,17 +513,18 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--enable-daemon \
|
||||
ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
|
||||
|
||||
# The self-contained tarball.
|
||||
# The self-contained tarball. Add 'glibc-utf8-locales' along with glibc just
|
||||
# so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
|
||||
guix-binary.%.tar.xz:
|
||||
$(AM_V_GEN)GUIX_PACKAGE_PATH= \
|
||||
tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz \
|
||||
-s "$*" --localstatedir --profile-name=current-guix guix` ; \
|
||||
-s "$*" --localstatedir guix glibc-utf8-locales \
|
||||
-e '(@@ (gnu packages commencement) glibc-final)'` ; \
|
||||
cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
|
||||
|
||||
|
||||
dist-hook: $(distdir)/ChangeLog gen-AUTHORS gen-tarball-version
|
||||
dist-hook: assert-no-store-file-names
|
||||
dist-hook: doc-po-update
|
||||
|
||||
distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
|
||||
|
||||
@@ -645,7 +567,7 @@ 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
|
||||
SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux
|
||||
|
||||
# Guix binary tarballs.
|
||||
BINARY_TARBALLS = \
|
||||
@@ -658,11 +580,14 @@ GUIXSD_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
|
||||
GUIXSD_VM_SYSTEMS ?= x86_64-linux
|
||||
|
||||
# Prefix of the GuixSD installation image file name.
|
||||
GUIXSD_IMAGE_BASE = guixsd-install-$(PACKAGE_VERSION)
|
||||
GUIXSD_IMAGE_BASE = guixsd-usb-install-$(PACKAGE_VERSION)
|
||||
|
||||
# Prefix of the GuixSD VM image file name.
|
||||
GUIXSD_VM_IMAGE_BASE = guixsd-vm-image-$(PACKAGE_VERSION)
|
||||
|
||||
# Size of the VM image (for x86_64 typically).
|
||||
GUIXSD_VM_IMAGE_SIZE ?= 2GiB
|
||||
|
||||
# The release process works in several phases:
|
||||
#
|
||||
# 0. We assume the developer created a 'vX.Y' tag.
|
||||
@@ -706,21 +631,21 @@ release: dist
|
||||
for system in $(GUIXSD_SUPPORTED_SYSTEMS) ; do \
|
||||
image=`$(top_builddir)/pre-inst-env \
|
||||
guix system disk-image \
|
||||
--file-system-type=iso9660 \
|
||||
--system=$$system \
|
||||
gnu/system/install.scm` ; \
|
||||
if [ ! -f "$$image" ] ; then \
|
||||
echo "failed to produced GuixSD installation image for $$system" >&2 ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
xz < "$$image" > "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.iso.xz.tmp" ; \
|
||||
mv "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.iso.xz.tmp" \
|
||||
"$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.iso.xz" ; \
|
||||
xz < "$$image" > "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" ; \
|
||||
mv "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" \
|
||||
"$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz" ; \
|
||||
done
|
||||
for system in $(GUIXSD_VM_SYSTEMS) ; do \
|
||||
image=`$(top_builddir)/pre-inst-env \
|
||||
guix system vm-image \
|
||||
--system=$$system \
|
||||
--image-size=$(GUIXSD_VM_IMAGE_SIZE) \
|
||||
gnu/system/examples/vm-image.tmpl` ; \
|
||||
if [ ! -f "$$image" ] ; then \
|
||||
echo "failed to produced GuixSD VM image for $$system" >&2 ; \
|
||||
@@ -754,7 +679,6 @@ assert-no-store-file-names: $(distdir)/ChangeLog
|
||||
$(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-prettify.el \
|
||||
--exclude=ChangeLog \
|
||||
-E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
|
||||
@@ -763,7 +687,7 @@ assert-no-store-file-names: $(distdir)/ChangeLog
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
# Make sure important substitutes are available.
|
||||
# Make sure hydra.gnu.org has the important binaries.
|
||||
assert-binaries-available: $(GOBJECTS)
|
||||
$(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
|
||||
"$(top_srcdir)/build-aux/check-available-binaries.scm"
|
||||
@@ -781,19 +705,10 @@ hydra-jobs.scm: $(GOBJECTS)
|
||||
"$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
|
||||
$(AM_V_at)mv "$@.tmp" "$@"
|
||||
|
||||
# Compute the Cuirass jobs and write them in the target file.
|
||||
cuirass-jobs.scm: $(GOBJECTS)
|
||||
$(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
|
||||
$(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
|
||||
"$(top_srcdir)/build-aux/hydra/evaluate.scm" \
|
||||
"$(top_srcdir)/build-aux/cuirass/gnu-system.scm" \
|
||||
cuirass > "$@.tmp"
|
||||
$(AM_V_at)mv "$@.tmp" "$@"
|
||||
|
||||
.PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
|
||||
.PHONY: assert-no-store-file-names assert-binaries-available
|
||||
.PHONY: assert-final-inputs-self-contained
|
||||
.PHONY: clean-go make-go as-derivation
|
||||
.PHONY: clean-go make-go
|
||||
.PHONY: update-guix-package update-NEWS release
|
||||
|
||||
## -------------- ##
|
||||
@@ -811,11 +726,3 @@ 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" $@;
|
||||
|
||||
@@ -1,44 +1,42 @@
|
||||
-*- mode: org -*-
|
||||
|
||||
[[https://www.gnu.org/software/guix/][GNU Guix]] (IPA: /ɡiːks/) is a purely functional package manager, and
|
||||
associated free software distribution, for the [[https://www.gnu.org/gnu/gnu.html][GNU system]]. In addition
|
||||
[[http://www.gnu.org/software/guix/][GNU Guix]] (IPA: /ɡiːks/) is a purely functional package manager, and
|
||||
associated free software distribution, for the [[http://www.gnu.org/gnu/gnu.html][GNU system]]. In addition
|
||||
to standard package management features, Guix supports transactional
|
||||
upgrades and roll-backs, unprivileged package management, per-user
|
||||
profiles, and garbage collection.
|
||||
|
||||
It provides [[https://www.gnu.org/software/guile/][Guile]] Scheme APIs, including a high-level embedded
|
||||
It provides [[http://www.gnu.org/software/guile/][Guile]] Scheme APIs, including a high-level embedded
|
||||
domain-specific languages (EDSLs) to describe how packages are to be
|
||||
built and composed.
|
||||
|
||||
A user-land free software distribution for GNU/Linux comes as part of
|
||||
Guix.
|
||||
|
||||
Guix is based on the [[https://nixos.org/nix/][Nix]] package manager.
|
||||
Guix is based on the [[http://nixos.org/nix/][Nix]] package manager.
|
||||
|
||||
|
||||
* Requirements
|
||||
|
||||
GNU Guix currently depends on the following packages:
|
||||
|
||||
- [[https://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.13 or later
|
||||
- [[https://notabug.org/cwebber/guile-gcrypt][Guile-Gcrypt]] 0.1.0 or later
|
||||
- [[https://www.gnu.org/software/make/][GNU Make]]
|
||||
- [[https://www.gnutls.org][GnuTLS]] compiled with guile support enabled
|
||||
- [[https://notabug.org/guile-sqlite3/guile-sqlite3][Guile-SQLite3]], version 0.1.0 or later
|
||||
- [[https://gitlab.com/guile-git/guile-git][Guile-Git]]
|
||||
- [[http://www.zlib.net/][zlib]]
|
||||
- [[https://savannah.nongnu.org/projects/guile-json/][Guile-JSON]]
|
||||
- [[http://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.9 or later
|
||||
- [[http://gnupg.org/][GNU libgcrypt]]
|
||||
- [[http://www.gnu.org/software/make/][GNU Make]]
|
||||
- optionally [[http://savannah.nongnu.org/projects/guile-json/][Guile-JSON]], for the 'guix import pypi' command
|
||||
- optionally [[http://www.gnutls.org][GnuTLS]] compiled with guile support enabled, for HTTPS support
|
||||
in the 'guix download' command. Note that 'guix import pypi' requires
|
||||
this functionality.
|
||||
|
||||
Unless `--disable-daemon' was passed, the following packages are needed:
|
||||
|
||||
- [[https://gnupg.org/][GNU libgcrypt]]
|
||||
- [[https://sqlite.org/][SQLite 3]]
|
||||
- [[https://gcc.gnu.org][GCC's g++]]
|
||||
- optionally [[http://www.bzip.org][libbz2]]
|
||||
- [[http://sqlite.org/][SQLite 3]]
|
||||
- [[http://www.bzip.org][libbz2]]
|
||||
- [[http://gcc.gnu.org][GCC's g++]]
|
||||
|
||||
When `--disable-daemon' was passed, you instead need the following:
|
||||
|
||||
- [[https://nixos.org/nix/][Nix]]
|
||||
- [[http://nixos.org/nix/][Nix]]
|
||||
|
||||
* Installation
|
||||
|
||||
@@ -46,7 +44,7 @@ See the manual for the installation instructions, either by running
|
||||
|
||||
info -f doc/guix.info "Installation"
|
||||
|
||||
or by checking the [[https://www.gnu.org/software/guix/manual/guix.html#Installation][web copy of the manual]].
|
||||
or by checking the [[http://www.gnu.org/software/guix/manual/guix.html#Installation][web copy of the manual]].
|
||||
|
||||
For information on installation from a Git checkout, please see the section
|
||||
"Building from Git" in the manual.
|
||||
@@ -111,7 +109,7 @@ Join #guix on irc.freenode.net.
|
||||
|
||||
* Guix & Nix
|
||||
|
||||
GNU Guix is based on [[https://nixos.org/nix/][the Nix package manager]]. It implements the same
|
||||
GNU Guix is based on [[http://nixos.org/nix/][the Nix package manager]]. It implements the same
|
||||
package deployment paradigm, and in fact it reuses some of its code.
|
||||
Yet, different engineering decisions were made for Guix, as described
|
||||
below.
|
||||
@@ -134,7 +132,7 @@ the store. Guix produces such derivations, which are then interpreted
|
||||
by the daemon to perform the build. Thus, Guix derivations can use
|
||||
derivations produced by Nix (and vice versa).
|
||||
|
||||
With Nix and the [[https://nixos.org/nixpkgs][Nixpkgs]] distribution, package composition happens at
|
||||
With Nix and the [[http://nixos.org/nixpkgs][Nixpkgs]] distribution, package composition happens at
|
||||
the Nix language level, but builders are usually written in Bash.
|
||||
Conversely, Guix encourages the use of Scheme for both package
|
||||
composition and builders. Likewise, the core functionality of Nix is
|
||||
@@ -143,13 +141,13 @@ but exposes all the API as Scheme.
|
||||
|
||||
* Related software
|
||||
|
||||
- [[https://nixos.org][Nix, Nixpkgs, and NixOS]], functional package manager and associated
|
||||
- [[http://nixos.org][Nix, Nixpkgs, and NixOS]], functional package manager and associated
|
||||
software distribution, are the inspiration of Guix
|
||||
- [[https://www.gnu.org/software/stow/][GNU Stow]] builds around the idea of one directory per prefix, and a
|
||||
- [[http://www.gnu.org/software/stow/][GNU Stow]] builds around the idea of one directory per prefix, and a
|
||||
symlink tree to create user environments
|
||||
- [[https://www.pvv.ntnu.no/~arnej/store/storedoc_6.html][STORE]] shares the same idea
|
||||
- [[http://www.pvv.ntnu.no/~arnej/store/storedoc_6.html][STORE]] shares the same idea
|
||||
- [[https://live.gnome.org/OSTree/][GNOME's OSTree]] allows bootable system images to be built from a
|
||||
specified set of packages
|
||||
- The [[https://www.gnu.org/s/gsrc/][GNU Source Release Collection]] (GSRC) is a user-land software
|
||||
- The [[http://www.gnu.org/s/gsrc/][GNU Source Release Collection]] (GSRC) is a user-land software
|
||||
distribution; unlike Guix, it relies on core tools available on the
|
||||
host system
|
||||
|
||||
+171
-368
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -19,17 +19,10 @@
|
||||
(define-module (build-self)
|
||||
#:use-module (gnu)
|
||||
#:use-module (guix)
|
||||
#:use-module (guix ui)
|
||||
#:use-module (guix config)
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-19)
|
||||
#:use-module (srfi srfi-34)
|
||||
#:use-module (srfi srfi-35)
|
||||
#:use-module (rnrs io ports)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 popen)
|
||||
#:export (build))
|
||||
|
||||
;;; Commentary:
|
||||
@@ -47,395 +40,205 @@
|
||||
;;; Code:
|
||||
|
||||
|
||||
;;;
|
||||
;;; Generating (guix config).
|
||||
;;;
|
||||
;;; This is copied from (guix self) because we cannot assume (guix self) is
|
||||
;;; available at this point.
|
||||
;;;
|
||||
;; The dependencies. Don't refer explicitly to the variables because they
|
||||
;; could be renamed or shuffled around in modules over time. Conversely,
|
||||
;; 'find-best-packages-by-name' is expected to always have the same semantics.
|
||||
|
||||
(define %dependency-variables
|
||||
;; (guix config) variables corresponding to dependencies.
|
||||
'(%libgcrypt %libz %xz %gzip %bzip2))
|
||||
(define libgcrypt
|
||||
(first (find-best-packages-by-name "libgcrypt" #f)))
|
||||
|
||||
(define %persona-variables
|
||||
;; (guix config) variables that define Guix's persona.
|
||||
'(%guix-package-name
|
||||
%guix-version
|
||||
%guix-bug-report-address
|
||||
%guix-home-page-url))
|
||||
(define zlib
|
||||
(first (find-best-packages-by-name "zlib" #f)))
|
||||
|
||||
(define %config-variables
|
||||
;; (guix config) variables corresponding to Guix configuration.
|
||||
(letrec-syntax ((variables (syntax-rules ()
|
||||
((_)
|
||||
'())
|
||||
((_ variable rest ...)
|
||||
(cons `(variable . ,variable)
|
||||
(variables rest ...))))))
|
||||
(variables %localstatedir %storedir %sysconfdir %system)))
|
||||
(define gzip
|
||||
(first (find-best-packages-by-name "gzip" #f)))
|
||||
|
||||
(define* (make-config.scm #:key zlib gzip xz bzip2
|
||||
(package-name "GNU Guix")
|
||||
(package-version "0")
|
||||
(bug-report-address "bug-guix@gnu.org")
|
||||
(home-page-url "https://gnu.org/s/guix"))
|
||||
(define bzip2
|
||||
(first (find-best-packages-by-name "bzip2" #f)))
|
||||
|
||||
;; Hack so that Geiser is not confused.
|
||||
(define defmod 'define-module)
|
||||
(define xz
|
||||
(first (find-best-packages-by-name "xz" #f)))
|
||||
|
||||
(scheme-file "config.scm"
|
||||
#~(begin
|
||||
(#$defmod (guix config)
|
||||
#:export (%guix-package-name
|
||||
%guix-version
|
||||
%guix-bug-report-address
|
||||
%guix-home-page-url
|
||||
%store-directory
|
||||
%state-directory
|
||||
%store-database-directory
|
||||
%config-directory
|
||||
%libz
|
||||
%gzip
|
||||
%bzip2
|
||||
%xz))
|
||||
(define (false-if-wrong-guile package)
|
||||
"Return #f if PACKAGE depends on the \"wrong\" major version of Guile (e.g.,
|
||||
2.0 instead of 2.2), otherwise return PACKAGE."
|
||||
(let ((guile (any (match-lambda
|
||||
((label (? package? dep) _ ...)
|
||||
(and (string=? (package-name dep) "guile")
|
||||
dep)))
|
||||
(package-direct-inputs package))))
|
||||
(and (or (not guile)
|
||||
(string-prefix? (effective-version)
|
||||
(package-version guile)))
|
||||
package)))
|
||||
|
||||
;; XXX: Work around <http://bugs.gnu.org/15602>.
|
||||
(eval-when (expand load eval)
|
||||
#$@(map (match-lambda
|
||||
((name . value)
|
||||
#~(define-public #$name #$value)))
|
||||
%config-variables)
|
||||
(define (package-for-current-guile . names)
|
||||
"Return the package with one of the given NAMES that depends on the current
|
||||
Guile major version (2.0 or 2.2), or #f if none of the packages matches."
|
||||
(let loop ((names names))
|
||||
(match names
|
||||
(()
|
||||
#f)
|
||||
((name rest ...)
|
||||
(match (find-best-packages-by-name name #f)
|
||||
(()
|
||||
(loop rest))
|
||||
((first _ ...)
|
||||
(or (false-if-wrong-guile first)
|
||||
(loop rest))))))))
|
||||
|
||||
(define %store-directory
|
||||
(or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)
|
||||
%storedir))
|
||||
(define guile-json
|
||||
(package-for-current-guile "guile-json"
|
||||
"guile2.2-json"
|
||||
"guile2.0-json"))
|
||||
|
||||
(define %state-directory
|
||||
;; This must match `NIX_STATE_DIR' as defined in
|
||||
;; `nix/local.mk'.
|
||||
(or (getenv "NIX_STATE_DIR")
|
||||
(string-append %localstatedir "/guix")))
|
||||
(define guile-ssh
|
||||
(package-for-current-guile "guile-ssh"
|
||||
"guile2.2-ssh"
|
||||
"guile2.0-ssh"))
|
||||
|
||||
(define %store-database-directory
|
||||
(or (getenv "NIX_DB_DIR")
|
||||
(string-append %state-directory "/db")))
|
||||
|
||||
(define %config-directory
|
||||
;; This must match `GUIX_CONFIGURATION_DIRECTORY' as
|
||||
;; defined in `nix/local.mk'.
|
||||
(or (getenv "GUIX_CONFIGURATION_DIRECTORY")
|
||||
(string-append %sysconfdir "/guix")))
|
||||
|
||||
(define %guix-package-name #$package-name)
|
||||
(define %guix-version #$package-version)
|
||||
(define %guix-bug-report-address #$bug-report-address)
|
||||
(define %guix-home-page-url #$home-page-url)
|
||||
|
||||
(define %gzip
|
||||
#+(and gzip (file-append gzip "/bin/gzip")))
|
||||
(define %bzip2
|
||||
#+(and bzip2 (file-append bzip2 "/bin/bzip2")))
|
||||
(define %xz
|
||||
#+(and xz (file-append xz "/bin/xz")))
|
||||
|
||||
(define %libz
|
||||
#+(and zlib
|
||||
(file-append zlib "/lib/libz")))))))
|
||||
(define guile-git
|
||||
(package-for-current-guile "guile-git"
|
||||
"guile2.0-git"))
|
||||
|
||||
(define guile-bytestructures
|
||||
(package-for-current-guile "guile-bytestructures"
|
||||
"guile2.0-bytestructures"))
|
||||
|
||||
;;;
|
||||
;;; 'gexp->script'.
|
||||
;;;
|
||||
;;; This is our own variant of 'gexp->script' with an extra #:module-path
|
||||
;;; parameter, which was unavailable in (guix gexp) until commit
|
||||
;;; 1ae16033f34cebe802023922436883867010850f (March 2018.)
|
||||
;;;
|
||||
;; The actual build procedure.
|
||||
|
||||
(define (load-path-expression modules path)
|
||||
"Return as a monadic value a gexp that sets '%load-path' and
|
||||
'%load-compiled-path' to point to MODULES, a list of module names. MODULES
|
||||
are searched for in PATH."
|
||||
(mlet %store-monad ((modules (imported-modules modules
|
||||
#:module-path path))
|
||||
(compiled (compiled-modules modules
|
||||
#:module-path path)))
|
||||
(return (gexp (eval-when (expand load eval)
|
||||
(set! %load-path
|
||||
(cons (ungexp modules) %load-path))
|
||||
(set! %load-compiled-path
|
||||
(cons (ungexp compiled)
|
||||
%load-compiled-path)))))))
|
||||
(define (top-source-directory)
|
||||
"Return the name of the top-level directory of this source tree."
|
||||
(and=> (assoc-ref (current-source-location) 'filename)
|
||||
(lambda (file)
|
||||
(string-append (dirname file) "/.."))))
|
||||
|
||||
(define* (gexp->script name exp
|
||||
#:key (guile (default-guile))
|
||||
(module-path %load-path))
|
||||
"Return an executable script NAME that runs EXP using GUILE, with EXP's
|
||||
imported modules in its search path."
|
||||
(mlet %store-monad ((set-load-path
|
||||
(load-path-expression (gexp-modules exp)
|
||||
module-path)))
|
||||
(gexp->derivation name
|
||||
(gexp
|
||||
(call-with-output-file (ungexp output)
|
||||
(lambda (port)
|
||||
;; Note: that makes a long shebang. When the store
|
||||
;; is /gnu/store, that fits within the 128-byte
|
||||
;; limit imposed by Linux, but that may go beyond
|
||||
;; when running tests.
|
||||
(format port
|
||||
"#!~a/bin/guile --no-auto-compile~%!#~%"
|
||||
(ungexp guile))
|
||||
|
||||
(write '(ungexp set-load-path) port)
|
||||
(write '(ungexp exp) port)
|
||||
(chmod port #o555))))
|
||||
#:module-path module-path)))
|
||||
|
||||
|
||||
(define (date-version-string)
|
||||
"Return the current date and hour in UTC timezone, for use as a poor
|
||||
person's version identifier."
|
||||
;; XXX: Replace with a Git commit id.
|
||||
(date->string (current-date 0) "~Y~m~d.~H"))
|
||||
|
||||
(define guile-gcrypt
|
||||
;; The host Guix may or may not have 'guile-gcrypt', which was introduced in
|
||||
;; August 2018. If it has it, it's at least version 0.1.0, which is good
|
||||
;; enough. If it doesn't, specify our own package because the target Guix
|
||||
;; requires it.
|
||||
(match (find-best-packages-by-name "guile-gcrypt" #f)
|
||||
(()
|
||||
(package
|
||||
(name "guile-gcrypt")
|
||||
(version "0.1.0")
|
||||
(home-page "https://notabug.org/cwebber/guile-gcrypt")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append home-page "/archive/v" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1gir7ifknbmbvjlql5j6wzk7bkb5lnmq80q59ngz43hhpclrk5k3"))
|
||||
(file-name (string-append name "-" version ".tar.gz"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
;; The 'bootstrap' phase appeared in 'core-updates', which was merged
|
||||
;; into 'master' ca. June 2018.
|
||||
'(#:phases (modify-phases %standard-phases
|
||||
(delete 'bootstrap)
|
||||
(add-before 'configure 'bootstrap
|
||||
(lambda _
|
||||
(unless (zero? (system* "autoreconf" "-vfi"))
|
||||
(error "autoreconf failed"))
|
||||
#t)))))
|
||||
(native-inputs
|
||||
`(("pkg-config" ,(specification->package "pkg-config"))
|
||||
("autoconf" ,(specification->package "autoconf"))
|
||||
("automake" ,(specification->package "automake"))
|
||||
("texinfo" ,(specification->package "texinfo"))))
|
||||
(inputs
|
||||
`(("guile" ,(specification->package "guile"))
|
||||
("libgcrypt" ,(specification->package "libgcrypt"))))
|
||||
(synopsis "Cryptography library for Guile using Libgcrypt")
|
||||
(description
|
||||
"Guile-Gcrypt provides a Guile 2.x interface to a subset of the
|
||||
GNU Libgcrypt crytographic library. It provides modules for cryptographic
|
||||
hash functions, message authentication codes (MAC), public-key cryptography,
|
||||
strong randomness, and more. It is implemented using the foreign function
|
||||
interface (FFI) of Guile.")
|
||||
(license #f))) ;license:gpl3+
|
||||
((package . _)
|
||||
package)))
|
||||
|
||||
(define* (build-program source version
|
||||
#:optional (guile-version (effective-version))
|
||||
#:key (pull-version 0))
|
||||
"Return a program that computes the derivation to build Guix from SOURCE."
|
||||
(define select?
|
||||
;; Select every module but (guix config) and non-Guix modules.
|
||||
(match-lambda
|
||||
(('guix 'config) #f)
|
||||
(('guix _ ...) #t)
|
||||
(('gnu _ ...) #t)
|
||||
(_ #f)))
|
||||
|
||||
(define fake-gcrypt-hash
|
||||
;; Fake (gcrypt hash) module; see below.
|
||||
(scheme-file "hash.scm"
|
||||
#~(define-module (gcrypt hash)
|
||||
#:export (sha1 sha256))))
|
||||
|
||||
(define fake-git
|
||||
(scheme-file "git.scm" #~(define-module (git))))
|
||||
|
||||
(with-imported-modules `(((guix config)
|
||||
=> ,(make-config.scm))
|
||||
|
||||
;; To avoid relying on 'with-extensions', which was
|
||||
;; introduced in 0.15.0, provide a fake (gcrypt
|
||||
;; hash) just so that we can build modules, and
|
||||
;; adjust %LOAD-PATH later on.
|
||||
((gcrypt hash) => ,fake-gcrypt-hash)
|
||||
|
||||
;; (guix git-download) depends on (git) but only
|
||||
;; for peripheral functionality. Provide a dummy
|
||||
;; (git) to placate it.
|
||||
((git) => ,fake-git)
|
||||
|
||||
,@(source-module-closure `((guix store)
|
||||
(guix self)
|
||||
(guix derivations)
|
||||
(gnu packages bootstrap))
|
||||
(list source)
|
||||
#:select? select?))
|
||||
(gexp->script "compute-guix-derivation"
|
||||
#~(begin
|
||||
(use-modules (ice-9 match))
|
||||
|
||||
(eval-when (expand load eval)
|
||||
;; Don't augment '%load-path'.
|
||||
(unsetenv "GUIX_PACKAGE_PATH")
|
||||
|
||||
;; (gnu packages …) modules are going to be looked up
|
||||
;; under SOURCE. (guix config) is looked up in FRONT.
|
||||
(match (command-line)
|
||||
((_ source _ ...)
|
||||
(match %load-path
|
||||
((front _ ...)
|
||||
(unless (string=? front source) ;already done?
|
||||
(set! %load-path
|
||||
(list source
|
||||
(string-append #$guile-gcrypt
|
||||
"/share/guile/site/"
|
||||
(effective-version))
|
||||
front)))))))
|
||||
|
||||
;; Only load Guile-Gcrypt, our own modules, or those
|
||||
;; of Guile.
|
||||
(match %load-compiled-path
|
||||
((front _ ... sys1 sys2)
|
||||
(unless (string-prefix? #$guile-gcrypt front)
|
||||
(set! %load-compiled-path
|
||||
(list (string-append #$guile-gcrypt
|
||||
"/lib/guile/"
|
||||
(effective-version)
|
||||
"/site-ccache")
|
||||
front sys1 sys2))))))
|
||||
|
||||
(use-modules (guix store)
|
||||
(guix self)
|
||||
(guix derivations)
|
||||
(srfi srfi-1))
|
||||
|
||||
(define (spin system)
|
||||
(define spin
|
||||
(circular-list "-" "\\" "|" "/" "-" "\\" "|" "/"))
|
||||
|
||||
(format (current-error-port)
|
||||
"Computing Guix derivation for '~a'... "
|
||||
system)
|
||||
(let loop ((spin spin))
|
||||
(display (string-append "\b" (car spin))
|
||||
(current-error-port))
|
||||
(force-output (current-error-port))
|
||||
(sleep 1)
|
||||
(loop (cdr spin))))
|
||||
|
||||
(match (command-line)
|
||||
((_ source system version protocol-version)
|
||||
;; The current input port normally wraps a file
|
||||
;; descriptor connected to the daemon, or it is
|
||||
;; connected to /dev/null. In the former case, reuse
|
||||
;; the connection such that we inherit build options
|
||||
;; such as substitute URLs and so on; in the latter
|
||||
;; case, attempt to open a new connection.
|
||||
(let* ((proto (string->number protocol-version))
|
||||
(store (if (integer? proto)
|
||||
(port->connection (duplicate-port
|
||||
(current-input-port)
|
||||
"w+0")
|
||||
#:version proto)
|
||||
(open-connection))))
|
||||
(call-with-new-thread
|
||||
(lambda ()
|
||||
(spin system)))
|
||||
|
||||
(display
|
||||
(and=>
|
||||
(run-with-store store
|
||||
(guix-derivation source version
|
||||
#$guile-version
|
||||
#:pull-version
|
||||
#$pull-version)
|
||||
#:system system)
|
||||
derivation-file-name))))))
|
||||
#:module-path (list source))))
|
||||
(define (guile-for-build)
|
||||
"Return a derivation for Guile 2.0 or 2.2, whichever matches the currently
|
||||
running Guile."
|
||||
(package->derivation (cond-expand
|
||||
(guile-2.2
|
||||
(canonical-package
|
||||
(specification->package "guile@2.2")))
|
||||
(else
|
||||
(canonical-package
|
||||
(specification->package "guile@2.0"))))))
|
||||
|
||||
;; The procedure below is our return value.
|
||||
(define* (build source
|
||||
#:key verbose? (version (date-version-string)) system
|
||||
(pull-version 0)
|
||||
|
||||
;; For the standalone Guix, default to Guile 2.2. For old
|
||||
;; versions of 'guix pull' (pre-0.15.0), we have to use the
|
||||
;; same Guile as the current one.
|
||||
(guile-version (if (> pull-version 0)
|
||||
"2.2"
|
||||
(effective-version)))
|
||||
|
||||
#:key verbose? (version (date-version-string))
|
||||
#:allow-other-keys
|
||||
#:rest rest)
|
||||
"Return a derivation that unpacks SOURCE into STORE and compiles Scheme
|
||||
files."
|
||||
;; Build the build program and then use it as a trampoline to build from
|
||||
;; SOURCE.
|
||||
(mlet %store-monad ((build (build-program source version guile-version
|
||||
#:pull-version pull-version))
|
||||
(system (if system (return system) (current-system)))
|
||||
(port ((store-lift nix-server-socket)))
|
||||
(major ((store-lift nix-server-major-version)))
|
||||
(minor ((store-lift nix-server-minor-version))))
|
||||
(mbegin %store-monad
|
||||
(show-what-to-build* (list build))
|
||||
(built-derivations (list build))
|
||||
;; The '%xxxdir' variables were added to (guix config) in July 2016 so we
|
||||
;; cannot assume that they are defined. Try to guess their value when
|
||||
;; they're undefined (XXX: we get an incorrect guess when environment
|
||||
;; variables such as 'NIX_STATE_DIR' are defined!).
|
||||
(define storedir
|
||||
(if (defined? '%storedir) %storedir %store-directory))
|
||||
(define localstatedir
|
||||
(if (defined? '%localstatedir) %localstatedir (dirname %state-directory)))
|
||||
(define sysconfdir
|
||||
(if (defined? '%sysconfdir) %sysconfdir (dirname %config-directory)))
|
||||
(define sbindir
|
||||
(if (defined? '%sbindir) %sbindir (dirname %guix-register-program)))
|
||||
|
||||
;; Use the port beneath the current store as the stdin of BUILD. This
|
||||
;; way, we know 'open-pipe*' will not close it on 'exec'. If PORT is
|
||||
;; not a file port (e.g., it's an SSH channel), then the subprocess's
|
||||
;; stdin will actually be /dev/null.
|
||||
(let* ((pipe (with-input-from-port port
|
||||
(lambda ()
|
||||
(setenv "GUILE_WARN_DEPRECATED" "no") ;be quiet and drive
|
||||
(open-pipe* OPEN_READ
|
||||
(derivation->output-path build)
|
||||
source system version
|
||||
(if (file-port? port)
|
||||
(number->string
|
||||
(logior major minor))
|
||||
"none")))))
|
||||
(str (get-string-all pipe))
|
||||
(status (close-pipe pipe)))
|
||||
(match str
|
||||
((? eof-object?)
|
||||
(error "build program failed" (list build status)))
|
||||
((? derivation-path? drv)
|
||||
(mbegin %store-monad
|
||||
(return (newline (current-output-port)))
|
||||
((store-lift add-temp-root) drv)
|
||||
(return (read-derivation-from-file drv))))
|
||||
("#f"
|
||||
;; Unsupported PULL-VERSION.
|
||||
(return #f))
|
||||
((? string? str)
|
||||
(raise (condition
|
||||
(&message
|
||||
(message (format #f "You found a bug: the program '~a'
|
||||
failed to compute the derivation for Guix (version: ~s; system: ~s;
|
||||
host version: ~s; pull-version: ~s).
|
||||
Please report it by email to <~a>.~%"
|
||||
(derivation->output-path build)
|
||||
version system %guix-version pull-version
|
||||
%guix-bug-report-address)))))))))))
|
||||
(define builder
|
||||
#~(begin
|
||||
(use-modules (guix build pull))
|
||||
|
||||
(letrec-syntax ((maybe-load-path
|
||||
(syntax-rules ()
|
||||
((_ item rest ...)
|
||||
(let ((tail (maybe-load-path rest ...)))
|
||||
(if (string? item)
|
||||
(cons (string-append item
|
||||
"/share/guile/site/"
|
||||
#$(effective-version))
|
||||
tail)
|
||||
tail)))
|
||||
((_)
|
||||
'()))))
|
||||
(set! %load-path
|
||||
(append
|
||||
(maybe-load-path #$guile-json #$guile-ssh
|
||||
#$guile-git #$guile-bytestructures)
|
||||
%load-path)))
|
||||
|
||||
(letrec-syntax ((maybe-load-compiled-path
|
||||
(syntax-rules ()
|
||||
((_ item rest ...)
|
||||
(let ((tail (maybe-load-compiled-path rest ...)))
|
||||
(if (string? item)
|
||||
(cons (string-append item
|
||||
"/lib/guile/"
|
||||
#$(effective-version)
|
||||
"/site-ccache")
|
||||
tail)
|
||||
tail)))
|
||||
((_)
|
||||
'()))))
|
||||
(set! %load-compiled-path
|
||||
(append
|
||||
(maybe-load-compiled-path #$guile-json #$guile-ssh
|
||||
#$guile-git #$guile-bytestructures)
|
||||
%load-compiled-path)))
|
||||
|
||||
;; XXX: The 'guile-ssh' package prior to Guix commit 92b7258 was
|
||||
;; broken: libguile-ssh could not be found. Work around that.
|
||||
;; FIXME: We want Guile-SSH 0.10.2 or later anyway.
|
||||
#$(if (string-prefix? "0.9." (package-version guile-ssh))
|
||||
#~(setenv "LTDL_LIBRARY_PATH" (string-append #$guile-ssh "/lib"))
|
||||
#t)
|
||||
|
||||
(build-guix #$output #$source
|
||||
|
||||
#:system #$%system
|
||||
#:storedir #$storedir
|
||||
#:localstatedir #$localstatedir
|
||||
#:sysconfdir #$sysconfdir
|
||||
#:sbindir #$sbindir
|
||||
|
||||
#:package-name #$%guix-package-name
|
||||
#:package-version #$version
|
||||
#:bug-report-address #$%guix-bug-report-address
|
||||
#:home-page-url #$%guix-home-page-url
|
||||
|
||||
#:libgcrypt #$libgcrypt
|
||||
#:zlib #$zlib
|
||||
#:gzip #$gzip
|
||||
#:bzip2 #$bzip2
|
||||
#:xz #$xz
|
||||
|
||||
;; XXX: This is not perfect, enabling VERBOSE? means
|
||||
;; building a different derivation.
|
||||
#:debug-port (if #$verbose?
|
||||
(current-error-port)
|
||||
(%make-void-port "w")))))
|
||||
|
||||
(mlet %store-monad ((guile (guile-for-build)))
|
||||
(gexp->derivation "guix-latest" builder
|
||||
#:modules '((guix build pull)
|
||||
(guix build utils)
|
||||
|
||||
;; Closure of (guix modules).
|
||||
(guix modules)
|
||||
(guix memoization)
|
||||
(guix sets))
|
||||
|
||||
;; Arrange so that our own (guix build …) modules are
|
||||
;; used.
|
||||
#:module-path (list (top-source-directory))
|
||||
|
||||
#:guile-for-build guile)))
|
||||
|
||||
;; This file is loaded by 'guix pull'; return it the build procedure.
|
||||
build
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -17,7 +17,7 @@
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;;
|
||||
;;; Check whether important binaries are available.
|
||||
;;; Check whether important binaries are available at hydra.gnu.org.
|
||||
;;;
|
||||
|
||||
(use-modules (guix store)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -17,7 +17,7 @@
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;;
|
||||
;;; Check whether important binaries are available.
|
||||
;;; Check whether important binaries are available at hydra.gnu.org.
|
||||
;;;
|
||||
|
||||
(use-modules (guix store)
|
||||
@@ -33,23 +33,23 @@
|
||||
(define (final-inputs store system)
|
||||
"Return the list of outputs directories of the final inputs for SYSTEM."
|
||||
(append-map (match-lambda
|
||||
((or (name package) (name package _))
|
||||
(let ((drv (package-derivation store package system)))
|
||||
;; Libc's 'debug' output refers to gcc-cross-boot0, but it's
|
||||
;; hard to avoid, so we tolerate it. This should be the
|
||||
;; only exception. Likewise, 'bash:include' depends on
|
||||
;; bootstrap-binaries via its 'Makefile.inc' (FIXME).
|
||||
(filter-map (match-lambda
|
||||
(("debug" . directory)
|
||||
(if (string=? "glibc" (package-name package))
|
||||
#f
|
||||
directory))
|
||||
(("include" . directory)
|
||||
(if (string=? "bash" (package-name package))
|
||||
#f
|
||||
directory))
|
||||
((_ . directory) directory))
|
||||
(derivation->output-paths drv)))))
|
||||
((name package)
|
||||
(let ((drv (package-derivation store package system)))
|
||||
;; Libc's 'debug' output refers to gcc-cross-boot0, but it's
|
||||
;; hard to avoid, so we tolerate it. This should be the
|
||||
;; only exception. Likewise, 'bash:include' depends on
|
||||
;; bootstrap-binaries via its 'Makefile.inc' (FIXME).
|
||||
(filter-map (match-lambda
|
||||
(("debug" . directory)
|
||||
(if (string=? "glibc" (package-name package))
|
||||
#f
|
||||
directory))
|
||||
(("include" . directory)
|
||||
(if (string=? "bash" (package-name package))
|
||||
#f
|
||||
directory))
|
||||
((_ . directory) directory))
|
||||
(derivation->output-paths drv)))))
|
||||
%final-inputs))
|
||||
|
||||
(define (assert-valid-substitute substitute)
|
||||
|
||||
+78
-48
@@ -17,13 +17,20 @@
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(use-modules (ice-9 match)
|
||||
(use-modules (system base target)
|
||||
(system base message)
|
||||
(ice-9 match)
|
||||
(ice-9 threads)
|
||||
(srfi srfi-1)
|
||||
(guix build compile)
|
||||
(guix build utils))
|
||||
|
||||
(define warnings
|
||||
;; FIXME: 'format' is missing because it reports "non-literal format
|
||||
;; strings" due to the fact that we use 'G_' instead of '_'. We'll need
|
||||
;; help from Guile to solve this.
|
||||
'(unsupported-warning unbound-variable arity-mismatch))
|
||||
|
||||
(define host (getenv "host"))
|
||||
|
||||
(define srcdir (getenv "srcdir"))
|
||||
|
||||
(define (relative-file file)
|
||||
@@ -45,38 +52,61 @@
|
||||
(or (not (file-exists? go))
|
||||
(file-mtime<? go file))))
|
||||
|
||||
(define* (parallel-job-count #:optional (flags (getenv "MAKEFLAGS")))
|
||||
"Return the number of parallel jobs as determined by FLAGS, the flags passed
|
||||
to 'make'."
|
||||
(match flags
|
||||
(#f (current-processor-count))
|
||||
(flags
|
||||
(let ((initial-flags (string-tokenize flags)))
|
||||
(let loop ((flags initial-flags))
|
||||
(match flags
|
||||
(()
|
||||
;; Note: GNU make prior to version 4.2 would hide "-j" flags from
|
||||
;; $MAKEFLAGS. Thus, check for a "--jobserver" flag here and
|
||||
;; assume we're using all cores if specified.
|
||||
(if (any (lambda (flag)
|
||||
(string-prefix? "--jobserver" flag))
|
||||
initial-flags)
|
||||
(current-processor-count) ;GNU make < 4.2
|
||||
1)) ;sequential make
|
||||
(("-j" (= string->number count) _ ...)
|
||||
(if (integer? count)
|
||||
count
|
||||
(current-processor-count)))
|
||||
((head tail ...)
|
||||
(if (string-prefix? "-j" head)
|
||||
(match (string-drop head 2)
|
||||
(""
|
||||
(current-processor-count))
|
||||
((= string->number count)
|
||||
(if (integer? count)
|
||||
count
|
||||
(current-processor-count))))
|
||||
(loop tail)))))))))
|
||||
(define (file->module file)
|
||||
(let* ((relative (relative-file file))
|
||||
(module-path (string-drop-right relative 4)))
|
||||
(map string->symbol
|
||||
(string-split module-path #\/))))
|
||||
|
||||
;;; To work around <http://bugs.gnu.org/15602> (FIXME), we want to load all
|
||||
;;; files to be compiled first. We do this via resolve-interface so that the
|
||||
;;; top-level of each file (module) is only executed once.
|
||||
(define (load-module-file file)
|
||||
(let ((module (file->module file)))
|
||||
(format #t " LOAD ~a~%" module)
|
||||
(resolve-interface module)))
|
||||
|
||||
(cond-expand
|
||||
(guile-2.2 (use-modules (language tree-il optimize)
|
||||
(language cps optimize)))
|
||||
(else #f))
|
||||
|
||||
(define %default-optimizations
|
||||
;; Default optimization options (equivalent to -O2 on Guile 2.2).
|
||||
(cond-expand
|
||||
(guile-2.2 (append (tree-il-default-optimization-options)
|
||||
(cps-default-optimization-options)))
|
||||
(else '())))
|
||||
|
||||
(define %lightweight-optimizations
|
||||
;; Lightweight optimizations (like -O0, but with partial evaluation).
|
||||
(let loop ((opts %default-optimizations)
|
||||
(result '()))
|
||||
(match opts
|
||||
(() (reverse result))
|
||||
((#:partial-eval? _ rest ...)
|
||||
(loop rest `(#t #:partial-eval? ,@result)))
|
||||
((kw _ rest ...)
|
||||
(loop rest `(#f ,kw ,@result))))))
|
||||
|
||||
(define (optimization-options file)
|
||||
(if (string-contains file "gnu/packages/")
|
||||
%lightweight-optimizations ;build faster
|
||||
'()))
|
||||
|
||||
(define (compile-file* file output-mutex)
|
||||
(let ((go (scm->go file)))
|
||||
(with-mutex output-mutex
|
||||
(format #t " GUILEC ~a~%" go)
|
||||
(force-output))
|
||||
(mkdir-p (dirname go))
|
||||
(with-fluids ((*current-warning-prefix* ""))
|
||||
(with-target host
|
||||
(lambda ()
|
||||
(compile-file file
|
||||
#:output-file go
|
||||
#:opts `(#:warnings ,warnings
|
||||
,@(optimization-options file))))))))
|
||||
|
||||
;; Install a SIGINT handler to give unwind handlers in 'compile-file' an
|
||||
;; opportunity to run upon SIGINT and to remove temporary output files.
|
||||
@@ -86,16 +116,16 @@ to 'make'."
|
||||
|
||||
(match (command-line)
|
||||
((_ . files)
|
||||
(compile-files srcdir (getcwd)
|
||||
(filter file-needs-compilation? files)
|
||||
#:workers (parallel-job-count)
|
||||
#:host host
|
||||
#:report-load (lambda (file total completed)
|
||||
(when file
|
||||
(format #t " LOAD ~a~%" file)
|
||||
(force-output)))
|
||||
#:report-compilation (lambda (file total completed)
|
||||
(when file
|
||||
(format #t " GUILEC ~a~%"
|
||||
(scm->go file))
|
||||
(force-output))))))
|
||||
(let ((files (filter file-needs-compilation? files)))
|
||||
(for-each load-module-file files)
|
||||
(let ((mutex (make-mutex)))
|
||||
;; Make sure compilation related modules are loaded before starting to
|
||||
;; compile files in parallel.
|
||||
(compile #f)
|
||||
(par-for-each (lambda (file)
|
||||
(compile-file* file mutex))
|
||||
files)))))
|
||||
|
||||
;;; Local Variables:
|
||||
;;; eval: (put 'with-target 'scheme-indent-function 1)
|
||||
;;; End:
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.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/>.
|
||||
|
||||
;; Build Guix using Guix.
|
||||
|
||||
(use-modules (srfi srfi-26))
|
||||
|
||||
;; Add ~/.config/guix/current to the search path.
|
||||
(eval-when (expand load eval)
|
||||
(and=> (or (getenv "XDG_CONFIG_HOME")
|
||||
(and=> (getenv "HOME")
|
||||
(cut string-append <> "/.config/guix/current")))
|
||||
(lambda (current)
|
||||
(set! %load-path
|
||||
(cons (string-append current "/share/guile/site/"
|
||||
(effective-version))
|
||||
%load-path))
|
||||
(set! %load-compiled-path
|
||||
(cons (string-append current "/lib/guile/" (effective-version)
|
||||
"/site-ccache")
|
||||
%load-compiled-path)))))
|
||||
|
||||
(use-modules (guix) (guix ui)
|
||||
(guix git-download)
|
||||
(ice-9 match))
|
||||
|
||||
(match (command-line)
|
||||
((program source)
|
||||
(with-error-handling
|
||||
(with-store store
|
||||
(let* ((script (string-append source "/build-aux/build-self.scm"))
|
||||
(build (primitive-load script))
|
||||
(git? (git-predicate source)))
|
||||
(run-with-store store
|
||||
;; TODO: Extract #:version and #:commit using Guile-Git.
|
||||
(mlet* %store-monad ((source (interned-file source "guix-source"
|
||||
#:select? git?
|
||||
#:recursive? #t))
|
||||
(drv (build source #:pull-version 1)))
|
||||
(mbegin %store-monad
|
||||
(show-what-to-build* (list drv))
|
||||
(built-derivations (list drv))
|
||||
(with-monad %store-monad
|
||||
(display (derivation->output-path drv))
|
||||
(newline)
|
||||
(return drv))))))))))
|
||||
@@ -1,25 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.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/>.
|
||||
|
||||
;;;
|
||||
;;; This file defines build jobs for the Cuirass continuation integration
|
||||
;;; tool.
|
||||
;;;
|
||||
|
||||
(include "../hydra/gnu-system.scm")
|
||||
(include "hydra-to-cuirass.scm")
|
||||
@@ -1,6 +0,0 @@
|
||||
;;;
|
||||
;;; This file defines Cuirass build jobs to build Guix itself.
|
||||
;;;
|
||||
|
||||
(include "../hydra/guix-modular.scm")
|
||||
(include "hydra-to-cuirass.scm")
|
||||
@@ -1,47 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.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/>.
|
||||
|
||||
;;;
|
||||
;;; This file defines the conversion of Hydra build jobs to Cuirass build
|
||||
;;; jobs. It is meant to be included in other files.
|
||||
;;;
|
||||
|
||||
(use-modules ((guix licenses)
|
||||
#:select (license? license-name license-uri license-comment)))
|
||||
|
||||
(define (cuirass-jobs store arguments)
|
||||
"Return Cuirass jobs."
|
||||
(map hydra-job->cuirass-job (hydra-jobs store arguments)))
|
||||
|
||||
(define (hydra-job->cuirass-job hydra-job)
|
||||
(let ((name (car hydra-job))
|
||||
(job ((cdr hydra-job))))
|
||||
(lambda _ (acons #:job-name (symbol->string name)
|
||||
(map symbol-alist-entry->keyword-alist-entry job)))))
|
||||
|
||||
(define (symbol-alist-entry->keyword-alist-entry entry)
|
||||
(cons (symbol->keyword (car entry)) (entry->sexp-entry (cdr entry))))
|
||||
|
||||
(define (entry->sexp-entry o)
|
||||
(match o
|
||||
((? license?) `((name . (license-name o))
|
||||
(uri . ,(license-uri o))
|
||||
(comment . ,(license-comment o))))
|
||||
((lst ...)
|
||||
(map entry->sexp-entry lst))
|
||||
(_ o)))
|
||||
@@ -0,0 +1,73 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012, 2013, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;;
|
||||
;;; 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/>.
|
||||
|
||||
;;;
|
||||
;;; Download a binary file from an external source.
|
||||
;;;
|
||||
|
||||
(use-modules (ice-9 match)
|
||||
(web uri)
|
||||
(web client)
|
||||
(rnrs io ports)
|
||||
(srfi srfi-11)
|
||||
(guix base16)
|
||||
(guix hash))
|
||||
|
||||
(define %url-base
|
||||
"http://alpha.gnu.org/gnu/guix/bootstrap"
|
||||
|
||||
;; Alternately:
|
||||
;;"http://www.fdn.fr/~lcourtes/software/guix/packages"
|
||||
)
|
||||
|
||||
(define (file-name->uri file)
|
||||
"Return the URI for FILE."
|
||||
(match (string-tokenize file (char-set-complement (char-set #\/)))
|
||||
((_ ... system basename)
|
||||
(string->uri
|
||||
(string-append %url-base "/" system
|
||||
(match system
|
||||
("aarch64-linux"
|
||||
"/20170217/")
|
||||
("armhf-linux"
|
||||
"/20150101/")
|
||||
(_
|
||||
"/20131110/"))
|
||||
basename)))))
|
||||
|
||||
(match (command-line)
|
||||
((_ file expected-hash)
|
||||
(let ((uri (file-name->uri file)))
|
||||
(format #t "downloading file `~a'~%from `~a'...~%"
|
||||
file (uri->string uri))
|
||||
(let*-values (((resp data) (http-get uri #:decode-body? #f))
|
||||
((hash) (bytevector->base16-string (sha256 data)))
|
||||
((part) (string-append file ".part")))
|
||||
(if (string=? expected-hash hash)
|
||||
(begin
|
||||
(call-with-output-file part
|
||||
(lambda (port)
|
||||
(put-bytevector port data)))
|
||||
(rename-file part file))
|
||||
(begin
|
||||
(format (current-error-port)
|
||||
"file at `~a' has SHA256 ~a; expected ~a~%"
|
||||
(uri->string uri) hash expected-hash)
|
||||
(exit 1)))))))
|
||||
@@ -1,6 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -27,12 +26,6 @@
|
||||
(ice-9 pretty-print)
|
||||
(ice-9 format))
|
||||
|
||||
(define %top-srcdir
|
||||
(and=> (assq-ref (current-source-location) 'filename)
|
||||
(lambda (file)
|
||||
(canonicalize-path
|
||||
(string-append (dirname file) "/../..")))))
|
||||
|
||||
(define %user-module
|
||||
;; Hydra user module.
|
||||
(let ((m (make-module)))
|
||||
@@ -77,10 +70,9 @@ Otherwise return THING."
|
||||
|
||||
;; Without further ado...
|
||||
(match (command-line)
|
||||
((command file cuirass? ...)
|
||||
((command file)
|
||||
;; Load FILE, a Scheme file that defines Hydra jobs.
|
||||
(let ((port (current-output-port))
|
||||
(real-build-things build-things))
|
||||
(let ((port (current-output-port)))
|
||||
(save-module-excursion
|
||||
(lambda ()
|
||||
(set-current-module %user-module)
|
||||
@@ -94,24 +86,17 @@ Otherwise return THING."
|
||||
|
||||
;; Grafts can trigger early builds. We do not want that to happen
|
||||
;; during evaluation, so use a sledgehammer to catch such problems.
|
||||
;; An exception, though, is the evaluation of Guix itself, which
|
||||
;; requires building a "trampoline" program.
|
||||
(set! build-things
|
||||
(lambda (store . args)
|
||||
(format (current-error-port)
|
||||
"warning: building things during evaluation~%")
|
||||
"error: trying to build things during evaluation!~%")
|
||||
(format (current-error-port)
|
||||
"'build-things' arguments: ~s~%" args)
|
||||
(apply real-build-things store args)))
|
||||
(exit 1)))
|
||||
|
||||
;; Call the entry point of FILE and print the resulting job sexp.
|
||||
(pretty-print
|
||||
(match ((module-ref %user-module
|
||||
(if (equal? cuirass? "cuirass")
|
||||
'cuirass-jobs
|
||||
'hydra-jobs))
|
||||
store `((guix
|
||||
. ((file-name . ,%top-srcdir)))))
|
||||
(match ((module-ref %user-module 'hydra-jobs) store '())
|
||||
(((names . thunks) ...)
|
||||
(map (lambda (job thunk)
|
||||
(format (current-error-port) "evaluating '~a'... " job)
|
||||
@@ -122,8 +107,8 @@ Otherwise return THING."
|
||||
names thunks)))
|
||||
port))))
|
||||
((command _ ...)
|
||||
(format (current-error-port) "Usage: ~a FILE [cuirass]
|
||||
Evaluate the Hydra or Cuirass jobs defined in FILE.~%"
|
||||
(format (current-error-port) "Usage: ~a FILE
|
||||
Evaluate the Hydra jobs defined in FILE.~%"
|
||||
command)
|
||||
(exit 1)))
|
||||
|
||||
|
||||
+38
-151
@@ -1,7 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -23,29 +21,17 @@
|
||||
;;; tool.
|
||||
;;;
|
||||
|
||||
(use-modules (system base compile))
|
||||
;; Attempt to use our very own Guix modules.
|
||||
(eval-when (compile load eval)
|
||||
|
||||
(eval-when (expand load eval)
|
||||
|
||||
;; Pre-load the compiler so we don't end up auto-compiling it.
|
||||
(compile #t)
|
||||
|
||||
;; Use our very own Guix modules.
|
||||
;; Ignore any available .go, and force recompilation. This is because our
|
||||
;; checkout in the store has mtime set to the epoch, and thus .go files look
|
||||
;; newer, even though they may not correspond.
|
||||
(set! %fresh-auto-compile #t)
|
||||
|
||||
;; Ignore .go files except for Guile's. This is because our checkout in the
|
||||
;; store has mtime set to the epoch, and thus .go files look newer, even
|
||||
;; though they may not correspond. Use 'reverse' so that /gnu/store/…-guile
|
||||
;; comes before /run/current-system/profile.
|
||||
(set! %load-compiled-path
|
||||
(list
|
||||
(dirname (dirname (search-path (reverse %load-compiled-path)
|
||||
"ice-9/boot-9.go")))))
|
||||
|
||||
(and=> (assoc-ref (current-source-location) 'filename)
|
||||
(lambda (file)
|
||||
(let ((dir (canonicalize-path
|
||||
(string-append (dirname file) "/../.."))))
|
||||
(let ((dir (string-append (dirname file) "/../..")))
|
||||
(format (current-error-port) "prepending ~s to the load path~%"
|
||||
dir)
|
||||
(set! %load-path (cons dir %load-path))))))
|
||||
@@ -57,14 +43,11 @@
|
||||
(guix packages)
|
||||
(guix derivations)
|
||||
(guix monads)
|
||||
(guix ui)
|
||||
((guix licenses) #:select (gpl3+))
|
||||
((guix utils) #:select (%current-system))
|
||||
((guix scripts system) #:select (read-operating-system))
|
||||
((guix scripts pack)
|
||||
#:select (lookup-compressor self-contained-tarball))
|
||||
(gnu bootloader)
|
||||
(gnu bootloader u-boot)
|
||||
(gnu packages)
|
||||
(gnu packages gcc)
|
||||
(gnu packages base)
|
||||
@@ -149,10 +132,7 @@ SYSTEM."
|
||||
"i686-w64-mingw32"))
|
||||
|
||||
(define %guixsd-supported-systems
|
||||
'("x86_64-linux" "i686-linux" "armhf-linux"))
|
||||
|
||||
(define %u-boot-systems
|
||||
'("armhf-linux"))
|
||||
'("x86_64-linux" "i686-linux"))
|
||||
|
||||
(define (qemu-jobs store system)
|
||||
"Return a list of jobs that build QEMU images for SYSTEM."
|
||||
@@ -176,32 +156,20 @@ system.")
|
||||
(expt 2 20))
|
||||
|
||||
(if (member system %guixsd-supported-systems)
|
||||
(if (member system %u-boot-systems)
|
||||
(list (->job 'flash-image
|
||||
(run-with-store store
|
||||
(mbegin %store-monad
|
||||
(set-guile-for-build (default-guile))
|
||||
(system-disk-image
|
||||
(operating-system (inherit installation-os)
|
||||
(bootloader (bootloader-configuration
|
||||
(bootloader u-boot-bootloader)
|
||||
(target #f))))
|
||||
#:disk-image-size
|
||||
(* 1024 MiB))))))
|
||||
(list (->job 'usb-image
|
||||
(run-with-store store
|
||||
(mbegin %store-monad
|
||||
(set-guile-for-build (default-guile))
|
||||
(system-disk-image installation-os
|
||||
#:disk-image-size
|
||||
(* 1024 MiB)))))
|
||||
(->job 'iso9660-image
|
||||
(run-with-store store
|
||||
(mbegin %store-monad
|
||||
(set-guile-for-build (default-guile))
|
||||
(system-disk-image installation-os
|
||||
#:file-system-type
|
||||
"iso9660"))))))
|
||||
(list (->job 'usb-image
|
||||
(run-with-store store
|
||||
(mbegin %store-monad
|
||||
(set-guile-for-build (default-guile))
|
||||
(system-disk-image installation-os
|
||||
#:disk-image-size
|
||||
(* 1024 MiB)))))
|
||||
(->job 'iso9660-image
|
||||
(run-with-store store
|
||||
(mbegin %store-monad
|
||||
(set-guile-for-build (default-guile))
|
||||
(system-disk-image installation-os
|
||||
#:file-system-type
|
||||
"iso9660")))))
|
||||
'()))
|
||||
|
||||
(define (system-test-jobs store system)
|
||||
@@ -267,8 +235,7 @@ all its dependencies, and ready to be installed on non-GuixSD distributions.")
|
||||
|
||||
(define job-name
|
||||
;; Return the name of a package's job.
|
||||
(compose string->symbol
|
||||
(cut package-full-name <> "-")))
|
||||
(compose string->symbol package-full-name))
|
||||
|
||||
(define package->job
|
||||
(let ((base-packages
|
||||
@@ -283,8 +250,7 @@ all its dependencies, and ready to be installed on non-GuixSD distributions.")
|
||||
"Return a job for PACKAGE on SYSTEM, or #f if this combination is not
|
||||
valid."
|
||||
(cond ((member package base-packages)
|
||||
(package-job store (symbol-append 'base. (job-name package))
|
||||
package system))
|
||||
#f)
|
||||
((supported-package? package system)
|
||||
(let ((drv (package-derivation store package system
|
||||
#:graft? #f)))
|
||||
@@ -294,48 +260,6 @@ valid."
|
||||
(else
|
||||
#f)))))
|
||||
|
||||
(define (all-packages)
|
||||
"Return the list of packages to build."
|
||||
(define (adjust package result)
|
||||
(cond ((package-replacement package)
|
||||
(cons* package ;build both
|
||||
(package-replacement package)
|
||||
result))
|
||||
((package-superseded package)
|
||||
result) ;don't build it
|
||||
(else
|
||||
(cons package result))))
|
||||
|
||||
(fold-packages adjust
|
||||
(fold adjust '() ;include base packages
|
||||
(match (%final-inputs)
|
||||
(((labels packages _ ...) ...)
|
||||
packages)))
|
||||
#:select? (const #t))) ;include hidden packages
|
||||
|
||||
(define (arguments->manifests arguments)
|
||||
"Return the list of manifests extracted from ARGUMENTS."
|
||||
(map (match-lambda
|
||||
((input-name . relative-path)
|
||||
(let* ((checkout (assq-ref arguments (string->symbol input-name)))
|
||||
(base (assq-ref checkout 'file-name)))
|
||||
(in-vicinity base relative-path))))
|
||||
(assq-ref arguments 'manifests)))
|
||||
|
||||
(define (manifests->packages store manifests)
|
||||
"Return the list of packages found in MANIFESTS."
|
||||
(define (load-manifest manifest)
|
||||
(save-module-excursion
|
||||
(lambda ()
|
||||
(set-current-module (make-user-module '((guix profiles) (gnu))))
|
||||
(primitive-load manifest))))
|
||||
|
||||
(delete-duplicates!
|
||||
(map manifest-entry-item
|
||||
(append-map (compose manifest-entries
|
||||
load-manifest)
|
||||
manifests))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Hydra entry point.
|
||||
@@ -346,17 +270,8 @@ valid."
|
||||
(define subset
|
||||
(match (assoc-ref arguments 'subset)
|
||||
("core" 'core) ; only build core packages
|
||||
("hello" 'hello) ; only build hello
|
||||
(((? string?) (? string?) ...) 'list) ; only build selected list of packages
|
||||
("manifests" 'manifests) ; only build packages in the list of manifests
|
||||
(_ 'all))) ; build everything
|
||||
|
||||
(define systems
|
||||
(match (assoc-ref arguments 'systems)
|
||||
(#f %hydra-supported-systems)
|
||||
((lst ...) lst)
|
||||
((? string? str) (call-with-input-string str read))))
|
||||
|
||||
(define (cross-jobs system)
|
||||
(define (from-32-to-64? target)
|
||||
;; Return true if SYSTEM is 32-bit and TARGET is 64-bit. This hack
|
||||
@@ -377,15 +292,8 @@ valid."
|
||||
|
||||
(define (pointless? target)
|
||||
;; Return #t if it makes no sense to cross-build to TARGET from SYSTEM.
|
||||
(match system
|
||||
((or "x86_64-linux" "i686-linux")
|
||||
(if (string-contains target "mingw")
|
||||
(not (string=? "x86_64-linux" system))
|
||||
#f))
|
||||
(_
|
||||
;; Don't try to cross-compile from non-Intel platforms: this isn't
|
||||
;; very useful and these are often brittle configurations.
|
||||
#t)))
|
||||
(and (string-contains target "mingw")
|
||||
(not (string=? "x86_64-linux" system))))
|
||||
|
||||
(define (either proc1 proc2 proc3)
|
||||
(lambda (x)
|
||||
@@ -403,17 +311,20 @@ valid."
|
||||
(parameterize ((%graft? #f))
|
||||
;; Return one job for each package, except bootstrap packages.
|
||||
(append-map (lambda (system)
|
||||
(format (current-error-port)
|
||||
"evaluating for '~a' (heap size: ~a MiB)...~%"
|
||||
system
|
||||
(round
|
||||
(/ (assoc-ref (gc-stats) 'heap-size)
|
||||
(expt 2. 20))))
|
||||
(invalidate-derivation-caches!)
|
||||
(case subset
|
||||
((all)
|
||||
;; Build everything, including replacements.
|
||||
(let ((all (all-packages))
|
||||
(let ((all (fold-packages
|
||||
(lambda (package result)
|
||||
(cond ((package-replacement package)
|
||||
(cons* package
|
||||
(package-replacement package)
|
||||
result))
|
||||
((package-superseded package)
|
||||
result) ;don't build it
|
||||
(else
|
||||
(cons package result))))
|
||||
'()))
|
||||
(job (lambda (package)
|
||||
(package->job store package
|
||||
system))))
|
||||
@@ -429,30 +340,6 @@ valid."
|
||||
package system))
|
||||
%core-packages)
|
||||
(cross-jobs system)))
|
||||
((hello)
|
||||
;; Build hello package only.
|
||||
(if (string=? system (%current-system))
|
||||
(let ((hello (specification->package "hello")))
|
||||
(list (package-job store (job-name hello) hello system)))
|
||||
'()))
|
||||
((list)
|
||||
;; Build selected list of packages only.
|
||||
(if (string=? system (%current-system))
|
||||
(let* ((names (assoc-ref arguments 'subset))
|
||||
(packages (map specification->package names)))
|
||||
(map (lambda (package)
|
||||
(package-job store (job-name package)
|
||||
package system))
|
||||
packages))
|
||||
'()))
|
||||
((manifests)
|
||||
;; Build packages in the list of manifests.
|
||||
(let* ((manifests (arguments->manifests arguments))
|
||||
(packages (manifests->packages store manifests)))
|
||||
(map (lambda (package)
|
||||
(package-job store (job-name package)
|
||||
package system))
|
||||
packages)))
|
||||
(else
|
||||
(error "unknown subset" subset))))
|
||||
systems)))
|
||||
%hydra-supported-systems)))
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.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/>.
|
||||
|
||||
;;;
|
||||
;;; This file defines a continuous integration job to build the same modular
|
||||
;;; Guix as 'guix pull', which is defined in (guix self).
|
||||
;;;
|
||||
|
||||
(use-modules (guix store)
|
||||
(guix config)
|
||||
(guix utils)
|
||||
((guix packages) #:select (%hydra-supported-systems))
|
||||
(guix derivations)
|
||||
(guix monads)
|
||||
((guix licenses) #:prefix license:)
|
||||
(srfi srfi-1)
|
||||
(ice-9 match))
|
||||
|
||||
;; XXX: Debugging hack: since `hydra-eval-guile-jobs' redirects the output
|
||||
;; port to the bit bucket, let us write to the error port instead.
|
||||
(setvbuf (current-error-port) _IOLBF)
|
||||
(set-current-output-port (current-error-port))
|
||||
|
||||
(define* (build-job store source version system)
|
||||
"Return a Hydra job a list building the modular Guix derivation from SOURCE
|
||||
for SYSTEM. Use VERSION as the version identifier."
|
||||
(lambda ()
|
||||
(define build
|
||||
(primitive-load (string-append source "/build-aux/build-self.scm")))
|
||||
|
||||
`((derivation . ,(derivation-file-name
|
||||
(run-with-store store
|
||||
(build source #:version version #:system system
|
||||
#:pull-version 1
|
||||
#:guile-version "2.2")))) ;the latest 2.2.x
|
||||
(description . "Modular Guix")
|
||||
(long-description
|
||||
. "This is the modular Guix package as produced by 'guix pull'.")
|
||||
(license . ,license:gpl3+)
|
||||
(home-page . ,%guix-home-page-url)
|
||||
(maintainers . (,%guix-bug-report-address)))))
|
||||
|
||||
(define (hydra-jobs store arguments)
|
||||
"Return Hydra jobs."
|
||||
(define systems
|
||||
(match (assoc-ref arguments 'systems)
|
||||
(#f %hydra-supported-systems)
|
||||
((lst ...) lst)
|
||||
((? string? str) (call-with-input-string str read))))
|
||||
|
||||
(define guix-checkout
|
||||
(or (assq-ref arguments 'guix) ;Hydra on hydra
|
||||
(assq-ref arguments 'guix-modular))) ;Cuirass on berlin
|
||||
|
||||
(define version
|
||||
(or (assq-ref guix-checkout 'revision)
|
||||
"0.unknown"))
|
||||
|
||||
(let ((file (assq-ref guix-checkout 'file-name)))
|
||||
(format (current-error-port) "using checkout ~s (~s; arguments: ~s)~%"
|
||||
guix-checkout file arguments)
|
||||
|
||||
(map (lambda (system)
|
||||
(let ((name (string->symbol
|
||||
(string-append "guix." system))))
|
||||
`(,name
|
||||
. ,(build-job store file version system))))
|
||||
systems)))
|
||||
+34
-23
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -22,7 +22,7 @@
|
||||
;;;
|
||||
|
||||
;; Attempt to use our very own Guix modules.
|
||||
(eval-when (expand load eval)
|
||||
(eval-when (compile load eval)
|
||||
|
||||
;; Ignore any available .go, and force recompilation. This is because our
|
||||
;; checkout in the store has mtime set to the epoch, and thus .go files look
|
||||
@@ -43,10 +43,13 @@
|
||||
(use-modules (guix store)
|
||||
(guix packages)
|
||||
(guix utils)
|
||||
(guix grafts)
|
||||
(guix derivations)
|
||||
(guix build-system gnu)
|
||||
(gnu packages version-control)
|
||||
(gnu packages package-management)
|
||||
(gnu packages imagemagick)
|
||||
(gnu packages graphviz)
|
||||
(gnu packages man)
|
||||
(srfi srfi-1)
|
||||
(srfi srfi-26)
|
||||
(ice-9 match))
|
||||
@@ -60,15 +63,36 @@
|
||||
#:optional (package-derivation package-derivation))
|
||||
"Convert PACKAGE to an alist suitable for Hydra."
|
||||
`((derivation . ,(derivation-file-name
|
||||
(parameterize ((%graft? #f))
|
||||
(package-derivation store package system
|
||||
#:graft? #f))))
|
||||
(package-derivation store package system)))
|
||||
(description . ,(package-synopsis package))
|
||||
(long-description . ,(package-description package))
|
||||
(license . ,(package-license package))
|
||||
(home-page . ,(package-home-page package))
|
||||
(maintainers . ("bug-guix@gnu.org"))))
|
||||
|
||||
(define (tarball-package checkout)
|
||||
"Return a package that does `make distcheck' from CHECKOUT, a directory
|
||||
containing a Git checkout of Guix."
|
||||
(let ((guix (@@ (gnu packages package-management) guix)))
|
||||
(dist-package (package
|
||||
(inherit guix)
|
||||
(arguments (package-arguments guix))
|
||||
(native-inputs `(("imagemagick" ,imagemagick)
|
||||
,@(package-native-inputs guix))))
|
||||
checkout
|
||||
|
||||
#:phases
|
||||
'(modify-phases %dist-phases
|
||||
(add-before 'build 'build-daemon
|
||||
;; Build 'guix-daemon' first so that help2man
|
||||
;; successfully creates 'guix-daemon.1'.
|
||||
(lambda _
|
||||
(let ((n (number->string
|
||||
(parallel-job-count))))
|
||||
(zero? (system* "make"
|
||||
"nix/libstore/schema.sql.hh"
|
||||
"guix-daemon" "-j" n)))))))))
|
||||
|
||||
(define (hydra-jobs store arguments)
|
||||
"Return Hydra jobs."
|
||||
(define systems
|
||||
@@ -85,22 +109,9 @@
|
||||
(define guix-checkout
|
||||
(assq-ref arguments 'guix))
|
||||
|
||||
(let ((file (assq-ref guix-checkout 'file-name)))
|
||||
(let ((guix (assq-ref guix-checkout 'file-name)))
|
||||
(format (current-error-port) "using checkout ~s (~s)~%"
|
||||
guix-checkout file)
|
||||
|
||||
guix-checkout guix)
|
||||
`((tarball . ,(cute package->alist store
|
||||
(dist-package guix file)
|
||||
(%current-system)))
|
||||
|
||||
,@(map (lambda (system)
|
||||
(let ((name (string->symbol
|
||||
(string-append "guix." system))))
|
||||
`(,name
|
||||
. ,(cute package->alist store
|
||||
(package
|
||||
(inherit guix)
|
||||
(version "latest")
|
||||
(source file))
|
||||
system))))
|
||||
%hydra-supported-systems))))
|
||||
(tarball-package guix)
|
||||
(%current-system))))))
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2017 Eric Bavier <bavier@cray.com>
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Guix.
|
||||
#
|
||||
@@ -51,9 +50,17 @@ NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate'
|
||||
export NIX_ROOT_FINDER NIX_SUBSTITUTERS NIX_LIBEXEC_DIR
|
||||
|
||||
NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
|
||||
@BUILD_DAEMON_OFFLOAD_TRUE@export NIX_BUILD_HOOK
|
||||
@BUILD_DAEMON_OFFLOAD_FALSE@# No offloading support.
|
||||
@BUILD_DAEMON_OFFLOAD_FALSE@unset NIX_BUILD_HOOK
|
||||
if [ -x "$NIX_BUILD_HOOK" ]
|
||||
then
|
||||
export NIX_BUILD_HOOK
|
||||
else
|
||||
# No offloading support.
|
||||
unset NIX_BUILD_HOOK
|
||||
fi
|
||||
|
||||
# The 'guix-register' program.
|
||||
GUIX_REGISTER="$abs_top_builddir/guix-register"
|
||||
export GUIX_REGISTER
|
||||
|
||||
# The following variables need only be defined when compiling Guix
|
||||
# modules, but we define them to be on the safe side in case of
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -19,7 +19,6 @@
|
||||
(define-module (run-system-tests)
|
||||
#:use-module (gnu tests)
|
||||
#:use-module (guix store)
|
||||
#:use-module (guix status)
|
||||
#:use-module (guix monads)
|
||||
#:use-module (guix derivations)
|
||||
#:use-module (guix ui)
|
||||
@@ -64,27 +63,25 @@
|
||||
(length tests))
|
||||
|
||||
(with-store store
|
||||
(with-status-report print-build-event
|
||||
(run-with-store store
|
||||
(mlet* %store-monad ((drv (mapm %store-monad system-test-value tests))
|
||||
(out -> (map derivation->output-path drv)))
|
||||
(mbegin %store-monad
|
||||
(show-what-to-build* drv)
|
||||
(set-build-options* #:keep-going? #t #:keep-failed? #t
|
||||
#:print-build-trace #t
|
||||
#:print-extended-build-trace? #t
|
||||
#:fallback? #t)
|
||||
(built-derivations* drv)
|
||||
(mlet %store-monad ((valid (filterm (store-lift valid-path?)
|
||||
out))
|
||||
(failed (filterm (store-lift
|
||||
(negate valid-path?))
|
||||
out)))
|
||||
(format #t "TOTAL: ~a\n" (length drv))
|
||||
(for-each (lambda (item)
|
||||
(format #t "PASS: ~a~%" item))
|
||||
valid)
|
||||
(for-each (lambda (item)
|
||||
(format #t "FAIL: ~a~%" item))
|
||||
failed)
|
||||
(exit (null? failed)))))))))
|
||||
(run-with-store store
|
||||
(mlet* %store-monad ((drv (mapm %store-monad system-test-value tests))
|
||||
(out -> (map derivation->output-path drv)))
|
||||
(mbegin %store-monad
|
||||
(show-what-to-build* drv)
|
||||
(set-build-options* #:keep-going? #t #:keep-failed? #t
|
||||
#:print-build-trace #t
|
||||
#:fallback? #t)
|
||||
(built-derivations* drv)
|
||||
(mlet %store-monad ((valid (filterm (store-lift valid-path?)
|
||||
out))
|
||||
(failed (filterm (store-lift
|
||||
(negate valid-path?))
|
||||
out)))
|
||||
(format #t "TOTAL: ~a\n" (length drv))
|
||||
(for-each (lambda (item)
|
||||
(format #t "PASS: ~a~%" item))
|
||||
valid)
|
||||
(for-each (lambda (item)
|
||||
(format #t "FAIL: ~a~%" item))
|
||||
failed)
|
||||
(exit (null? failed))))))))
|
||||
|
||||
+1
-28
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Guix.
|
||||
#
|
||||
@@ -110,33 +110,6 @@ then
|
||||
|
||||
daemon_pid=$!
|
||||
trap "kill $daemon_pid ; rm -rf $NIX_STATE_DIR" EXIT
|
||||
|
||||
# The test suite expects the 'guile-bootstrap' package to be available.
|
||||
# Normally the Guile bootstrap tarball is downloaded by a fixed-output
|
||||
# derivation but when network access is missing we allow users to drop
|
||||
# the tarball in 'gnu/packages/bootstrap/SYSTEM' and "intern" it here.
|
||||
bootstrap_directory="@abs_top_builddir@/gnu/packages/bootstrap/@guix_system@"
|
||||
if [ -d "$bootstrap_directory" ]
|
||||
then
|
||||
# Make sure 'guix-daemon' is listening before invoking 'guix
|
||||
# download'.
|
||||
"@abs_top_builddir@/pre-inst-env" "@GUILE@" -c \
|
||||
'(use-modules (guix))
|
||||
(let loop ((i 10))
|
||||
(catch #t
|
||||
(lambda () (open-connection))
|
||||
(lambda (key . args)
|
||||
(if (zero? i)
|
||||
(apply throw key args)
|
||||
(begin (usleep 500000) (loop (- i 1)))))))'
|
||||
|
||||
for file in "$bootstrap_directory"/guile-*
|
||||
do
|
||||
[ -f "$file" ] && \
|
||||
"@abs_top_builddir@/pre-inst-env" \
|
||||
guix download "file://$file" > /dev/null
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# Avoid issues that could stem from l10n, such as language/encoding
|
||||
|
||||
+20
-51
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -30,7 +30,6 @@
|
||||
(ice-9 match)
|
||||
(ice-9 rdelim)
|
||||
(ice-9 regex)
|
||||
(ice-9 vlist)
|
||||
(ice-9 pretty-print))
|
||||
|
||||
(define %header-rx
|
||||
@@ -99,77 +98,47 @@ paragraph."
|
||||
(lambda (match port)
|
||||
(let ((stars (match:substring match 1)))
|
||||
(format port
|
||||
"~a ~a new packages~%~%"
|
||||
stars (length added)))))))))
|
||||
"~a ~a new packages~%~%~a~%~%"
|
||||
stars (length added)
|
||||
(enumeration->paragraph added)))))))))
|
||||
|
||||
(define (write-packages-updates news-file old new)
|
||||
"Write to NEWS-FILE the list of packages upgraded between OLD and NEW."
|
||||
(define important
|
||||
'("gcc" "glibc" "binutils" "gdb" ;toolchain
|
||||
"shepherd" "linux-libre" "xorg-server" "cups" ;OS
|
||||
"gnome" "xfce" "enlightenment" "lxde" "mate" ;desktop env.
|
||||
"guile" "bash" "python" "python2" "perl" ;languages
|
||||
"ghc" "rust" "go" "julia" "r" "ocaml"
|
||||
"icedtea" "openjdk" "clojure" "sbcl" "racket"
|
||||
"emacs" "gimp" "inkscape" "libreoffice" ;applications
|
||||
"octave" "icecat" "gnupg"))
|
||||
|
||||
(let* ((table (fold (lambda (package table)
|
||||
(match package
|
||||
((name . version)
|
||||
(vhash-cons name version table))))
|
||||
vlist-null
|
||||
new))
|
||||
(latest (lambda (name)
|
||||
(let ((versions (vhash-fold* cons '() name table)))
|
||||
(match (sort versions version>?)
|
||||
((latest . _) latest)))))
|
||||
(upgraded (filter-map (match-lambda
|
||||
((package . new-version)
|
||||
(match (assoc package old)
|
||||
((_ . old-version)
|
||||
(and (string=? new-version
|
||||
(latest package))
|
||||
(version>? new-version old-version)
|
||||
(cons package new-version)))
|
||||
(_ #f))))
|
||||
new))
|
||||
(noteworthy (filter (match-lambda
|
||||
((package . version)
|
||||
(member package important)))
|
||||
upgraded)))
|
||||
(let ((upgraded (filter-map (match-lambda
|
||||
((package . new-version)
|
||||
(match (assoc package old)
|
||||
((_ . old-version)
|
||||
(and (version>? new-version old-version)
|
||||
(string-append package "@"
|
||||
new-version)))
|
||||
(_ #f))))
|
||||
new)))
|
||||
(with-atomic-file-replacement news-file
|
||||
(lambda (input output)
|
||||
(rewrite-org-section input output
|
||||
(make-regexp "^(\\*+) (.*) package updates")
|
||||
(lambda (match port)
|
||||
(let ((stars (match:substring match 1))
|
||||
(lst (map (match-lambda
|
||||
((package . version)
|
||||
(string-append package " "
|
||||
version)))
|
||||
noteworthy)))
|
||||
(let ((stars (match:substring match 1)))
|
||||
(format port
|
||||
"~a ~a package updates~%~%Noteworthy updates:~%~a~%~%"
|
||||
"~a ~a package updates~%~%~a~%~%"
|
||||
stars (length upgraded)
|
||||
(enumeration->paragraph lst)))))))))
|
||||
(enumeration->paragraph upgraded)))))))))
|
||||
|
||||
|
||||
(define (main . args)
|
||||
(match args
|
||||
((news-file data-directory)
|
||||
;; Don't browse things listed in the user's $GUIX_PACKAGE_PATH and
|
||||
;; in external channels.
|
||||
;; Don't browse things listed in the user's $GUIX_PACKAGE_PATH. Here we
|
||||
;; assume that the last item in (%package-module-path) is the distro
|
||||
;; directory.
|
||||
(parameterize ((%package-module-path
|
||||
%default-package-module-path))
|
||||
(list (last (%package-module-path)))))
|
||||
(define (package-file version)
|
||||
(string-append data-directory "/packages-"
|
||||
version ".txt"))
|
||||
|
||||
(let-values (((previous-version new-version)
|
||||
(call-with-input-file news-file NEWS->versions)))
|
||||
(format (current-error-port) "Updating NEWS for ~a to ~a...~%"
|
||||
previous-version new-version)
|
||||
(let* ((old (call-with-input-file (package-file previous-version)
|
||||
read))
|
||||
(new (fold-packages (lambda (p r)
|
||||
|
||||
+23
-22
@@ -18,18 +18,11 @@ if test "x$guix_build_daemon" = "xyes"; then
|
||||
dnl Use 64-bit file system calls so that we can support files > 2 GiB.
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl Look for zlib, a required dependency.
|
||||
AC_CHECK_LIB([z], [gzdopen], [true],
|
||||
[AC_MSG_ERROR([Guix requires zlib. See http://www.zlib.net/.])])
|
||||
AC_CHECK_HEADERS([zlib.h], [true],
|
||||
[AC_MSG_ERROR([Guix requires zlib. See http://www.zlib.net/.])])
|
||||
|
||||
dnl Look for libbz2, an optional dependency.
|
||||
AC_CHECK_LIB([bz2], [BZ2_bzWriteOpen], [HAVE_LIBBZ2=yes], [HAVE_LIBBZ2=no])
|
||||
if test "x$HAVE_LIBBZ2" = xyes; then
|
||||
AC_CHECK_HEADERS([bzlib.h])
|
||||
HAVE_LIBBZ2="$ac_cv_header_bzlib_h"
|
||||
fi
|
||||
dnl Look for libbz2, a required dependency.
|
||||
AC_CHECK_LIB([bz2], [BZ2_bzWriteOpen], [true],
|
||||
[AC_MSG_ERROR([Guix requires libbz2, which is part of bzip2. See http://www.bzip.org/.])])
|
||||
AC_CHECK_HEADERS([bzlib.h], [true],
|
||||
[AC_MSG_ERROR([Guix requires libbz2, which is part of bzip2. See http://www.bzip.org/.])])
|
||||
|
||||
dnl Look for SQLite, a required dependency.
|
||||
PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.6.19])
|
||||
@@ -48,7 +41,7 @@ if test "x$guix_build_daemon" = "xyes"; then
|
||||
esac
|
||||
|
||||
case "$LIBGCRYPT_LIBDIR" in
|
||||
no | "")
|
||||
no)
|
||||
LIBGCRYPT_LIBS="-lgcrypt"
|
||||
;;
|
||||
*)
|
||||
@@ -118,21 +111,30 @@ if test "x$guix_build_daemon" = "xyes"; then
|
||||
dnl Check for <linux/fs.h> (for immutable file support).
|
||||
AC_CHECK_HEADERS([linux/fs.h])
|
||||
|
||||
dnl Determine the appropriate default list of substitute URLs (GnuTLS
|
||||
dnl is required so we can default to 'https'.)
|
||||
guix_substitute_urls="https://ci.guix.info"
|
||||
|
||||
dnl Determine the appropriate default list of substitute URLs.
|
||||
GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)])
|
||||
if test "x$have_gnutls" = "xyes"; then
|
||||
guix_substitute_urls="https://mirror.hydra.gnu.org"
|
||||
else
|
||||
AC_MSG_WARN([GnuTLS is missing, substitutes will be downloaded in the clear])
|
||||
guix_substitute_urls="http://mirror.hydra.gnu.org"
|
||||
fi
|
||||
AC_MSG_CHECKING([for default substitute URLs])
|
||||
AC_MSG_RESULT([$guix_substitute_urls])
|
||||
|
||||
AC_DEFINE_UNQUOTED([GUIX_SUBSTITUTE_URLS], ["$guix_substitute_urls"],
|
||||
[Default list of substitute URLs used by 'guix-daemon'.])
|
||||
|
||||
dnl Check whether the 'offload' build hook can be built (uses
|
||||
dnl 'restore-file-set', which requires unbuffered custom binary input
|
||||
dnl ports from Guile >= 2.0.10.)
|
||||
GUIX_CHECK_UNBUFFERED_CBIP
|
||||
|
||||
dnl Check for Guile-SSH, which is required by 'guix offload'.
|
||||
GUIX_CHECK_GUILE_SSH
|
||||
|
||||
case "x$guix_cv_have_recent_guile_ssh" in
|
||||
xyes)
|
||||
case "x$ac_cv_guix_cbips_support_setvbuf$guix_cv_have_recent_guile_ssh" in
|
||||
xyesyes)
|
||||
guix_build_daemon_offload="yes"
|
||||
AC_DEFINE([HAVE_DAEMON_OFFLOAD_HOOK], [1],
|
||||
[Define if the daemon's 'offload' build hook is being built (requires Guile-SSH).])
|
||||
@@ -155,13 +157,12 @@ if test "x$guix_build_daemon" = "xyes"; then
|
||||
[chmod +x nix/scripts/download])
|
||||
AC_CONFIG_FILES([nix/scripts/substitute],
|
||||
[chmod +x nix/scripts/substitute])
|
||||
AC_CONFIG_FILES([nix/scripts/authenticate],
|
||||
[chmod +x nix/scripts/authenticate])
|
||||
AC_CONFIG_FILES([nix/scripts/guix-authenticate],
|
||||
[chmod +x nix/scripts/guix-authenticate])
|
||||
AC_CONFIG_FILES([nix/scripts/offload],
|
||||
[chmod +x nix/scripts/offload])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([HAVE_LIBBZ2], [test "x$HAVE_LIBBZ2" = "xyes"])
|
||||
AM_CONDITIONAL([BUILD_DAEMON], [test "x$guix_build_daemon" = "xyes"])
|
||||
AM_CONDITIONAL([BUILD_DAEMON_OFFLOAD], \
|
||||
[test "x$guix_build_daemon" = "xyes" \
|
||||
|
||||
+28
-54
@@ -8,7 +8,7 @@ AC_INIT([GNU Guix],
|
||||
[https://www.gnu.org/software/guix/])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.14 gnu silent-rules subdir-objects \
|
||||
AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects \
|
||||
color-tests parallel-tests -Woverride -Wno-portability])
|
||||
|
||||
# Enable silent rules by default.
|
||||
@@ -47,26 +47,12 @@ AC_ARG_WITH([zsh-completion-dir],
|
||||
[zshcompletiondir='${datadir}/zsh/site-functions'])
|
||||
AC_SUBST([zshcompletiondir])
|
||||
|
||||
AC_ARG_WITH([fish-completion-dir],
|
||||
AC_HELP_STRING([--with-fish-completion-dir=DIR],
|
||||
[name of the Fish completion directory]),
|
||||
[fishcompletiondir="$withval"],
|
||||
[fishcompletiondir='${datadir}/fish/vendor_completions.d'])
|
||||
AC_SUBST([fishcompletiondir])
|
||||
|
||||
AC_ARG_WITH([selinux-policy-dir],
|
||||
AC_HELP_STRING([--with-selinux-policy-dir=DIR],
|
||||
[name of the SELinux policy directory]),
|
||||
[selinux_policydir="$withval"],
|
||||
[selinux_policydir='${datadir}/selinux/'])
|
||||
AC_SUBST([selinux_policydir])
|
||||
|
||||
dnl Better be verbose.
|
||||
AC_MSG_CHECKING([for the store directory])
|
||||
AC_MSG_RESULT([$storedir])
|
||||
|
||||
AC_ARG_ENABLE([daemon],
|
||||
[AS_HELP_STRING([--disable-daemon], [do not build the Nix daemon (C++)])],
|
||||
[AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
|
||||
[guix_build_daemon="$enableval"],
|
||||
[guix_build_daemon="yes"])
|
||||
|
||||
@@ -87,9 +73,7 @@ dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
|
||||
dnl Make sure they are available.
|
||||
m4_pattern_forbid([PKG_CHECK_MODULES])
|
||||
m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
|
||||
m4_pattern_forbid([^GUILE_P])
|
||||
m4_pattern_allow([^GUILE_PKG_ERRORS])
|
||||
m4_pattern_forbid([^GUIX_])
|
||||
m4_pattern_forbid([^GUILE_P$])
|
||||
|
||||
dnl Search for 'guile' and 'guild'. This macro defines
|
||||
dnl 'GUILE_EFFECTIVE_VERSION'.
|
||||
@@ -100,7 +84,7 @@ if test "x$GUILD" = "x"; then
|
||||
fi
|
||||
|
||||
if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then
|
||||
PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.13])
|
||||
PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.9])
|
||||
fi
|
||||
|
||||
dnl Installation directories for .scm and .go files.
|
||||
@@ -116,38 +100,17 @@ if test "x$have_gnutls" != "xyes"; then
|
||||
AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.])
|
||||
fi
|
||||
|
||||
dnl Guile-JSON is used in various places.
|
||||
GUILE_MODULE_AVAILABLE([have_guile_json], [(json)])
|
||||
AM_CONDITIONAL([HAVE_GUILE_JSON], [test "x$have_guile_json" = "xyes"])
|
||||
|
||||
dnl Check for Guile-Git.
|
||||
GUILE_MODULE_AVAILABLE([have_guile_git], [(git)])
|
||||
if test "x$have_guile_git" != "xyes"; then
|
||||
AC_MSG_ERROR([Guile-Git is missing; please install it.])
|
||||
fi
|
||||
|
||||
dnl Check for Guile-JSON.
|
||||
GUILE_MODULE_AVAILABLE([have_guile_json], [(json)])
|
||||
if test "x$have_guile_json" != "xyes"; then
|
||||
AC_MSG_ERROR([Guile-JSON is missing; please install it.])
|
||||
fi
|
||||
|
||||
dnl Guile-Sqlite3 is used by the (guix store ...) modules.
|
||||
GUIX_CHECK_GUILE_SQLITE3
|
||||
if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
|
||||
AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
|
||||
fi
|
||||
|
||||
GUILE_MODULE_AVAILABLE([have_guile_gcrypt], [(gcrypt hash)])
|
||||
if test "x$have_guile_gcrypt" != "xyes"; then
|
||||
AC_MSG_ERROR([Guile-Gcrypt could not be found; please install it.])
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_GUILE_GIT], [test "x$have_guile_git" = "xyes"])
|
||||
|
||||
dnl Make sure we have a full-fledged Guile.
|
||||
GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
|
||||
|
||||
dnl Make sure we don't suffer from the bug in 'equal?' wrt. syntax objects
|
||||
dnl found in 2.2.1. See <https://bugs.gnu.org/29903>.
|
||||
GUIX_ASSERT_SYNTAX_OBJECT_EQUAL
|
||||
|
||||
AC_PROG_SED
|
||||
|
||||
dnl Decompressors, for use by the substituter and other modules.
|
||||
AC_PATH_PROG([GZIP], [gzip])
|
||||
AC_PATH_PROG([BZIP2], [bzip2])
|
||||
@@ -169,11 +132,18 @@ AC_ARG_WITH([nix-prefix],
|
||||
esac],
|
||||
[])
|
||||
|
||||
AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
|
||||
AC_PATH_PROG([NIX_HASH], [nix-hash])
|
||||
if test "x$guix_build_daemon$NIX_HASH" = "xno"; then
|
||||
if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
|
||||
AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
|
||||
fi
|
||||
|
||||
if test "x$NIX_INSTANTIATE" = "x"; then
|
||||
# This program is an optional dependency, so we just want it to be
|
||||
# taken from $PATH if it's not available right now.
|
||||
NIX_INSTANTIATE="nix-instantiate"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([nixpkgs],
|
||||
[AS_HELP_STRING([--with-nixpkgs=DIR],
|
||||
[search for Nixpkgs in DIR (for testing purposes only)])],
|
||||
@@ -222,10 +192,16 @@ AC_ARG_WITH([libgcrypt-libdir],
|
||||
esac])
|
||||
|
||||
dnl If none of the --with-libgcrypt-* options was used, try to determine the
|
||||
dnl the library directory.
|
||||
dnl absolute file name of libgcrypt.so.
|
||||
case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
|
||||
xnono)
|
||||
GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
|
||||
if test "x$LIBGCRYPT_LIBDIR" != x; then
|
||||
LIBGCRYPT="$LIBGCRYPT_LIBDIR/libgcrypt"
|
||||
else
|
||||
dnl 'config-daemon.ac' expects "no" in this case.
|
||||
LIBGCRYPT_LIBDIR="no"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -236,6 +212,8 @@ AC_SUBST([LIBGCRYPT])
|
||||
AC_SUBST([LIBGCRYPT_PREFIX])
|
||||
AC_SUBST([LIBGCRYPT_LIBDIR])
|
||||
|
||||
GUIX_ASSERT_LIBGCRYPT_USABLE
|
||||
|
||||
dnl Library name of zlib suitable for 'dynamic-link'.
|
||||
GUIX_LIBZ_LIBDIR([libz_libdir])
|
||||
if test "x$libz_libdir" = "x"; then
|
||||
@@ -263,10 +241,6 @@ AM_MISSING_PROG([DOT], [dot])
|
||||
dnl Manual pages.
|
||||
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||
|
||||
dnl Documentation translation.
|
||||
AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate])
|
||||
AM_MISSING_PROG([PO4A_UPDATEPO], [po4a-updatepo])
|
||||
|
||||
dnl Emacs (optional), for 'etc/indent-package.el'.
|
||||
AC_PATH_PROG([EMACS], [emacs], [/usr/bin/emacs])
|
||||
AC_SUBST([EMACS])
|
||||
@@ -283,9 +257,9 @@ esac
|
||||
AC_CONFIG_FILES([Makefile
|
||||
po/guix/Makefile.in
|
||||
po/packages/Makefile.in
|
||||
etc/guix-daemon.cil
|
||||
guix/config.scm])
|
||||
guix/config.scm])
|
||||
|
||||
AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
|
||||
AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
|
||||
AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
|
||||
[chmod +x pre-inst-env])
|
||||
|
||||
@@ -1,534 +0,0 @@
|
||||
@node Mitwirken
|
||||
@chapter Mitwirken
|
||||
|
||||
Dieses Projekt basiert auf Kooperation, daher benötigen wir Ihre Hilfe, um
|
||||
es wachsen zu lassen! Bitte kontaktieren Sie uns auf
|
||||
@email{guix-devel@@gnu.org} und @code{#guix} im Freenode-IRC-Netzwerk. Wir
|
||||
freuen uns auf Ihre Ideen, Fehlerberichte, Patches und alles, was hilfreich
|
||||
für das Projekt sein könnte. Besonders willkommen ist Hilfe bei der
|
||||
Erstellung von Paketen (@pxref{Paketrichtlinien}).
|
||||
|
||||
@cindex Verhaltensregeln, für Mitwirkende
|
||||
@cindex Verhaltenskodex für Mitwirkende
|
||||
Wir möchten eine angenehme, freundliche und von Belästigungen freie Umgebung
|
||||
bereitstellen, so dass jeder Beiträge nach seinen Fähigkeiten leisten
|
||||
kann. Zu diesem Zweck verwendet unser Projekt einen »Verhaltenskodex für
|
||||
Mitwirkende«, der von @url{http://contributor-covenant.org/} übernommen
|
||||
wurde. Eine übersetzte Fassung finden Sie auf
|
||||
@url{https://www.contributor-covenant.org/de/version/1/4/code-of-conduct}
|
||||
sowie eine mitgelieferte, englische Fassung in der Datei
|
||||
@file{CODE-OF-CONDUCT} im Quellbaum.
|
||||
|
||||
Von Mitwirkenden wird nicht erwartet, dass sie in Patches oder in der
|
||||
Online-Kommunikation ihre echten Namen preisgeben. Sie können einen
|
||||
beliebigen Namen oder ein Pseudonym ihrer Wahl verwenden.
|
||||
|
||||
@menu
|
||||
* Erstellung aus dem Git:: Das Neueste und Beste.
|
||||
* Guix vor der Installation ausführen:: Hacker-Tricks.
|
||||
* Perfekt eingerichtet:: Die richtigen Werkzeuge.
|
||||
* Code-Stil:: Wie Mitwirkende hygienisch arbeiten.
|
||||
* Einreichen von Patches:: Teilen Sie Ihre Arbeit.
|
||||
@end menu
|
||||
|
||||
@node Erstellung aus dem Git
|
||||
@section Erstellung aus dem Git
|
||||
|
||||
Wenn Sie an Guix selbst hacken wollen, ist es empfehlenswert, dass Sie die
|
||||
neueste Version aus dem Git-Softwarebestand verwenden:
|
||||
|
||||
@example
|
||||
git clone https://git.savannah.gnu.org/git/guix.git
|
||||
@end example
|
||||
|
||||
Wenn Sie Guix aus einem Checkout erstellen, sind außer den bereits in den
|
||||
Installationsanweisungen genannten Paketen weitere nötig
|
||||
(@pxref{Voraussetzungen}).
|
||||
|
||||
@itemize
|
||||
@item @url{http://gnu.org/software/autoconf/, GNU Autoconf};
|
||||
@item @url{http://gnu.org/software/automake/, GNU Automake};
|
||||
@item @url{http://gnu.org/software/gettext/, GNU Gettext};
|
||||
@item @url{http://gnu.org/software/texinfo/, GNU Texinfo};
|
||||
@item @url{http://www.graphviz.org/, Graphviz};
|
||||
@item @url{http://www.gnu.org/software/help2man/, GNU Help2man (optional)}.
|
||||
@end itemize
|
||||
|
||||
Der einfachste Weg, eine Entwicklungsumgebung für Guix einzurichten, ist
|
||||
natürlich, Guix zu benutzen! Der folgende Befehl startet eine neue Shell, in
|
||||
der alle Abhängigkeiten und Umgebungsvariablen bereits eingerichtet sind, um
|
||||
an Guix zu arbeiten:
|
||||
|
||||
@example
|
||||
guix environment guix
|
||||
@end example
|
||||
|
||||
In @xref{Aufruf von guix environment} finden Sie weitere Informationen zu
|
||||
diesem Befehl. Zusätzliche Abhängigkeiten können mit @option{--ad-hoc}
|
||||
hinzugefügt werden:
|
||||
|
||||
@example
|
||||
guix environment guix --ad-hoc help2man git strace
|
||||
@end example
|
||||
|
||||
Führen Sie @command{./bootstrap} aus, um die Infrastruktur des
|
||||
Erstellungssystems mit Autoconf und Automake zu erstellen. Möglicherweise
|
||||
erhalten Sie eine Fehlermeldung wie diese:
|
||||
|
||||
@example
|
||||
configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Das bedeutet wahrscheinlich, dass Autoconf @file{pkg.m4} nicht finden
|
||||
konnte, welches von pkg-config bereitgestellt wird. Stellen Sie sicher, dass
|
||||
@file{pkg.m4} verfügbar ist. Gleiches gilt für den von Guile
|
||||
bereitgestellten Makrosatz @file{guile.m4}. Wenn Sie beispielsweise Automake
|
||||
in @file{/usr/local} installiert haben, würde in @file{/usr/share} nicht
|
||||
nach @file{.m4}-Dateien geschaut. In einem solchen Fall müssen Sie folgenden
|
||||
Befehl aufrufen:
|
||||
|
||||
@example
|
||||
export ACLOCAL_PATH=/usr/share/aclocal
|
||||
@end example
|
||||
|
||||
In @xref{Macro Search Path,,, automake, The GNU Automake Manual} finden Sie
|
||||
weitere Informationen.
|
||||
|
||||
Dann führen Sie wie gewohnt @command{./configure} aus. Achten Sie darauf,
|
||||
@code{--localstatedir=@var{Verzeichnis}} zu übergeben, wobei
|
||||
@var{Verzeichnis} der von Ihrer aktuellen Installation verwendete
|
||||
@code{localstatedir}-Wert ist (weitere Informationen auf @pxref{Der Store}).
|
||||
|
||||
Zum Schluss müssen Sie @code{make check} aufrufen, um die Tests auszuführen
|
||||
(@pxref{Die Testsuite laufen lassen}). Falls etwas fehlschlägt, werfen Sie einen
|
||||
Blick auf die Installationsanweisungen (@pxref{Installation}) oder senden
|
||||
Sie eine E-Mail an die @email{guix-devel@@gnu.org, Mailingliste}.
|
||||
|
||||
|
||||
@node Guix vor der Installation ausführen
|
||||
@section Guix vor der Installation ausführen
|
||||
|
||||
Um eine gesunde Arbeitsumgebung zu erhalten, ist es hilfreich, die im
|
||||
lokalen Quellbaum vorgenommenen Änderungen zunächst zu testen, ohne sie
|
||||
tatsächlich zu installieren. So können Sie zwischen Ihrem
|
||||
Endnutzer-»Straßenanzug« und Ihrem »Faschingskostüm« unterscheiden.
|
||||
|
||||
To that end, all the command-line tools can be used even if you have not run
|
||||
@code{make install}. To do that, you first need to have an environment with
|
||||
all the dependencies available (@pxref{Erstellung aus dem Git}), and then simply
|
||||
prefix each command with @command{./pre-inst-env} (the @file{pre-inst-env}
|
||||
script lives in the top build tree of Guix; it is generated by
|
||||
@command{./configure}), as in@footnote{The @option{-E} flag to
|
||||
@command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set such
|
||||
that @command{guix-daemon} and the tools it uses can find the Guile modules
|
||||
they need.}:
|
||||
|
||||
@example
|
||||
$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
|
||||
$ ./pre-inst-env guix build hello
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Entsprechend, um eine Guile-Sitzung zu öffnen, die die Guix-Module benutzt:
|
||||
|
||||
@example
|
||||
$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'
|
||||
|
||||
;;; ("x86_64-linux")
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
@cindex REPL
|
||||
@cindex Lese-Auswerten-Schreiben-Schleife
|
||||
@dots{} und auf einer REPL (@pxref{Using Guile Interactively,,, guile, Guile
|
||||
Reference Manual}):
|
||||
|
||||
@example
|
||||
$ ./pre-inst-env guile
|
||||
scheme@@(guile-user)> ,use(guix)
|
||||
scheme@@(guile-user)> ,use(gnu)
|
||||
scheme@@(guile-user)> (define snakes
|
||||
(fold-packages
|
||||
(lambda (package lst)
|
||||
(if (string-prefix? "python"
|
||||
(package-name package))
|
||||
(cons package lst)
|
||||
lst))
|
||||
'()))
|
||||
scheme@@(guile-user)> (length snakes)
|
||||
$1 = 361
|
||||
@end example
|
||||
|
||||
Das @command{pre-inst-env}-Skript richtet alle Umgebungsvariablen ein, die
|
||||
nötig sind, um dies zu ermöglichen, einschließlich @env{PATH} und
|
||||
@env{GUILE_LOAD_PATH}.
|
||||
|
||||
Note that @command{./pre-inst-env guix pull} does @emph{not} upgrade the
|
||||
local source tree; it simply updates the @file{~/.config/guix/current}
|
||||
symlink (@pxref{Aufruf von guix pull}). Run @command{git pull} instead if you
|
||||
want to upgrade your local source tree.
|
||||
|
||||
|
||||
@node Perfekt eingerichtet
|
||||
@section Perfekt eingerichtet
|
||||
|
||||
Um perfekt für das Hacken an Guix eingerichtet zu sein, brauchen Sie an sich
|
||||
dasselbe wie um perfekt für das Hacken mit Guile (@pxref{Using Guile in
|
||||
Emacs,,, guile, Guile Reference Manual}). Zunächst brauchen Sie mehr als
|
||||
ein Textverarbeitungsprogramm, Sie brauchen
|
||||
@url{http://www.gnu.org/software/emacs, Emacs}, ermächtigt vom wunderbaren
|
||||
@url{http://nongnu.org/geiser/, Geiser}.
|
||||
|
||||
Geiser ermöglicht interaktive und inkrementelle Entwicklung aus Emacs
|
||||
heraus: Code kann in Puffern kompiliert und ausgewertet werden. Zugang zu
|
||||
Online-Dokumentation (Docstrings) steht ebenso zur Verfügung wie
|
||||
kontextabhängige Vervollständigung, @kbd{M-.} um zu einer Objektdefinition
|
||||
zu springen, eine REPL, um Ihren Code auszuprobieren, und mehr
|
||||
(@pxref{Einführung,,, geiser, Geiser User Manual}). Zur bequemen
|
||||
Guix-Entwicklung sollten Sie Guiles Ladepfad so ergänzen, dass die
|
||||
Quelldateien in Ihrem Checkout gefunden werden.
|
||||
|
||||
@lisp
|
||||
;; @r{Angenommen das Guix-Checkout ist in ~/src/guix.}
|
||||
(with-eval-after-load 'geiser-guile
|
||||
(add-to-list 'geiser-guile-load-path "~/src/guix"))
|
||||
@end lisp
|
||||
|
||||
Um den Code tatsächlich zu bearbeiten, bietet Emacs schon einen netten
|
||||
Scheme-Modus. Aber Sie dürfen auch
|
||||
@url{http://www.emacswiki.org/emacs/ParEdit, Paredit} nicht verpassen. Es
|
||||
bietet Hilfsmittel, um direkt mit dem Syntaxbaum zu arbeiten, und kann so
|
||||
zum Beispiel einen S-Ausdruck hochheben oder ihn umhüllen, ihn verschlucken
|
||||
oder den nachfolgenden S-Ausdruck verwerfen, etc.
|
||||
|
||||
@cindex Code-Schnipsel
|
||||
@cindex Vorlagen
|
||||
@cindex Tipparbeit sparen
|
||||
Wir bieten auch Vorlagen für häufige Git-Commit-Nachrichten und
|
||||
Paketdefinitionen im Verzeichnis @file{etc/snippets}. Diese Vorlagen können
|
||||
mit @url{http://joaotavora.github.io/yasnippet/, YASnippet} zusammen benutzt
|
||||
werden, um kurze Auslöse-Zeichenketten zu interaktiven Textschnipseln
|
||||
umzuschreiben. Vielleicht möchten Sie das Schnipselverzeichnis zu Ihrer
|
||||
@var{yas-snippet-dirs}-Variablen in Emacs hinzufügen.
|
||||
|
||||
@lisp
|
||||
;; @r{Angenommen das Guix-Checkout ist in ~/src/guix.}
|
||||
(with-eval-after-load 'yasnippet
|
||||
(add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
|
||||
@end lisp
|
||||
|
||||
The commit message snippets depend on @url{https://magit.vc/, Magit} to
|
||||
display staged files. When editing a commit message type @code{add}
|
||||
followed by @kbd{TAB} to insert a commit message template for adding a
|
||||
package; type @code{update} followed by @kbd{TAB} to insert a template for
|
||||
updating a package; type @code{https} followed by @kbd{TAB} to insert a
|
||||
template for changing the home page URI of a package to HTTPS.
|
||||
|
||||
Das Hauptschnipsel für @code{scheme-mode} wird ausgelöst, indem Sie
|
||||
@code{package...} gefolgt von @kbd{TAB} eintippen. Dieses Snippet fügt auch
|
||||
die Auslöse-Zeichenkette @code{origin...} ein, die danach weiter
|
||||
umgeschrieben werden kann. Das @code{origin}-Schnipsel kann wiederum andere
|
||||
Auslöse-Zeichenketten einfügen, die alle auf @code{...} enden, was selbst
|
||||
wieder weiter umgeschrieben werden kann.
|
||||
|
||||
|
||||
@node Code-Stil
|
||||
@section Code-Stil
|
||||
|
||||
Im Allgemeinen folgt unser Code den GNU Coding Standards (@pxref{Top,,,
|
||||
standards, GNU Coding Standards}). Da diese aber nicht viel über Scheme zu
|
||||
sagen haben, folgen hier einige zusätzliche Regeln.
|
||||
|
||||
@menu
|
||||
* Programmierparadigmen:: Wie Sie Ihre Elemente zusammenstellen.
|
||||
* Module:: Wo Sie Ihren Code unterbringen.
|
||||
* Datentypen und Mustervergleich:: Implementierung von Datenstrukturen.
|
||||
* Formatierung von Code:: Schreibkonventionen.
|
||||
@end menu
|
||||
|
||||
@node Programmierparadigmen
|
||||
@subsection Programmierparadigmen
|
||||
|
||||
Scheme-Code wird in Guix auf rein funktionale Weise geschrieben. Eine
|
||||
Ausnahme ist Code, der mit Ein- und Ausgabe zu tun hat, und Prozeduren, die
|
||||
grundlegende Konzepte implementieren, wie zum Beispiel die Prozedur
|
||||
@code{memoize}.
|
||||
|
||||
@node Module
|
||||
@subsection Module
|
||||
|
||||
Guile-Module, die beim Erstellen nutzbar sein sollen, müssen im Namensraum
|
||||
@code{(guix build @dots{})} leben. Sie dürfen auf keine anderen Guix- oder
|
||||
GNU-Module Bezug nehmen. Jedoch ist es in Ordnung, wenn ein »wirtsseitiges«
|
||||
Modul ein erstellungsseitiges Modul benutzt.
|
||||
|
||||
Module, die mit dem weiteren GNU-System zu tun haben, sollten im Namensraum
|
||||
@code{(gnu @dots{})} und nicht in @code{(guix @dots{})} stehen.
|
||||
|
||||
@node Datentypen und Mustervergleich
|
||||
@subsection Datentypen und Mustervergleich
|
||||
|
||||
Im klassischen Lisp gibt es die Tendenz, Listen zur Darstellung von allem zu
|
||||
benutzen, und diese dann »händisch« zu durchlaufen mit @code{car},
|
||||
@code{cdr}, @code{cadr} und so weiter. Dieser Stil ist aus verschiedenen
|
||||
Gründen problematisch, insbesondere wegen der Tatsache, dass er schwer zu
|
||||
lesen, schnell fehlerbehaftet und ein Hindernis beim Melden von Typfehlern
|
||||
ist.
|
||||
|
||||
Guix-Code sollte angemessene Datentypen definieren (zum Beispiel mit
|
||||
@code{define-record-type*}) statt Listen zu missbrauchen. Außerdem sollte er
|
||||
das @code{(ice-9 match)}-Modul von Guile zum Mustervergleich benutzen,
|
||||
besonders mit Listen.
|
||||
|
||||
@node Formatierung von Code
|
||||
@subsection Formatierung von Code
|
||||
|
||||
@cindex Formatierung von Code
|
||||
@cindex Code-Stil
|
||||
Beim Schreiben von Scheme-Code halten wir uns an die üblichen
|
||||
Gepflogenheiten unter Scheme-Programmierern. Im Allgemeinen bedeutet das,
|
||||
dass wir uns an @url{http://mumble.net/~campbell/scheme/style.txt,
|
||||
Riastradh's Lisp Style Rules} halten. Es hat sich ergeben, dass dieses
|
||||
Dokument auch die Konventionen beschreibt, die im Code von Guile
|
||||
hauptsächlich verwendet werden. Es ist gut durchdacht und schön geschrieben,
|
||||
also lesen Sie es bitte.
|
||||
|
||||
Ein paar in Guix eingeführte Sonderformen, wie zum Beispiel das
|
||||
@code{substitute*}-Makro, haben abweichende Regeln für die Einrückung. Diese
|
||||
sind in der Datei @file{.dir-locals.el} definiert, die Emacs automatisch
|
||||
benutzt. Beachten Sie auch, dass Emacs-Guix einen Modus namens
|
||||
@code{guix-devel-mode} bereitstellt, der Guix-Code richtig einrückt und
|
||||
hervorhebt (@pxref{Development,,, emacs-guix, The Emacs-Guix Reference
|
||||
Manual}).
|
||||
|
||||
@cindex Einrückung, Code-
|
||||
@cindex Formatierung, Code-
|
||||
Falls Sie nicht Emacs verwenden, sollten Sie sicherstellen, dass Ihr Editor
|
||||
diese Regeln kennt. Um eine Paketdefinition automatisch einzurücken, können
|
||||
Sie auch Folgendes ausführen:
|
||||
|
||||
@example
|
||||
./etc/indent-code.el gnu/packages/@var{Datei}.scm @var{Paket}
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Dadurch wird die Definition von @var{Paket} in
|
||||
@file{gnu/packages/@var{Datei}.scm} automatisch eingerückt, indem Emacs im
|
||||
Batch-Modus läuft. Um die Einrückung in einer gesamten Datei vorzunehmen,
|
||||
lassen Sie das zweite Argument weg:
|
||||
|
||||
@example
|
||||
./etc/indent-code.el gnu/services/@var{Datei}.scm
|
||||
@end example
|
||||
|
||||
@cindex Vim, zum Editieren von Scheme-Code
|
||||
Wenn Sie Code mit Vim bearbeiten, empfehlen wir, dass Sie @code{:set
|
||||
autoindent} ausführen, damit Ihr Code automatisch eingerückt wird, während
|
||||
Sie ihn schreiben. Außerdem könnte Ihnen
|
||||
@uref{https://www.vim.org/scripts/script.php?script_id=3998,
|
||||
@code{paredit.vim}} dabei helfen, mit all diesen Klammern fertigzuwerden.
|
||||
|
||||
Wir fordern von allen Prozeduren auf oberster Ebene, dass sie über einen
|
||||
Docstring verfügen. Diese Voraussetzung kann jedoch bei einfachen, privaten
|
||||
Prozeduren im Namensraum @code{(guix build @dots{})} aufgeweicht werden.
|
||||
|
||||
Prozeduren sollten nicht mehr als vier positionsbestimmte Parameter
|
||||
haben. Benutzen Sie Schlüsselwort-Parameter für Prozeduren, die mehr als
|
||||
vier Parameter entgegennehmen.
|
||||
|
||||
|
||||
@node Einreichen von Patches
|
||||
@section Einreichen von Patches
|
||||
|
||||
Die Entwicklung wird mit Hilfe des verteilten Versionskontrollsystems Git
|
||||
durchgeführt. Daher ist eine ständige Verbindung zum Repository nicht
|
||||
unbedingt erforderlich. Wir begrüßen Beiträge in Form von Patches, die
|
||||
mittels @code{git format-patch} erstellt und an die Mailingliste
|
||||
@email{guix-patches@@gnu.org} geschickt werden.
|
||||
|
||||
Diese Mailing-Liste setzt auf einer Debbugs-Instanz auf, die zugänglich ist
|
||||
unter @uref{https://bugs.gnu.org/guix-patches}, wodurch wir den Überblick
|
||||
über Eingereichtes behalten können. Jede an diese Mailing-Liste gesendete
|
||||
Nachricht bekommt eine neue Folgenummer zugewiesen, so dass man eine
|
||||
Folge-Email zur Einreichung an @code{@var{NNN}@@debbugs.gnu.org} senden
|
||||
kann, wobei @var{NNN} für die Folgenummer steht (@pxref{Senden einer Patch-Reihe}).
|
||||
|
||||
Bitte schreiben Sie Commit-Logs im ChangeLog-Format (@pxref{Change Logs,,,
|
||||
standards, GNU Coding Standards}); dazu finden Sie Beispiele unter den
|
||||
bisherigen Commits.
|
||||
|
||||
Bevor Sie einen Patch einreichen, der eine Paketdefinition hinzufügt oder
|
||||
verändert, gehen Sie bitte diese Prüfliste durch:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Wenn die Autoren der verpackten Software eine kryptographische Signatur für
|
||||
den Tarball der Veröffentlichung anbieten, so machen Sie sich bitte die
|
||||
Mühe, die Echtheit des Archivs zu überprüfen. Für eine abgetrennte
|
||||
GPG-Signaturdatei würden Sie das mit dem Befehl @code{gpg --verify} tun.
|
||||
|
||||
@item
|
||||
Nehmen Sie sich die Zeit, eine passende Zusammenfassung und Beschreibung für
|
||||
das Paket zu verfassen. Unter @xref{Zusammenfassungen und Beschreibungen} finden Sie
|
||||
dazu einige Richtlinien.
|
||||
|
||||
@item
|
||||
Verwenden Sie @code{guix lint @var{Paket}}, wobei @var{Paket} das neue oder
|
||||
geänderte Paket bezeichnet, und beheben Sie alle gemeldeten Fehler
|
||||
(@pxref{Aufruf von guix lint}).
|
||||
|
||||
@item
|
||||
Stellen Sie sicher, dass das Paket auf Ihrer Plattform erstellt werden kann,
|
||||
indem Sie @code{guix build @var{Paket}} ausführen.
|
||||
|
||||
@item
|
||||
@cindex gebündelt
|
||||
Achten Sie darauf, dass im Paket keine Software gebündelt mitgeliefert wird,
|
||||
die bereits in separaten Paketen zur Verfügung steht.
|
||||
|
||||
Manchmal enthalten Pakete Kopien des Quellcodes ihrer Abhängigkeiten, um
|
||||
Nutzern die Installation zu erleichtern. Als eine Distribution wollen wir
|
||||
jedoch sicherstellen, dass solche Pakete die schon in der Distribution
|
||||
verfügbare Fassung benutzen, sofern es eine gibt. Dadurch wird sowohl der
|
||||
Ressourcenverbrauch optimiert (die Abhängigkeit wird so nur einmal erstellt
|
||||
und gespeichert) als auch der Distribution die Möglichkeit gegeben,
|
||||
ergänzende Änderungen durchzuführen, um beispielsweise
|
||||
Sicherheitsaktualisierungen für ein bestimmtes Paket an nur einem Ort
|
||||
einzuspielen, die aber das gesamte System betreffen — gebündelt
|
||||
mitgelieferte Kopien würden dies verhindern.
|
||||
|
||||
@item
|
||||
Schauen Sie sich das von @command{guix size} ausgegebene Profil an
|
||||
(@pxref{Aufruf von guix size}). Dadurch können Sie Referenzen auf andere
|
||||
Pakete finden, die ungewollt vorhanden sind. Dies kann auch dabei helfen, zu
|
||||
entscheiden, ob das Paket aufgespalten werden sollte (@pxref{Pakete mit mehreren Ausgaben.}) und welche optionalen Abhängigkeiten verwendet werden
|
||||
sollten.
|
||||
|
||||
@item
|
||||
Achten Sie bei wichtigen Änderungen darauf, dass abhängige Pakete (falls
|
||||
vorhanden) nicht von der Änderung beeinträchtigt werden; @code{guix refresh
|
||||
--list-dependent @var{Paket}} hilft Ihnen dabei (@pxref{Aufruf von guix refresh}).
|
||||
|
||||
@c ===========================================================================
|
||||
@c
|
||||
@c This file was generated with po4a. Translate the source file.
|
||||
@c
|
||||
@c ===========================================================================
|
||||
@c See <https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00933.html>.
|
||||
@cindex Branching-Strategie
|
||||
@cindex Neuerstellungs-Zeitplan
|
||||
Je nachdem, wieviele abhängige Pakete es gibt, und entsprechend wieviele
|
||||
Neuerstellungen dadurch nötig würden, finden Commits auf anderen Branches
|
||||
statt, nach ungefähr diesen Regeln:
|
||||
|
||||
@table @asis
|
||||
@item 300 abhängige Pakete oder weniger
|
||||
@code{master}-Branch (störfreie Änderungen).
|
||||
|
||||
@item zwischen 300 und 1200 abhängige Pakete
|
||||
@code{staging}-Branch (störfreie Änderungen). Dieser Branch wird circa alle
|
||||
3 Wochen in @code{master} gemerget. Themenbezogene Änderungen (z.B. eine
|
||||
Aktualisierung der GNOME-Plattform) können stattdessen auch auf einem
|
||||
eigenen Branch umgesetzt werden (wie @code{gnome-updates}).
|
||||
|
||||
@item mehr als 1200 abhängige Pakete
|
||||
@code{core-updates}-Branch (kann auch größere und womöglich andere Software
|
||||
beeinträchtigende Änderungen umfassen). Dieser Branch wird planmäßig in
|
||||
@code{master} alle 2,5 Monate oder so gemerget.
|
||||
@end table
|
||||
|
||||
All these branches are @uref{https://hydra.gnu.org/project/gnu, tracked by
|
||||
our build farm} and merged into @code{master} once everything has been
|
||||
successfully built. This allows us to fix issues before they hit users, and
|
||||
to reduce the window during which pre-built binaries are not available.
|
||||
|
||||
@c TODO: It would be good with badges on the website that tracks these
|
||||
@c branches. Or maybe even a status page.
|
||||
Generally, branches other than @code{master} are considered @emph{frozen} if
|
||||
there has been a recent evaluation, or there is a corresponding @code{-next}
|
||||
branch. Please ask on the mailing list or IRC if unsure where to place a
|
||||
patch.
|
||||
|
||||
@item
|
||||
@cindex Determinismus, von Erstellungsprozessen
|
||||
@cindex Reproduzierbare Erstellungen, Überprüfung
|
||||
Überprüfen Sie, ob der Erstellungsprozess deterministisch ist. Dazu prüfen
|
||||
Sie typischerweise, ob eine unabhängige Erstellung des Pakets genau dasselbe
|
||||
Ergebnis wie Ihre Erstellung hat, Bit für Bit.
|
||||
|
||||
Dies können Sie leicht tun, indem Sie dasselbe Paket mehrere Male
|
||||
hintereinander auf Ihrer Maschine erstellen (@pxref{Aufruf von guix build}):
|
||||
|
||||
@example
|
||||
guix build --rounds=2 mein-paket
|
||||
@end example
|
||||
|
||||
Dies reicht aus, um eine ganze Klasse häufiger Ursachen von
|
||||
Nichtdeterminismus zu finden, wie zum Beispiel Zeitstempel oder
|
||||
zufallsgenerierte Ausgaben im Ergebnis der Erstellung.
|
||||
|
||||
Eine weitere Möglichkeit ist, @command{guix challenge} (@pxref{Aufruf von guix challenge}) zu benutzen. Sie können es ausführen, sobald ein Paket commitet
|
||||
und von @code{hydra.gnu.org} erstellt wurde, um zu sehen, ob dort dasselbe
|
||||
Ergebnis wie bei Ihnen geliefert wurde. Noch besser: Finden Sie eine andere
|
||||
Maschine, die das Paket erstellen kann, und führen Sie @command{guix
|
||||
publish} aus. Da sich die entfernte Erstellungsmaschine wahrscheinlich von
|
||||
Ihrer unterscheidet, können Sie auf diese Weise Probleme durch
|
||||
Nichtdeterminismus erkennen, die mit der Hardware zu tun haben — zum
|
||||
Beispiel die Nutzung anderer Befehlssatzerweiterungen — oder mit dem
|
||||
Betriebssystem-Kernel — zum Beispiel, indem @code{uname} oder
|
||||
@file{/proc}-Dateien verwendet werden.
|
||||
|
||||
@item
|
||||
Beim Schreiben von Dokumentation achten Sie bitte auf eine
|
||||
geschlechtsneutrale Wortwahl, wenn Sie sich auf Personen beziehen, wie
|
||||
@uref{https://en.wikipedia.org/wiki/Singular_they, »they«@comma{}
|
||||
»their«@comma{} »them« im Singular}, und so weiter.
|
||||
|
||||
@item
|
||||
Stelllen Sie sicher, dass Ihr Patch nur einen Satz zusammengehöriger
|
||||
Änderungen umfasst. Das Zusammenfassen nicht zusammengehöriger Änderungen
|
||||
erschwert und bremst das Durchsehen Ihres Patches.
|
||||
|
||||
Beispiele für nicht zusammengehörige Änderungen sind das Hinzufügen mehrerer
|
||||
Pakete auf einmal, oder das Aktualisieren eines Pakets auf eine neue Version
|
||||
zusammen mit Fehlerbehebungen für das Paket.
|
||||
|
||||
@item
|
||||
Bitte befolgen Sie unsere Richtlinien für die Code-Formatierung, womöglich
|
||||
wollen Sie dies automatisch tun lassen durch das Skript
|
||||
@command{etc/indent-code.el} (@pxref{Formatierung von Code}).
|
||||
|
||||
@item
|
||||
When possible, use mirrors in the source URL (@pxref{Aufruf von guix download}). Use reliable URLs, not generated ones. For instance, GitHub
|
||||
archives are not necessarily identical from one generation to the next, so
|
||||
in this case it's often better to clone the repository. Don't use the
|
||||
@command{name} field in the URL: it is not very useful and if the name
|
||||
changes, the URL will probably be wrong.
|
||||
|
||||
@end enumerate
|
||||
|
||||
Bitte benutzen Sie @samp{[PATCH] @dots{}} als Betreff, wenn Sie einen Patch
|
||||
an die Mailing-Liste schicken. Sie können dazu Ihr E-Mail-Programm oder den
|
||||
Befehl @command{git send-email} benutzen (@pxref{Senden einer Patch-Reihe}). Wir bevorzugen es, Patches als reine Textnachrichten zu erhalten,
|
||||
entweder eingebettet (inline) oder als MIME-Anhänge. Sie sind dazu
|
||||
angehalten, zu überprüfen, ob Ihr Mail-Programm solche Dinge wie
|
||||
Zeilenumbrüche oder die Einrückung verändert, wodurch die Patches womöglich
|
||||
nicht mehr funktionieren.
|
||||
|
||||
Wenn dadurch ein Fehler behoben wurde, schließen Sie bitte den Thread, indem
|
||||
Sie eine E-Mail an @email{@var{NNN}-done@@debbugs.gnu.org} senden.
|
||||
|
||||
@unnumberedsubsec Senden einer Patch-Reihe
|
||||
@anchor{Senden einer Patch-Reihe}
|
||||
@cindex Patch-Reihe
|
||||
@cindex @code{git send-email}
|
||||
@cindex @code{git-send-email}
|
||||
|
||||
@c Debbugs bug: https://debbugs.gnu.org/db/15/15361.html
|
||||
Wenn Sie eine Patch-Reihe senden (z.B. mit @code{git send-email}), schicken
|
||||
Sie bitte als Erstes eine Nachricht an @email{guix-patches@@gnu.org} und
|
||||
dann nachfolgende Patches an @email{@var{NNN}@@debbugs.gnu.org}, um
|
||||
sicherzustellen, dass sie zusammen bearbeitet werden. Siehe
|
||||
@uref{https://debbugs.gnu.org/Advanced.html, die Debbugs-Dokumentation} für
|
||||
weitere Informationen.
|
||||
@@ -1,524 +0,0 @@
|
||||
@node Contribuer
|
||||
@chapter Contribuer
|
||||
|
||||
Ce projet est un effort coopératif et nous avons besoin de votre aide pour
|
||||
le faire grandir ! Contactez-nous sur @email{guix-devel@@gnu.org} et
|
||||
@code{#guix} sur le réseau IRC Freenode. Nous accueillons les idées, les
|
||||
rapports de bogues, les correctifs et tout ce qui pourrait aider le projet.
|
||||
Nous apprécions particulièrement toute aide sur la création de paquets
|
||||
(@pxref{Consignes d'empaquetage}).
|
||||
|
||||
@cindex code de conduite, des contributeurs
|
||||
@cindex convention de contribution
|
||||
Nous souhaitons fournir un environnement chaleureux, amical et sans
|
||||
harcèlement pour que tout le monde puisse contribuer au mieux de ses
|
||||
capacités. Pour cela notre projet a une « Convention de contribution »
|
||||
adaptée de @url{http://contributor-covenant.org/}. Vous pouvez trouver une
|
||||
version locale dans le fichier @file{CODE-OF-CONDUCT} dans l'arborescence
|
||||
des sources.
|
||||
|
||||
Les contributeurs n'ont pas besoin d'utiliser leur nom légal dans leurs
|
||||
correctifs et leurs communications en ligne ; ils peuvent utiliser n'importe
|
||||
quel nom ou pseudonyme de leur choix.
|
||||
|
||||
@menu
|
||||
* Construire depuis Git:: toujours le plus récent.
|
||||
* Lancer Guix avant qu'il ne soit installé:: Astuces pour les hackers.
|
||||
* La configuration parfaite:: Les bons outils.
|
||||
* Style de code:: Hygiène du contributeur.
|
||||
* Envoyer des correctifs:: Partager votre travail.
|
||||
@end menu
|
||||
|
||||
@node Construire depuis Git
|
||||
@section Construire depuis Git
|
||||
|
||||
Si vous souhaitez travailler sur Guix lui-même, il est recommandé d'utiliser
|
||||
la dernière version du dépôt Git :
|
||||
|
||||
@example
|
||||
git clone https://git.savannah.gnu.org/git/guix.git
|
||||
@end example
|
||||
|
||||
Lors de la construction de Guix depuis un extrait, les paquets suivants sont
|
||||
requis en plus de ceux mentionnés dans les instructions d'installation
|
||||
(@pxref{Prérequis}).
|
||||
|
||||
@itemize
|
||||
@item @url{http://gnu.org/software/autoconf/, GNU Autoconf};
|
||||
@item @url{http://gnu.org/software/automake/, GNU Automake};
|
||||
@item @url{http://gnu.org/software/gettext/, GNU Gettext};
|
||||
@item @url{http://gnu.org/software/texinfo/, GNU Texinfo};
|
||||
@item @url{http://www.graphviz.org/, Graphviz};
|
||||
@item @url{http://www.gnu.org/software/help2man/, GNU Help2man (facultatif)}.
|
||||
@end itemize
|
||||
|
||||
La manière la plus simple de configurer un environnement de développement
|
||||
pour Guix est, bien sûr, d'utiliser Guix ! La commande suivante démarre un
|
||||
nouveau shell où toutes les dépendances et les variables d'environnements
|
||||
appropriées sont configurés pour travailler sur Guix :
|
||||
|
||||
@example
|
||||
guix environment guix
|
||||
@end example
|
||||
|
||||
@xref{Invoquer guix environment}, pour plus d'information sur cette
|
||||
commande. On peut ajouter des dépendances supplémentaires avec
|
||||
@option{--ad-hoc} :
|
||||
|
||||
@example
|
||||
guix environment guix --ad-hoc help2man git strace
|
||||
@end example
|
||||
|
||||
Lancez @command{./bootstrap} pour générer l'infrastructure du système de
|
||||
construction avec Autoconf et Automake. Si vous avez une erreur comme :
|
||||
|
||||
@example
|
||||
configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
cela signifie probablement qu'Autoconf n'a pas pu trouver @file{pkg.m4} qui
|
||||
est fournit par pkg-config. Assurez-vous que @file{pkg.m4} est disponible.
|
||||
C'est aussi vrai pour l'ensemble de macros de @file{guile.m4} fournies par
|
||||
Guile. Par exemple, si vous avez installé Automake dans @file{/usr/local},
|
||||
il ne cherchera pas les fichiers @file{.m4} dans @file{/usr/share}. Dans ce
|
||||
case vous devez invoquer la commande suivante :
|
||||
|
||||
@example
|
||||
export ACLOCAL_PATH=/usr/share/aclocal
|
||||
@end example
|
||||
|
||||
@xref{Macro Search Path,,, automake, The GNU Automake Manual}, pour plus
|
||||
d'information.
|
||||
|
||||
Ensuite, lancez @command{./configure} comme d'habitude. Assurez-vous de
|
||||
passer @code{--localstatedir=@var{directory}} où @var{directory} est la
|
||||
valeur @code{localstatedir} utilisée par votre installation actuelle
|
||||
(@pxref{Le dépôt} pour plus d'informations à ce propos).
|
||||
|
||||
Finalement, vous devez invoquer @code{make check} pour lancer les tests
|
||||
(@pxref{Lancer la suite de tests}). Si quelque chose échoue, jetez un œil
|
||||
aux instructions d'installation (@pxref{Installation}) ou envoyez un message
|
||||
à la list @email{guix-devel@@gnu.org}.
|
||||
|
||||
|
||||
@node Lancer Guix avant qu'il ne soit installé
|
||||
@section Lancer Guix avant qu'il ne soit installé
|
||||
|
||||
Pour garder un environnement de travail sain, il est utile de tester les
|
||||
changement localement sans les installer pour de vrai. Pour pouvoir
|
||||
distinguer votre rôle « d'utilisateur final » de celui parfois haut en
|
||||
couleur de « développeur ».
|
||||
|
||||
Pour cela, tous les outils en ligne de commande sont utilisables même sans
|
||||
avoir lancé @code{make install}. Pour cela, vous devez d'abord avoir un
|
||||
environnement avec toutes les dépendances disponibles (@pxref{Construire depuis Git}), puis préfixer chaque commande par @command{./pre-inst-env} (le script
|
||||
@file{pre-inst-env} se trouve dans le répertoire de plus haut niveau de
|
||||
l'arborescence des sources de Guix ; il est généré par
|
||||
@command{./configure}) comme cela@footnote{L'option @option{-E} de
|
||||
@command{sudo} garantie que @code{GUILE_LOAD_PATH} est bien paramétré pour
|
||||
@command{guix-daemon} et pour que les outils qu'il utilise puissent trouver
|
||||
les modules Guile dont ils ont besoin.} :
|
||||
|
||||
@example
|
||||
$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
|
||||
$ ./pre-inst-env guix build hello
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
De même, pour une session Guile qui utilise les modules Guix :
|
||||
|
||||
@example
|
||||
$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'
|
||||
|
||||
;;; ("x86_64-linux")
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
@cindex REPL
|
||||
@cindex read-eval-print loop
|
||||
@dots{} et pour un REPL (@pxref{Using Guile Interactively,,, guile, Guile
|
||||
Reference Manual})
|
||||
|
||||
@example
|
||||
$ ./pre-inst-env guile
|
||||
scheme@@(guile-user)> ,use(guix)
|
||||
scheme@@(guile-user)> ,use(gnu)
|
||||
scheme@@(guile-user)> (define snakes
|
||||
(fold-packages
|
||||
(lambda (package lst)
|
||||
(if (string-prefix? "python"
|
||||
(package-name package))
|
||||
(cons package lst)
|
||||
lst))
|
||||
'()))
|
||||
scheme@@(guile-user)> (length snakes)
|
||||
$1 = 361
|
||||
@end example
|
||||
|
||||
Le script @command{pre-inst-env} paramètre toutes les variables
|
||||
d'environnement nécessaires, dont @env{PATH} et @env{GUILE_LOAD_PATH}.
|
||||
|
||||
Remarquez que @command{./pre-inst-env guix pull} ne met @emph{pas} à jour
|
||||
l'arborescence des sources locale ; cela met seulement à jour le lien
|
||||
symbolique de @file{~/.config/guix/current} (@pxref{Invoquer guix pull}).
|
||||
Lancez @command{git pull} à la place si vous voulez mettre à jour votre
|
||||
arborescence des source locale.
|
||||
|
||||
|
||||
@node La configuration parfaite
|
||||
@section La configuration parfaite
|
||||
|
||||
La configuration parfaite pour travailler sur Guix est simplement la
|
||||
configuration parfaite pour travailler en Guile (@pxref{Using Guile in
|
||||
Emacs,,, guile, Guile Reference Manual}). Tout d'abord, vous avez besoin de
|
||||
mieux qu'un éditeur de texte, vous avez besoin de
|
||||
@url{http://www.gnu.org/software/emacs, Emacs}, amélioré par le superbe
|
||||
@url{http://nongnu.org/geiser/, Geiser}.
|
||||
|
||||
Geiser permet le développement interactif et incrémental depuis Emacs : la
|
||||
compilation du code et son évaluation depuis les buffers, l'accès à la
|
||||
documentation en ligne (docstrings), la complétion sensible au contexte,
|
||||
@kbd{M-.} pour sauter à la définition d'un objet, un REPL pour tester votre
|
||||
code, et bien plus (@pxref{Introduction,,, geiser, Geiser User Manual}).
|
||||
Pour travailler confortablement sur Guix, assurez-vous de modifier le chemin
|
||||
de chargement de Guile pour qu'il trouve les fichiers source de votre dépôt
|
||||
:
|
||||
|
||||
@lisp
|
||||
;; @r{Si l'extrait est dans ~/src/guix.}
|
||||
(with-eval-after-load 'geiser-guile
|
||||
(add-to-list 'geiser-guile-load-path "~/src/guix"))
|
||||
@end lisp
|
||||
|
||||
Pour effectivement éditer le code, Emacs a déjà un très bon mode Scheme.
|
||||
Mais en plus de ça, vous ne devez pas rater
|
||||
@url{http://www.emacswiki.org/emacs/ParEdit, Paredit}. Il fournit des
|
||||
fonctionnalités pour opérer directement sur l'arbre de syntaxe, comme
|
||||
relever une s-expression ou l'envelopper, absorber ou rejeter la
|
||||
s-expression suivante, etc.
|
||||
|
||||
@cindex extraits de code
|
||||
@cindex modèles
|
||||
@cindex réduire la quantité de code commun
|
||||
Nous fournissons aussi des modèles pour les messages de commit git communs
|
||||
et les définitions de paquets dans le répertoire @file{etc/snippets}. Ces
|
||||
modèles s'utilisent avec @url{http://joaotavora.github.io/yasnippet/,
|
||||
YASnippet} pour développer des chaînes courtes de déclenchement en extraits
|
||||
de texte interactifs. Vous pouvez ajouter le répertoire des modèles dans la
|
||||
variables @var{yas-snippet-dirs} d'Emacs.
|
||||
|
||||
@lisp
|
||||
;; @r{Si l'extrait est dans ~/src/guix.}
|
||||
(with-eval-after-load 'yasnippet
|
||||
(add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
|
||||
@end lisp
|
||||
|
||||
Les extraits de messages de commit dépendent de @url{https://magit.vc/,
|
||||
Magit} pour afficher les fichiers sélectionnés. Lors de la modification
|
||||
d'un message de commit, tapez @code{add} suivi de @kbd{TAB} pour insérer un
|
||||
modèle de message de commit pour ajouter un paquet ; tapez @code{update}
|
||||
suivi de @kbd{TAB} pour insérer un modèle pour la mise à jour d'un paquet ;
|
||||
tapez @code{https} suivi de @kbd{TAB} pour insérer un modèle pour le
|
||||
changement à HTTPS de l'URI de la page d'accueil.
|
||||
|
||||
L'extrait principal pour @code{scheme-mode} est lancé en tapant
|
||||
@code{package…} suivi par @kbd{TAB}. Cet extrait insère aussi la chaîne de
|
||||
déclenchement @code{origin…}, qui peut aussi être étendue. L'extrait
|
||||
@code{origin} lui-même peut aussi insérer des chaînes de déclenchement qui
|
||||
finissent sur @code{…}, qui peuvent aussi être étendues.
|
||||
|
||||
|
||||
@node Style de code
|
||||
@section Style de code
|
||||
|
||||
En général notre code suit le Standard de Code GNU (@pxref{Top,,, standards,
|
||||
GNU Coding Standards}). Cependant, il ne parle pas beaucoup de Scheme, donc
|
||||
voici quelques règles supplémentaires.
|
||||
|
||||
@menu
|
||||
* Paradigme de programmation:: Comment composer vos éléments.
|
||||
* Modules:: Où stocker votre code ?
|
||||
* Types de données et reconnaissance de motif:: Implémenter des
|
||||
structures de données.
|
||||
* Formatage du code:: Conventions d'écriture.
|
||||
@end menu
|
||||
|
||||
@node Paradigme de programmation
|
||||
@subsection Paradigme de programmation
|
||||
|
||||
Le code Scheme dans Guix est écrit dans un style purement fonctionnel. Le
|
||||
code qui s'occupe des entrées-sorties est une exception ainsi que les
|
||||
procédures qui implémentent des concepts bas-niveau comme la procédure
|
||||
@code{memoize}.
|
||||
|
||||
@node Modules
|
||||
@subsection Modules
|
||||
|
||||
Les modules Guile qui sont sensés être utilisés du côté de la construction
|
||||
doivent se trouver dans l'espace de nom @code{(guix build @dots{})}. Ils ne
|
||||
doivent pas se référer à d'autres modules Guix ou GNU@. Cependant il est
|
||||
correct pour un module « côté hôte » de dépendre d'un module coté
|
||||
construction.
|
||||
|
||||
Les modules qui s'occupent du système GNU général devraient se trouver dans
|
||||
l'espace de nom @code{(gnu @dots{})} plutôt que @code{(guix @dots{})}.
|
||||
|
||||
@node Types de données et reconnaissance de motif
|
||||
@subsection Types de données et reconnaissance de motif
|
||||
|
||||
La tendance en Lisp classique est d'utiliser des listes pour tout
|
||||
représenter et de naviguer dedans « à la main ( avec @code{car}, @code{cdr},
|
||||
@code{cadr} et compagnie. Il y a plusieurs problèmes avec ce style,
|
||||
notamment le fait qu'il soit dur à lire, source d'erreur et un obstacle aux
|
||||
rapports d'erreur bien typés.
|
||||
|
||||
Le code de Guix devrait définir des types de données appropriées (par
|
||||
exemple, avec @code{define-record-type*}) plutôt que d'abuser des listes.
|
||||
En plus, il devrait utiliser la recherche de motifs, via le module Guile
|
||||
@code{(ice-9 match)}, surtout pour rechercher dans des listes.
|
||||
|
||||
@node Formatage du code
|
||||
@subsection Formatage du code
|
||||
|
||||
@cindex formater le code
|
||||
@cindex style de code
|
||||
Lorsque nous écrivons du code Scheme, nous suivons la sagesse commune aux
|
||||
programmeurs Scheme. En général, nous suivons les
|
||||
@url{http://mumble.net/~campbell/scheme/style.txt, règles de style de
|
||||
Riastradh}. Ce document décrit aussi les conventions utilisées dans le code
|
||||
de Guile. Il est bien pensé et bien écrit, alors n'hésitez pas à le lire.
|
||||
|
||||
Certaines formes spéciales introduites dans Guix comme la macro
|
||||
@code{substitute*} ont des règles d'indentation spécifiques. Elles sont
|
||||
définies dans le fichier @file{.dir-locals.el} qu'Emacs utilise
|
||||
automatiquement. Remarquez aussi qu'Emacs-Guix fournit le mode
|
||||
@code{guix-devel-mode} qui indente et colore le code Guix correctement
|
||||
(@pxref{Development,,, emacs-guix, The Emacs-Guix Reference Manual}).
|
||||
|
||||
@cindex indentation, du code
|
||||
@cindex formatage, du code
|
||||
Si vous n'utilisez pas Emacs, assurez-vous que votre éditeur connaisse ces
|
||||
règles. Pour indenter automatiquement une définition de paquet, vous pouvez
|
||||
aussi lancer :
|
||||
|
||||
@example
|
||||
./etc/indent-code.el gnu/packages/@var{file}.scm @var{package}
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Cela indente automatiquement la définition de @var{package} dans
|
||||
@file{gnu/packages/@var{file}.scm} en lançant Emacs en mode commande. Pour
|
||||
indenter un fichier complet, n'indiquez pas de second argument :
|
||||
|
||||
@example
|
||||
./etc/indent-code.el gnu/services/@var{file}.scm
|
||||
@end example
|
||||
|
||||
@cindex Vim, édition de code Scheme
|
||||
Si vous éditez du code avec Vim, nous recommandons de lancer @code{:set
|
||||
autoindent} pour que votre code soit automatiquement indenté au moment où
|
||||
vous l'entrez. En plus,
|
||||
@uref{https://www.vim.org/scripts/script.php?script_id=3998,
|
||||
@code{paredit.vim}} peut vous aider à gérer toutes ces parenthèses.
|
||||
|
||||
Nous demandons que toutes les procédure de premier niveau contiennent une
|
||||
chaîne de documentation. Ce pré-requis peut être relâché pour les
|
||||
procédures privées simples dans l'espace de nom @code{(guix build @dots{})}
|
||||
cependant.
|
||||
|
||||
Les procédures ne devraient pas avoir plus de quatre paramètres
|
||||
positionnés. Utilisez des paramètres par mot-clefs pour les procédures qui
|
||||
prennent plus de quatre paramètres.
|
||||
|
||||
|
||||
@node Envoyer des correctifs
|
||||
@section Envoyer des correctifs
|
||||
|
||||
Le développement se fait avec le système de contrôle de version Git. Ainsi,
|
||||
l'accès au dépôt n'est pas strictement nécessaire. Nous accueillons les
|
||||
contributions sous forme de correctifs produits par @code{git format-patch}
|
||||
envoyés sur la liste de diffusion @email{guix-patches@@gnu.org}.
|
||||
|
||||
Cette liste de diffusion est gérée par une instance Debbugs accessible à
|
||||
l'adresse @uref{https://bugs.gnu.org/guix-patches}, qui nous permet de
|
||||
suivre les soumissions. Chaque message envoyé à cette liste se voit
|
||||
attribuer un numéro de suivi ; les gens peuvent ensuite répondre à cette
|
||||
soumission en envoyant un courriel à @code{@var{NNN}@@debbugs.gnu.org}, où
|
||||
@var{NNN} est le numéro de suivi (@pxref{Envoyer une série de correctifs}).
|
||||
|
||||
Veuillez écrire les messages de commit dans le format ChangeLog
|
||||
(@pxref{Change Logs,,, standards, GNU Coding Standards}) ; vous pouvez
|
||||
regarder l'historique des commits pour trouver des exemples.
|
||||
|
||||
Avant de soumettre un correctif qui ajoute ou modifie la définition d'un
|
||||
paquet, veuillez vérifier cette check-list :
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Si les auteurs du paquet logiciel fournissent une signature cryptographique
|
||||
pour l'archive, faîtes un effort pour vérifier l'authenticité de l'archive.
|
||||
Pour un fichier de signature GPG détaché, cela se fait avec la commande
|
||||
@code{gpg --verify}.
|
||||
|
||||
@item
|
||||
Prenez un peu de temps pour fournir un synopsis et une description adéquats
|
||||
pour le paquet. Voir @xref{Synopsis et descriptions} pour quelques lignes
|
||||
directrices.
|
||||
|
||||
@item
|
||||
Lancez @code{guix lint @var{paquet}}, où @var{paquet} est le nom du nouveau
|
||||
paquet ou du paquet modifié, et corrigez les erreurs qu'il rapporte
|
||||
(@pxref{Invoquer guix lint}).
|
||||
|
||||
@item
|
||||
Assurez-vous que le paquet se construise sur votre plate-forme avec
|
||||
@code{guix build @var{paquet}}.
|
||||
|
||||
@item
|
||||
@cindex construction groupée
|
||||
Assurez-vous que le paquet n'utilise pas de copie groupée d'un logiciel déjà
|
||||
disponible dans un paquet séparé.
|
||||
|
||||
Parfois, les paquets incluent des copie du code source de leurs dépendances
|
||||
pour le confort de leurs utilisateurs. Cependant, en tant que distribution,
|
||||
nous voulons nous assurer que ces paquets utilisent bien les copient que
|
||||
nous avons déjà dans la distribution si elles existent. Cela améliore
|
||||
l'utilisation des ressources (la dépendance n'est construite et stockée
|
||||
qu'une seule fois) et permet à la distribution de faire des changements
|
||||
transversaux comme appliquer des correctifs de sécurité pour un paquet donné
|
||||
depuis un unique emplacement et qu'ils affectent tout le système, ce
|
||||
qu'empêchent les copies groupées.
|
||||
|
||||
@item
|
||||
Regardez le profile rapporté par @command{guix size} (@pxref{Invoquer guix size}). Cela vous permettra de remarquer des références à d'autres paquets
|
||||
qui ont été retenus. Il peut aussi aider à déterminer s'il faut découper le
|
||||
paquet (@pxref{Des paquets avec plusieurs résultats}) et quelle dépendance
|
||||
facultative utiliser.
|
||||
|
||||
@item
|
||||
Pour les changements important, vérifiez que les paquets qui en dépendent
|
||||
(s'ils existent) ne sont pas affectés par le changement ; @code{guix refresh
|
||||
--list-dependant @var{paquet}} vous aidera (@pxref{Invoquer guix refresh}).
|
||||
|
||||
@c ===========================================================================
|
||||
@c
|
||||
@c This file was generated with po4a. Translate the source file.
|
||||
@c
|
||||
@c ===========================================================================
|
||||
@c See <https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00933.html>.
|
||||
@cindex stratégie de branche
|
||||
@cindex stratégie de planification des reconstructions
|
||||
Suivant le nombre de paquets dépendants et donc le nombre de reconstruction
|
||||
induites, les commits vont vers des branches différentes, suivant ces
|
||||
principes :
|
||||
|
||||
@table @asis
|
||||
@item 300 paquets dépendants ou moins
|
||||
branche @code{master} (changements non-disruptifs).
|
||||
|
||||
@item entre 300 et 1 200 paquets dépendants
|
||||
branche @code{staging} (changemets non-disruptifs). Cette branche devrait
|
||||
être fusionnées dans @code{master} tous les 3 semaines. Les changements par
|
||||
thèmes (par exemple une mise à jour de la pile GNOME) peuvent aller dans une
|
||||
branche spécifique (disons, @code{gnome-updates}).
|
||||
|
||||
@item plus de 1 200 paquets dépendants
|
||||
branche @code{core-updates} (peut inclure des changements majeurs et
|
||||
potentiellement disruptifs). Cette branche devrait être fusionnée dans
|
||||
@code{master} tous les 2,5 mois environ.
|
||||
@end table
|
||||
|
||||
Toutes ces branches sont @uref{https://hydra.gnu.org/project/gnu, gérées par
|
||||
notre ferme de construction} et fusionnées dans @code{master} une fois que
|
||||
tout a été construit correctement. Cela nous permet de corriger des
|
||||
problèmes avant qu'ils n'atteignent les utilisateurs et réduit la fenêtre
|
||||
pendant laquelle les binaires pré-construits ne sont pas disponibles.
|
||||
|
||||
@c TODO: It would be good with badges on the website that tracks these
|
||||
@c branches. Or maybe even a status page.
|
||||
Généralement les autres branches que @code{master} sont considérées comme
|
||||
@emph{gelées} s'il y a eu une évaluation récente ou qu'il y a une branche
|
||||
@code{-next} correspondante. Demandez sur la liste de diffusion ou sur IRC
|
||||
si vous n'êtes pas sûr de savoir où pousser votre correctif.
|
||||
|
||||
@item
|
||||
@cindex déterminisme, du processus de construction
|
||||
@cindex construction reproductibles, vérification
|
||||
Vérifiez si le processus de construction du paquet est déterministe. Cela
|
||||
signifie typiquement vérifier qu'une construction indépendante du paquet
|
||||
renvoie exactement le même résultat que vous avez obtenu, bit à bit.
|
||||
|
||||
Une manière simple de le faire est de reconstruire le paquet plusieurs fois
|
||||
à la suite sur votre machine (@pxref{Invoquer guix build}) :
|
||||
|
||||
@example
|
||||
guix build --rounds=2 mon-paquet
|
||||
@end example
|
||||
|
||||
Cela est suffisant pour trouver une classe de non-déterminisme commune,
|
||||
comme l'horodatage ou des sorties générées aléatoirement dans le résultat de
|
||||
la construction.
|
||||
|
||||
Une autre option consiste à utiliser @command{guix challenge}
|
||||
(@pxref{Invoquer guix challenge}). Vous pouvez lancer la commande une fois
|
||||
que les paquets ont été commités et construits par @code{hydra.gnu.org} pour
|
||||
vérifier s'il obtient le même résultat que vous. Mieux encore : trouvez une
|
||||
autre machine qui peut le construire et lancez @command{guix publish}. Puis
|
||||
la machine distante est sûrement différente de la vôtre, cela peut trouver
|
||||
des problèmes de non-déterminisme liés au matériel — par exemple utiliser
|
||||
une extension du jeu d'instruction — ou du noyau du système d'exploitation —
|
||||
par exemple se reposer sur @code{uname} ou les fichiers de @file{/proc}.
|
||||
|
||||
@item
|
||||
Lorsque vous écrivez de la documentation, utilisez une formulation au genre
|
||||
neutre lorsque vous vous référez à des personnes, comme le
|
||||
@uref{https://fr.wikipedia.org/wiki/They_singulier, ``they''@comma{}
|
||||
``their''@comma{} ``them'' singulier} (en anglais).
|
||||
|
||||
@item
|
||||
Vérifiez que votre correctif contienne seulement un ensemble de changements
|
||||
liés. Grouper des changements non liés ensemble rend la revue plus
|
||||
difficile et plus lente.
|
||||
|
||||
Ajouter plusieurs paquet ou une mise à jour d'un paquet avec des corrections
|
||||
dans ce paquet sont des exemples de changements sans rapport.
|
||||
|
||||
@item
|
||||
Suivez nos règles de formatage de code, éventuellement en lançant le script
|
||||
@command{et/indent-code.el} pour le faire automatiquement (@pxref{Formatage
|
||||
du code}).
|
||||
|
||||
@item
|
||||
Si possible, utilisez des miroirs dans l'URL des sources (@pxref{Invoquer guix download}). Utilisez des URL stable, pas des URL générées. Par
|
||||
exemple, les archives GitHub ne sont pas nécessairement identiques d'une
|
||||
génération à la suivante, donc il vaut mieux dans ce cas cloner le dépôt.
|
||||
N'utilisez pas le champ @command{name} dans l'URL : ce n'est pas très utile
|
||||
et si le nom change, l'URL sera probablement erronée.
|
||||
|
||||
@end enumerate
|
||||
|
||||
Lorsque vous envoyez un correctif à la liste de diffusion, utilisez
|
||||
@samp{[PATCH] @dots{}} comme sujet. Vous pouvez utiliser votre client de
|
||||
courriel ou la commande @command{git send-email} (@pxref{Envoyer une série
|
||||
de correctifs}). Nous préférons recevoir des correctifs en texte brut, soit
|
||||
en ligne, soit en pièce-jointe MIME@. Nous vous conseillons de faire
|
||||
attention si votre client de courriel change par exemple les retours à la
|
||||
ligne ou l'indentation, ce qui peut casser les correctifs.
|
||||
|
||||
Lorsqu'un bogue est résolu, veuillez fermer le fil en envoyant un courriel à
|
||||
@email{@var{NNN}-done@@debbugs.gnu.org}.
|
||||
|
||||
@unnumberedsubsec Envoyer une série de correctifs
|
||||
@anchor{Envoyer une série de correctifs}
|
||||
@cindex série de correctifs
|
||||
@cindex @code{git send-email}
|
||||
@cindex @code{git-send-email}
|
||||
|
||||
@c Debbugs bug: https://debbugs.gnu.org/db/15/15361.html
|
||||
Lorsque vous envoyez une série de correctifs (p.@@:: ex.@: avec @code{git
|
||||
send-email}), envoyez d'abord une premier message à
|
||||
@email{guix-patches@@gnu.org} puis envoyez le reste des correctifs à
|
||||
@email{@var{NNN}@@debbugs.gnu.org} pour vous assurer qu'ils seront groupés
|
||||
ensemble. Voyez @uref{https://debbugs.gnu.org/Advanced.html, la
|
||||
documentation de Debbugs} pour plus d'informations.
|
||||
+30
-101
@@ -31,13 +31,7 @@ choice.
|
||||
@section Building from Git
|
||||
|
||||
If you want to hack Guix itself, it is recommended to use the latest
|
||||
version from the Git repository:
|
||||
|
||||
@example
|
||||
git clone https://git.savannah.gnu.org/git/guix.git
|
||||
@end example
|
||||
|
||||
When building Guix from a checkout,
|
||||
version from the Git repository. When building Guix from a checkout,
|
||||
the following packages are required in addition to those mentioned in
|
||||
the installation instructions (@pxref{Requirements}).
|
||||
|
||||
@@ -108,18 +102,12 @@ actually installing them. So that you can distinguish between your
|
||||
``end-user'' hat and your ``motley'' costume.
|
||||
|
||||
To that end, all the command-line tools can be used even if you have not
|
||||
run @code{make install}. To do that, you first need to have an environment
|
||||
with all the dependencies available (@pxref{Building from Git}), and then
|
||||
simply prefix each command with
|
||||
run @code{make install}. To do that, prefix each command with
|
||||
@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the
|
||||
top build tree of Guix; it is generated by @command{./configure}),
|
||||
as in@footnote{The @option{-E} flag to
|
||||
@command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set
|
||||
such that @command{guix-daemon} and the tools it uses can find the Guile
|
||||
modules they need.}:
|
||||
top build tree of Guix), as in:
|
||||
|
||||
@example
|
||||
$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
|
||||
$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild
|
||||
$ ./pre-inst-env guix build hello
|
||||
@end example
|
||||
|
||||
@@ -158,9 +146,15 @@ The @command{pre-inst-env} script sets up all the environment variables
|
||||
necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}.
|
||||
|
||||
Note that @command{./pre-inst-env guix pull} does @emph{not} upgrade the
|
||||
local source tree; it simply updates the @file{~/.config/guix/current}
|
||||
local source tree; it simply updates the @file{~/.config/guix/latest}
|
||||
symlink (@pxref{Invoking guix pull}). Run @command{git pull} instead if
|
||||
you want to upgrade your local source tree.
|
||||
you want to upgrade your local source tree.@footnote{If you would like
|
||||
to set up @command{guix} to use your Git checkout, you can point the
|
||||
@file{~/.config/guix/latest} symlink to your Git checkout directory.
|
||||
If you are the sole user of your system, you may also consider pointing
|
||||
the @file{/root/.config/guix/latest} symlink to point to
|
||||
@file{~/.config/guix/latest}; this way it will always use the same
|
||||
@command{guix} as your user does.}
|
||||
|
||||
|
||||
@node The Perfect Setup
|
||||
@@ -193,35 +187,6 @@ facilities to directly operate on the syntax tree, such as raising an
|
||||
s-expression or wrapping it, swallowing or rejecting the following
|
||||
s-expression, etc.
|
||||
|
||||
@cindex code snippets
|
||||
@cindex templates
|
||||
@cindex reducing boilerplate
|
||||
We also provide templates for common git commit messages and package
|
||||
definitions in the @file{etc/snippets} directory. These templates can
|
||||
be used with @url{http://joaotavora.github.io/yasnippet/, YASnippet} to
|
||||
expand short trigger strings to interactive text snippets. You may want
|
||||
to add the snippets directory to the @var{yas-snippet-dirs} variable in
|
||||
Emacs.
|
||||
|
||||
@lisp
|
||||
;; @r{Assuming the Guix checkout is in ~/src/guix.}
|
||||
(with-eval-after-load 'yasnippet
|
||||
(add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
|
||||
@end lisp
|
||||
|
||||
The commit message snippets depend on @url{https://magit.vc/, Magit} to
|
||||
display staged files. When editing a commit message type @code{add}
|
||||
followed by @kbd{TAB} to insert a commit message template for adding a
|
||||
package; type @code{update} followed by @kbd{TAB} to insert a template
|
||||
for updating a package; type @code{https} followed by @kbd{TAB} to
|
||||
insert a template for changing the home page URI of a package to HTTPS.
|
||||
|
||||
The main snippet for @code{scheme-mode} is triggered by typing
|
||||
@code{package...} followed by @kbd{TAB}. This snippet also inserts the
|
||||
trigger string @code{origin...}, which can be expanded further. The
|
||||
@code{origin} snippet in turn may insert other trigger strings ending on
|
||||
@code{...}, which also can be expanded further.
|
||||
|
||||
|
||||
@node Coding Style
|
||||
@section Coding Style
|
||||
@@ -306,13 +271,6 @@ indent a whole file, omit the second argument:
|
||||
./etc/indent-code.el gnu/services/@var{file}.scm
|
||||
@end example
|
||||
|
||||
@cindex Vim, Scheme code editing
|
||||
If you are editing code with Vim, we recommend that you run @code{:set
|
||||
autoindent} so that your code is automatically indented as you type.
|
||||
Additionally,
|
||||
@uref{https://www.vim.org/scripts/script.php?script_id=3998,
|
||||
@code{paredit.vim}} may help you deal with all these parentheses.
|
||||
|
||||
We require all top-level procedures to carry a docstring. This
|
||||
requirement can be relaxed for simple private procedures in the
|
||||
@code{(guix build @dots{})} name space, though.
|
||||
@@ -334,7 +292,11 @@ This mailing list is backed by a Debbugs instance accessible at
|
||||
of submissions. Each message sent to that mailing list gets a new
|
||||
tracking number assigned; people can then follow up on the submission by
|
||||
sending email to @code{@var{NNN}@@debbugs.gnu.org}, where @var{NNN} is
|
||||
the tracking number (@pxref{Sending a Patch Series}).
|
||||
the tracking number. When sending a patch series, please first send one
|
||||
message to @email{guix-patches@@gnu.org}, and then send subsequent
|
||||
patches to @email{@var{NNN}@@debbugs.gnu.org} to make sure they are kept
|
||||
together. See @uref{https://debbugs.gnu.org/Advanced.html, the Debbugs
|
||||
documentation}, for more information.
|
||||
|
||||
Please write commit logs in the ChangeLog format (@pxref{Change Logs,,,
|
||||
standards, GNU Coding Standards}); you can check the commit history for
|
||||
@@ -344,12 +306,6 @@ Before submitting a patch that adds or modifies a package definition,
|
||||
please run through this check list:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
If the authors of the packaged software provide a cryptographic
|
||||
signature for the release tarball, make an effort to verify the
|
||||
authenticity of the archive. For a detached GPG signature file this
|
||||
would be done with the @code{gpg --verify} command.
|
||||
|
||||
@item
|
||||
Take some time to provide an adequate synopsis and description for the
|
||||
package. @xref{Synopses and Descriptions}, for some guidelines.
|
||||
@@ -377,6 +333,12 @@ distribution to make transverse changes such as applying security
|
||||
updates for a given software package in a single place and have them
|
||||
affect the whole system---something that bundled copies prevent.
|
||||
|
||||
@item
|
||||
If the authors of the packaged software provide a cryptographic
|
||||
signature for the release tarball, make an effort to verify the
|
||||
authenticity of the archive. For a detached GPG signature file this
|
||||
would be done with the @code{gpg --verify} command.
|
||||
|
||||
@item
|
||||
Take a look at the profile reported by @command{guix size}
|
||||
(@pxref{Invoking guix size}). This will allow you to notice references
|
||||
@@ -411,19 +373,12 @@ changes). This branch is intended to be merged in @code{master} every
|
||||
2.5 months or so.
|
||||
@end table
|
||||
|
||||
All these branches are @uref{https://hydra.gnu.org/project/gnu,
|
||||
tracked by our build farm} and merged into @code{master} once
|
||||
All these branches are tracked by our build farm
|
||||
and merged into @code{master} once
|
||||
everything has been successfully built. This allows us to fix issues
|
||||
before they hit users, and to reduce the window during which pre-built
|
||||
binaries are not available.
|
||||
|
||||
Generally, branches other than @code{master} are considered
|
||||
@emph{frozen} if there has been a recent evaluation, or there is a
|
||||
corresponding @code{-next} branch. Please ask on the mailing list or
|
||||
IRC if unsure where to place a patch.
|
||||
@c TODO: It would be good with badges on the website that tracks these
|
||||
@c branches. Or maybe even a status page.
|
||||
|
||||
@item
|
||||
@cindex determinism, of build processes
|
||||
@cindex reproducible builds, checking
|
||||
@@ -443,7 +398,7 @@ as timestamps or randomly-generated output in the build result.
|
||||
|
||||
Another option is to use @command{guix challenge} (@pxref{Invoking guix
|
||||
challenge}). You may run it once the package has been committed and
|
||||
built by @code{@value{SUBSTITUTE-SERVER}} to check whether it obtains the same
|
||||
built by @code{hydra.gnu.org} to check whether it obtains the same
|
||||
result as you did. Better yet: Find another machine that can build it
|
||||
and run @command{guix publish}. Since the remote build machine is
|
||||
likely different from yours, this can catch non-determinism issues
|
||||
@@ -469,37 +424,11 @@ Please follow our code formatting rules, possibly running the
|
||||
@command{etc/indent-code.el} script to do that automatically for you
|
||||
(@pxref{Formatting Code}).
|
||||
|
||||
@item
|
||||
When possible, use mirrors in the source URL (@pxref{Invoking guix download}).
|
||||
Use reliable URLs, not generated ones. For instance, GitHub archives are not
|
||||
necessarily identical from one generation to the next, so in this case it's
|
||||
often better to clone the repository. Don't use the @command{name} field in
|
||||
the URL: it is not very useful and if the name changes, the URL will probably
|
||||
be wrong.
|
||||
|
||||
@end enumerate
|
||||
|
||||
When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as
|
||||
a subject. You may use your email client or the @command{git
|
||||
send-email} command (@pxref{Sending a Patch Series}). We prefer to get
|
||||
patches in plain text messages, either inline or as MIME attachments.
|
||||
You are advised to pay attention if your email client changes anything
|
||||
like line breaks or indentation which could potentially break the
|
||||
patches.
|
||||
|
||||
When a bug is resolved, please close the thread by sending an email to
|
||||
@email{@var{NNN}-done@@debbugs.gnu.org}.
|
||||
|
||||
@unnumberedsubsec Sending a Patch Series
|
||||
@anchor{Sending a Patch Series}
|
||||
@cindex patch series
|
||||
@cindex @code{git send-email}
|
||||
@cindex @code{git-send-email}
|
||||
|
||||
When sending a patch series (e.g., using @code{git send-email}), please
|
||||
first send one message to @email{guix-patches@@gnu.org}, and then send
|
||||
subsequent patches to @email{@var{NNN}@@debbugs.gnu.org} to make sure
|
||||
they are kept together. See
|
||||
@uref{https://debbugs.gnu.org/Advanced.html, the Debbugs documentation}
|
||||
for more information.
|
||||
@c Debbugs bug: https://debbugs.gnu.org/db/15/15361.html
|
||||
send-email} command. We prefer to get patches in plain text messages,
|
||||
either inline or as MIME attachments. You are advised to pay attention if
|
||||
your email client changes anything like line breaks or indentation which
|
||||
could potentially break the patches.
|
||||
|
||||
-24155
File diff suppressed because it is too large
Load Diff
-24923
File diff suppressed because it is too large
Load Diff
+773
-7169
File diff suppressed because it is too large
Load Diff
+2
-4
@@ -1,7 +1,7 @@
|
||||
# htmlxref.cnf - reference file for free Texinfo manuals on the web.
|
||||
# Modified by Ludovic Courtès <ludo@gnu.org> for the GNU Guix manual.
|
||||
|
||||
htmlxrefversion=2018-07-05.20; # UTC
|
||||
htmlxrefversion=2016-08-03.13; # UTC
|
||||
|
||||
# Copyright 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
|
||||
#
|
||||
@@ -219,7 +219,7 @@ emacs node ${EMACS}/html_node/emacs/
|
||||
easejs mono ${GS}/easejs/manual/easejs.html
|
||||
easejs node ${GS}/easejs/manual/
|
||||
|
||||
EMACS_GUIX = https://emacs-guix.gitlab.io/website/manual/latest
|
||||
EMACS_GUIX = https://alezost.github.io/guix.el/manual/latest
|
||||
emacs-guix mono ${EMACS_GUIX}/emacs-guix.html
|
||||
emacs-guix node ${EMACS_GUIX}/html_node/
|
||||
|
||||
@@ -391,8 +391,6 @@ guile-rpc node ${GS}/guile-rpc/manual/html_node/
|
||||
|
||||
guix mono ${GS}/guix/manual/guix.html
|
||||
guix node ${GS}/guix/manual/html_node/
|
||||
guix.fr mono ${GS}/guix/manual/fr/guix.html
|
||||
guix.fr node ${GS}/guix/manual/fr/html_node/
|
||||
|
||||
gv mono ${GS}/gv/manual/gv.html
|
||||
gv node ${GS}/gv/manual/html_node/
|
||||
|
||||
+8
-58
@@ -1,10 +1,9 @@
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2013 Andreas Enge <andreas@enge.fr>
|
||||
# Copyright © 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
|
||||
# Copyright © 2016, 2018 Mathieu Lirzin <mthl@gnu.org>
|
||||
# Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
|
||||
# Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Guix.
|
||||
#
|
||||
@@ -21,13 +20,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
info_TEXINFOS = %D%/guix.texi \
|
||||
%D%/guix.fr.texi \
|
||||
%D%/guix.de.texi
|
||||
|
||||
%C%_guix_TEXINFOS = \
|
||||
%D%/contributing.texi \
|
||||
%D%/fdl-1.3.texi
|
||||
info_TEXINFOS = %D%/guix.texi
|
||||
|
||||
DOT_FILES = \
|
||||
%D%/images/bootstrap-graph.dot \
|
||||
@@ -43,6 +36,8 @@ DOT_VECTOR_GRAPHICS = \
|
||||
|
||||
EXTRA_DIST += \
|
||||
%D%/htmlxref.cnf \
|
||||
%D%/contributing.texi \
|
||||
%D%/fdl-1.3.texi \
|
||||
$(DOT_FILES) \
|
||||
$(DOT_VECTOR_GRAPHICS) \
|
||||
%D%/images/coreutils-size-map.eps \
|
||||
@@ -54,55 +49,10 @@ OS_CONFIG_EXAMPLES_TEXI = \
|
||||
%D%/os-config-desktop.texi \
|
||||
%D%/os-config-lightweight-desktop.texi
|
||||
|
||||
TRANSLATED_INFO = \
|
||||
%D%/guix.de.texi \
|
||||
%D%/guix.fr.texi \
|
||||
%D%/contributing.de.texi \
|
||||
%D%/contributing.fr.texi
|
||||
|
||||
# Bundle this file so that makeinfo finds it in out-of-source-tree builds.
|
||||
BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
|
||||
EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
|
||||
MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
|
||||
|
||||
PO4A_PARAMS := -M UTF-8 -L UTF-8 #master and localized encoding
|
||||
PO4A_PARAMS += -k 0 # produce an output even if the translation is not complete
|
||||
PO4A_PARAMS += -f texinfo # texinfo format
|
||||
|
||||
# When a change to guix.texi occurs, it is not translated immediately.
|
||||
# Because @pxref and @xref commands are reference to a section by name, they
|
||||
# should be translated. If a modification adds a reference to a section, this
|
||||
# reference is not translated, which means it references a section that does not
|
||||
# exist.
|
||||
# This command loops through the translated files looking for references. For
|
||||
# each of these references, it tries to find the translation and replaces the
|
||||
# reference name, even in untranslated strings.
|
||||
# The last sed is a multiline sed because some references span multiple lines.
|
||||
define xref_command
|
||||
cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g' | \
|
||||
tr -d '\012' | sed 's|\(@p\?x\?ref\)|\n\1|g' | egrep '@p?x?ref' | \
|
||||
sed 's|^.*@p\?x\?ref{\([^,}]*\).*$$|\1|g' | sort | uniq | while read e; do \
|
||||
line=$$(grep -n "^msgid \"$$e\"" "$<" | cut -f1 --delimiter=":") ;\
|
||||
((line++)) ;\
|
||||
if [ "$$line" != "1" ]; then \
|
||||
translation=$$(head -n $$line "$<" | tail -1 | grep msgstr | sed 's|msgstr "\(.*\)"|\1|') ;\
|
||||
if [ "$$translation" != "" ]; then \
|
||||
sed "N;s@\(p\?x\?ref\){$$(echo $$e | sed 's| |[\\n ]|g')\(,\|}\)@\1{$$translation\2@g;P;D" -i "$@.tmp" ;\
|
||||
fi ;\
|
||||
fi ;\
|
||||
done
|
||||
endef
|
||||
|
||||
$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi
|
||||
-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp"
|
||||
-sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
|
||||
-$(AM_V_POXREF)$(xref_command)
|
||||
-mv "$@.tmp" "$@"
|
||||
|
||||
$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po
|
||||
-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" -p "$<" -l "$@.tmp"
|
||||
-$(AM_V_POXREF)$(xref_command)
|
||||
-mv "$@.tmp" "$@"
|
||||
BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI)
|
||||
EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI)
|
||||
MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI)
|
||||
|
||||
%D%/os-config-%.texi: gnu/system/examples/%.tmpl
|
||||
$(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Guix.
|
||||
#
|
||||
@@ -106,15 +106,6 @@ _guix_is_dash_L ()
|
||||
esac }
|
||||
}
|
||||
|
||||
_guix_is_dash_m ()
|
||||
{
|
||||
[ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-m" ] \
|
||||
|| { case "${COMP_WORDS[$COMP_CWORD]}" in
|
||||
--manifest=*) true;;
|
||||
*) false;;
|
||||
esac }
|
||||
}
|
||||
|
||||
_guix_complete_file ()
|
||||
{
|
||||
# Let Readline complete file names.
|
||||
@@ -158,7 +149,7 @@ _guix_complete ()
|
||||
*)
|
||||
if _guix_is_command "package"
|
||||
then
|
||||
if _guix_is_dash_L || _guix_is_dash_m
|
||||
if _guix_is_dash_L
|
||||
then
|
||||
_guix_complete_file
|
||||
elif _guix_is_removing
|
||||
@@ -167,17 +158,6 @@ _guix_complete ()
|
||||
else
|
||||
_guix_complete_available_package "$word_at_point"
|
||||
fi
|
||||
elif _guix_is_command "build"
|
||||
then
|
||||
if _guix_is_dash_L
|
||||
then
|
||||
_guix_complete_file
|
||||
else
|
||||
_guix_complete_available_package "$word_at_point"
|
||||
fi
|
||||
elif _guix_is_command "download"
|
||||
then
|
||||
_guix_complete_file
|
||||
elif _guix_is_command "system"
|
||||
then
|
||||
case $COMP_CWORD in
|
||||
@@ -197,12 +177,6 @@ _guix_complete ()
|
||||
elif _guix_is_command "hash" || _guix_is_command "gc"
|
||||
then
|
||||
_guix_complete_file
|
||||
elif _guix_is_command "weather"
|
||||
then
|
||||
if _guix_is_dash_m
|
||||
then
|
||||
_guix_complete_file
|
||||
fi
|
||||
else
|
||||
_guix_complete_available_package "$word_at_point"
|
||||
fi
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
# Bash completion for guix-daemon command.
|
||||
|
||||
_guix_daemon_complete ()
|
||||
{
|
||||
local options="$(${COMP_WORDS[0]} --help 2> /dev/null \
|
||||
| grep '^ \+-' \
|
||||
| sed -e's/^.*--\([a-zA-Z0-9_-]\+\)\(=\?\).*/--\1\2/g')"
|
||||
compopt -o nospace
|
||||
COMPREPLY=($(compgen -W "$options" -- "${COMP_WORDS[${#COMP_WORDS[*]} - 1]}"))
|
||||
}
|
||||
|
||||
complete -F _guix_daemon_complete guix-daemon
|
||||
@@ -1,548 +0,0 @@
|
||||
#
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2017, 2018 Nils Gillmann <ng0@n0.is>
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
# Guix commands covered:
|
||||
# download, pull, system, build, package, size, refresh
|
||||
# publish, lint, import, hash, graph, gc, environment,
|
||||
# edit, copy, container, challenge, archive, pack,
|
||||
# weather
|
||||
|
||||
# Existing commands provided by guix as of 2017-11-30:
|
||||
# archive, challenge, copy, edit, gc, hash, lint, package
|
||||
# pull, size, weather, build, container, download, environment
|
||||
# graph, import, pack, publish, refresh, system
|
||||
|
||||
# TODO: a rewrite similar to rust.fish
|
||||
|
||||
# Use 'command guix' to avoid interactions for aliases.
|
||||
|
||||
## To be used later on:
|
||||
# function __fish_guix_archive
|
||||
# end
|
||||
# function __fish_guix_build_file_ls
|
||||
# end
|
||||
# function __fish_guix_challenge
|
||||
# end
|
||||
# function __fish_guix_container
|
||||
# end
|
||||
# function __fish_guix_copy
|
||||
# end
|
||||
# function __fish_guix_download
|
||||
# end
|
||||
# function __fish_guix_edit
|
||||
# end
|
||||
# function __fish_guix_environment
|
||||
# end
|
||||
# function __fish_guix_gc
|
||||
# end
|
||||
# function __fish_guix_graph
|
||||
# end
|
||||
# function __fish_guix_hash
|
||||
# end
|
||||
# function __fish_guix_import
|
||||
# end
|
||||
# function __fish_guix_lint
|
||||
# end
|
||||
# function __fish_guix_package
|
||||
# end
|
||||
# function __fish_guix_publish
|
||||
# end
|
||||
# function __fish_guix_pull
|
||||
# end
|
||||
# function __fish_guix_refresh
|
||||
# end
|
||||
# function __fish_guix_size
|
||||
# end
|
||||
# function __fish_guix_system
|
||||
# end
|
||||
|
||||
function __fish_guix_needs_command
|
||||
set cmd (commandline -opc)
|
||||
if [ (count $cmd) -eq 1 ]
|
||||
return 0
|
||||
else
|
||||
set -l skip_next 1
|
||||
# Skip first word because it's "guix"
|
||||
for c in $cmd[2..-1]
|
||||
test $skip_next -eq 0
|
||||
and set skip_next 1
|
||||
and continue
|
||||
switch $c
|
||||
# General options that can still take a command
|
||||
case "=*"
|
||||
continue
|
||||
# case --asdf
|
||||
# set skip_next 0
|
||||
# continue
|
||||
# these behave like commands and everything after them is ignored
|
||||
case "--help" "--version"
|
||||
return 1
|
||||
# We assume that any other token that's not an argument to a general option is a command
|
||||
case "*"
|
||||
echo $c
|
||||
return 1
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_guix_using_command
|
||||
set -l cmd (__fish_guix_needs_command)
|
||||
test -z "$cmd"
|
||||
and return 1
|
||||
contains -- $cmd $argv
|
||||
and return 0
|
||||
end
|
||||
|
||||
# general options
|
||||
complete -f -c guix -s h -l help -d 'Display the manual of a guix command'
|
||||
complete -f -c guix -s V -l version -d 'Display version information.'
|
||||
|
||||
# shared options
|
||||
#complete -f -c guix -n '__fish_guix_using_command'
|
||||
|
||||
#### download
|
||||
set -l remotecommands format no-check-certificate
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a download -d 'Download object from source into the gnu store'
|
||||
complete -f -c guix -n '__fish_guix_using_command download' -s f -l format -d'Write the hash in the given format'
|
||||
complete -f -c guix -n '__fish_guix_using_command download' -l no-check-certificate -d 'Do not validate the certificate of HTTPS servers'
|
||||
|
||||
#### pull
|
||||
set -l remotecommands verbose url bootstrap
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a pull -d 'Download and deploy the latest version of Guix'
|
||||
complete -f -c guix -n '__fish_guix_using_command pull' -l verbose -d 'produce verbose output'
|
||||
complete -f -c guix -n '__fish_guix_using_command pull' -l url -d 'download the Guix tarball from URL'
|
||||
complete -f -c guix -n '__fish_guix_using_command pull' -l bootstrap -d 'use the bootstrap Guile to build the new Guix'
|
||||
|
||||
#### system
|
||||
set -l remotecommands reconfigure roll-back switch-generation list-generations build container vm vm-image disk-image init extension-graph shepherd-graph load-path keep-failed keep-going dry-run fallback no-substitutes substitutes-urls no-grafts no-build-hook max-silent-time timeout verbosity rounds cores max-jobs derivation on-error image-size no-grub share expose full-boot
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a system -d 'Build the operating system declared in FILE according to ACTION.'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l reconfigure -d 'switch to a new operating system configuration'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l roll-back -d 'switch to the previous operating system configuration'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l switch-generation -d 'switch to an existing operating system configuration'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l list-generations -d 'list the system generations'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l build -d 'build the operating system without installing anything'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l container -d 'build a container that shares the host\'s store'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l vm -d 'build a virtual machine image that shares the host\'s store'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l vm-image -d 'build a freestanding virtual machine image'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l disk-image -d 'build a disk image, suitable for a USB stick'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l init -d 'initialize a root file system to run GNU'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l extension-graph -d 'emit the service extension graph in Dot format'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l shepherd-graph -d 'emit the graph of shepherd services in Dot format'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -s L -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--load-path=" -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -s K -l keep-failed -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -s k -l keep-going -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -s n -l dry-run -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l fallback -d 'fall back to building when the substituter fails'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l no-substitutes -d 'build instead of resorting to pre-built substitutes'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l no-grafts -d 'do not graft packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l no-build-hook -d 'do not attempt to offload builds via the build hook'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--verbosity=" -d 'use the given verbosity LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a --"rounds=" -d 'build N times in a row to detect non-determinism'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -s c -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--cores=" -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -s M -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--max-jobs=" -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -s d -l derivation -d 'return the derivation of the given system'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--on-error=" -d 'apply STRATEGY when an error occurs while reading FILE'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--image-size=" -d 'for \'vm-image\', produce an image of SIZE'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l no-grub -d 'for \'init\', do not install GRUB'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--share=" -d 'for \'vm\', share host file system according to SPEC'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -a "--expose=" -d 'for \'vm\', expose host file system according to SPEC'
|
||||
complete -f -c guix -n '__fish_guix_using_command system' -l full-boot -d 'for \'vm\', make a full boot sequence'
|
||||
|
||||
#### build
|
||||
set -l remotecommands expression file source sources system target derivations check repair root quiet log-file load-path keep-failed keep-going dry-run fallback no-substitutes substitute-urls no-grafts no-build-hook max-silent-time timeout verbosity rounds cores max-jobs with-source with-input with-graft
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a build -d 'Build the given PACKAGE-OR-DERIVATION and return their output paths.'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--expression=" -d 'build the package or derivation EXPR evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s f -d 'build the package or derivation that the code within FILE evaluates to' --exclusive --arguments "(ls -ap)"
|
||||
# The command below is broken:
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a '--file=' -a '(ls -ap)' -d 'build the package or derivation that the code within FILE evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s S -l source -d 'build the packages\' source derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l sources -d 'build source derivations, TYPE may optionally be one of "package", "all" (default), or "transitive"' -a "package all transitive" -a "package all transitive"
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s s -d 'attempt to build for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--system=" -d 'attempt to build for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--target=" -d 'cross-build for TRIPLET--e.g., "armel-linux-gnu"'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s d -l derivations -d 'return the derivation paths of the given packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l check -d 'rebuild items to check for non-determinism issues'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l repair -d 'repair the specified items'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s r -d 'make FILE a symlink to the result, and register it as a garbage collector root'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--root=" -d 'make FILE a symlink to the result, and register it as a garbage collector root'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s q -l quiet -d 'do not show the build log'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l log-file -d 'return the log file names for the given derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s L -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--load-path=" -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s K -l keep-failed -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s k -l keep-going -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s n -l dry-run -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l fallback -d 'fall back to building when the substituter fails'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l no-substitutes -d 'build instead of resorting to pre-built substitutes'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l no-grafts -d 'do not graft packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -l no-build-hook -d 'do not attempt to offload builds via the build hook'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--verbosity=" -d 'use the given verbosity LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--rounds=" -d 'build N times in a row to detect non-determinism'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s c -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--cores=" -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -s M -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--max-jobs=" -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--with-source=" -d 'use SOURCE when building the corresponding package'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--with-input=" -d 'PACKAGE=REPLACEMENT .. replace dependency PACKAGE by REPLACEMENT'
|
||||
complete -f -c guix -n '__fish_guix_using_command build' -a "--with-graft=" -d 'PACKAGE=REPLACEMENT .. graft REPLACEMENT on packages that refer to PACKAGE'
|
||||
|
||||
#### package
|
||||
set -l remotecommands install install-from-expression install-from-file remove upgrade manifest do-no-upgrade roll-back search-paths list-generations delete-generations switch-generation profile bootstrap verbose search list-installed list-available show load-path keep-failed keep-going dry-run fallback no.substitutes substitute-urls no-grafts no-build-hook max-silent-time timenout verbosity rounds cores max-jobs with-source with-input with-graft
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a package -d 'Install, remove, or upgrade packages in a single transaction.'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s i -l install -d 'install PACKAGEs'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s e -d 'install the package EXP evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--install-from-expression=" -d 'install the package EXP evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s f -d 'install the package that the code within FILE evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--install-from-file=" -d 'install the package that the code within FILE evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s r -l remove -d 'remove PACKAGEs'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s u -l upgrade -d '[=REGEXP] upgrade all the installed packages matching REGEXP'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s m -d 'create a new profile generation with the manifest from FILE'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--manifest=" -d 'create a new profile generation with the manifest from FILE'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l do-not-upgrade -d '[=REGEXP] do not upgrade any packages matching REGEXP'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l roll-back -d 'roll back to the previous generation'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l search-paths -d '[=KIND] display needed environment variable definitions'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s l -l list-generations -d '[=PATTERN] list generations matching PATTERN'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s d -l delete-generations -d '[=PATTERN] delete generations matching PATTERN'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s S -d 'PATTERN switch to a generation matching PATTERN'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--switch-generation=" -d 'PATTERN switch to a generation matching PATTERN'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s p -d 'use PROFILE instead of the user\'s default profile'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--profile=" -d 'use PROFILE instead of the user\'s default profile'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l bootstrap -d 'use the bootstrap Guile to build the profile'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l verbose -d 'produce verbose output'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s s -d 'REGEXP search in synopsis and description using REGEXP'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--search=" -d 'REGEXP search in synopsis and description using REGEXP'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s I -l list-installed -d '[=REGEXP] list installed packages matching REGEXP'
|
||||
#complete -c guix -n '__fish_guix_using_command package' -s I -l list-installed --exclusive --arguments "(guix package --list-installed)" --description 'List installed packages matching REGEXP'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s A -l list-available -d '[=REGEXP] list available packages matching REGEXP'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--show=" -d 'PACKAGE show details about PACKAGE'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s L -d 'DIR prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--load-path=" -d 'DIR prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s K -l keep-failed -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s k -l keep-going -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s n -l dry-run -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l fallback -d 'fall back to building when the substituter fails'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l no-substitutes -d 'build instead of resorting to pre-built substitutes'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--substitute-urls=" -d 'URLS fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l no-grafts -d 'do not graft packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -l no-build-hook -d 'do not attempt to offload builds via the build hook'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--max-silent-time=" -d 'SECONDS mark the build as failed after SECONDS of silence'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--timeout=" -d 'SECONDS mark the build as failed after SECONDS of activity'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--verbosity=" -d 'LEVEL use the given verbosity LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--rounds=" -d 'N build N times in a row to detect non-determinism'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s c -d 'N allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--cores=" -d 'N allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -s M -l max-jobs= -d 'N allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--max-jobs=" -d 'N allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--with-source=" -d 'SOURCE use SOURCE when building the corresponding package'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--with-input=" -d 'PACKAGE=REPLACEMENT replace dependency PACKAGE by REPLACEMENT'
|
||||
complete -f -c guix -n '__fish_guix_using_command package' -a "--with-graft=" -d 'PACKAGE=REPLACEMENT graft REPLACEMENT on packages that refer to PACKAGE'
|
||||
|
||||
#### size
|
||||
set -l remotecommands substitute-urls= system= map-file=
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a size -d 'Report the size of PACKAGE and its dependencies.'
|
||||
complete -f -c guix -n '__fish_guix_using_command size' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command size' -a "--system=" -d 'consider packages for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command size' -a "--map-file=" -d 'write to FILE a graphical map of disk usage'
|
||||
|
||||
#### refresh
|
||||
set -l remotecommands expression update select type list-updaters list-dependent key-server gpg key-download
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a refresh -d 'Update package definitions to match the latest upstream version'
|
||||
# FIXME: Too long. When PACKAGE... is given, update only the specified packages. Otherwise update all the packages of the distribution, or the subset thereof specified with `--select`.'
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--expression=" -d 'consider the package EXPR evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -l update -d 'update source files in place'
|
||||
#complete -f -c guix -n '__fish_guix_using_command refresh' -l select= -d 'select all the packages in SUBSET, one of `core` or `non-core`' --exclusive --arguments "core non-core"
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--select=" -d 'select all the packages in SUBSET, one of `core` or `non-core`' --exclusive --arguments "core non-core"
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--type=" -d 'restrict to updates from the specified updaters (e.g., \'gnu\')' --exclusive --arguments "gnu gnome kde xorg kernel.org elpa cran bioconductor cpan pypi gem github hackage crate"
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -l list-updaters -d 'list available updaters and exit'
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -l list-dependent -d 'list top-level dependent packages that would need to be rebuilt as a result of upgrading PACKAGE'
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--key-server=" -d 'use HOST as the OpenPGP key server'
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--gpg=" -d 'use COMMAND as the GnuPG 2.x command'
|
||||
complete -f -c guix -n '__fish_guix_using_command refresh' -a "--key-download=" -d 'handle missing OpenPGP keys according to POLICY.' --exclusive --arguments "always never interactive"
|
||||
|
||||
#### publish
|
||||
set -l remotecommands port= listen= user= compression ttl= repl
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a publish -d 'Publish /gnu/store over HTTP.'
|
||||
complete -f -c guix -n '__fish_guix_using_command publish' -a "--port=" -d 'listen on PORT'
|
||||
complete -f -c guix -n '__fish_guix_using_command publish' -a "--listen=" -d 'listen on the network interface for HOST'
|
||||
complete -f -c guix -n '__fish_guix_using_command publish' -a "--user=" -d 'change privileges to USER as soon as possible'
|
||||
complete -f -c guix -n '__fish_guix_using_command publish' -l compression -d '[=LEVEL] compress archives at LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command publish' -a "--ttl=" -d 'announce narinfos can be cached for TTL seconds'
|
||||
complete -f -c guix -n '__fish_guix_using_command publish' -l repl -d '[=PORT] spawn REPL server on PORT'
|
||||
|
||||
#### lint
|
||||
set -l remotecommands checkers list-checkers
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a lint -d 'Run a set of checkers on the specificied package.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l list-checkers -d 'Display the list of available lint checkers.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l checkers -d 'Only run the specified checkers.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l description -d 'Validate package descriptions.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l gnu-description -d 'Validate synopsis and descriptions of the GNU packages.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l inputs-should-be-native -d 'Identify inputs that should be native inputs.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l inputs-should-not-be-inputs -d 'Identify inputs that should not be inputs at all.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l patch-file-names -d 'Validate file names anda availability of patches.'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l home-page -d 'Validate home-page URLs'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l license -d 'Make sure the "license" field is a <license > or a list thereof'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l source -d 'Validate source URLs'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l mirror-url -d 'Suggest "mirror://" URLs'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l source-file-name -d 'Validate file names of sources'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l derivation -d 'Report failure to compile a package to a derivation'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l synopsis -d 'Validate package synopses'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l cve -d 'Check the Common Vulnerabilities and Exposures (CVE) database'
|
||||
complete -f -c guix -n '__fish_guix_using_command lint' -l formatting -d 'Look for formatting issues in the source'
|
||||
|
||||
#### import
|
||||
set -l remotecommands import gnu nix pypi cpan hackage elpa gem cran crate texlive json
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a import -d 'Run IMPORTER with ARGS'
|
||||
##### import gnu
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a gnu -d 'Return a package declaration template for PACKAGE, a GNU package.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from gnu' -a "--key-download=" -d 'handle missing OpenPGP keys according to POLICY: "always", "never", and "interactive", which is also used when "key-download" is not specified.'
|
||||
##### import nix
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a nix -d 'Import and convert the Nix expression ATTRIBUTE of NIXPKGS.'
|
||||
##### import pypi
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a pypi -d 'Import and convert the PyPI package for PACKAGE-NAME.'
|
||||
##### import cpan
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a cpan -d 'Import and convert the CPAN package for PACKAGE-NAME.'
|
||||
##### import hackage
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a hackage -d 'Import and convert the Hackage package for PACKAGE-NAME. If PACKAGE-NAME includes a suffix constituted by a at-sign followed by a numerical version (as used with Guix packages), then a definition for the specified version of the package will be generated. If no version suffix is pecified, then the generated package definition will correspond to the latest available version.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from hackage' -s e -d 'ALIST specify environment for Cabal evaluation.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from hackage' -a "--cabal-environment=" -d 'ALIST specify environment for Cabal evaluation.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from hackage' -s s -l stdin -d 'Read from standard input.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from hackage' -s t -l no-test-dependencies -d 'don\'t include test-only dependencies.'
|
||||
##### import elpa
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a elpa -d 'Import the latest package named PACKAGE-NAME from an ELPA repository.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from elpa' -s a -d 'specify the archive repository' --exclusive --arguments "gnu melpa-stable melpa"
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from elpa' -a "--archive=" -d 'specify the archive repository' --exclusive --arguments "gnu melpa-stable melpa"
|
||||
##### import gem
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a gem -d 'Import and convert the RubyGems package for PACKAGE-NAME.'
|
||||
##### import cran
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a cran -d 'Import and convert the CRAN package for PACKAGE-NAME.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from cran' -s a -d 'specify the archive repository' --exclusive --arguments "bioconductor cran"
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from cran' -a "--archive=" -d 'specify the archive repository' --exclusive --arguments "bioconductor cran"
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from cran' -l recursive -d 'traverse the dependency graph of the given package recursively and generate package definitions for all those packages that are not yet in Guix'
|
||||
##### import crate
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a crate -d 'Import and convert the crate.io package for PACKAGE-NAME.'
|
||||
##### import json
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a json -d 'Import and convert the JSON package definition in PACKAGE-FILE.'
|
||||
##### import texlive
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a texlive -d 'Import and convert the Texlive package for PACKAGE-NAME.'
|
||||
complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from texlive' -s a -l "--archive=" -d 'specify the archive repository'
|
||||
|
||||
#### hash
|
||||
set -l remotecommands exclude-vcs format= recursive
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a hash -d 'Return the cryptographic hash of a FILE.'
|
||||
complete -f -c guix -n '__fish_guix_using_command hash' -s x -l exclude-vcs -d 'Exclude version control directories.'
|
||||
complete -f -c guix -n '__fish_guix_using_command hash' -s f -d 'Write the hash in the given format.' --exclusive --arguments "nix-base32 base32 base16 hex hexadecimal"
|
||||
complete -f -c guix -n '__fish_guix_using_command hash' -a "--format=" -d 'Write the hash in the given format.' --exclusive --arguments "nix-base32 base32 base16 hex hexadecimal"
|
||||
complete -f -c guix -n '__fish_guix_using_command hash' -s r -l recursive -d 'Compute the hash on FILE recursively.'
|
||||
|
||||
#### graph
|
||||
set -l remotecommands backend list-backends type list-types expression
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a graph -d 'Emit a Graphviz (dot) representation of the dependencies of a PACKAGE.'
|
||||
complete -f -c guix -n '__fish_guix_using_command graph' -l backend -d 'Produce a graph with the given backend TYPE'
|
||||
complete -f -c guix -n '__fish_guix_using_command graph' -l list-backends -d 'list the available graph backends'
|
||||
complete -f -c guix -n '__fish_guix_using_command graph' -l type -d 'represent nodes of the given TYPE'
|
||||
complete -f -c guix -n '__fish_guix_using_command graph' -l list-types -d 'list the available graph types'
|
||||
complete -f -c guix -n '__fish_guix_using_command graph' -l expression -d 'consider the package EXPR evaluates to'
|
||||
|
||||
#### gc
|
||||
set -l remotecommands collect-garbage free-space delete optimize list-dead list-live references requisites referrers verify list-failures clear-failures
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a gc -d 'Invoke the garbage collector.'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -s C -d 'collect at least MIN bytes of garbage'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -a "--collect-garbage=" -d 'collect at least MIN bytes of garbage'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -s F -d 'attempt to reach FREE available space in the store'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -a "--free-space=" -d 'attempt to reach FREE available space in the store'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -s d -l delete -d 'attempt to delete PATHS'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l optimize -d 'optimize the store by deduplicating identical files'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l list-dead -d 'list dead paths'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l list-live -d 'list live paths'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l references -d 'list the references of PATHS'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -s R -l requisites -d 'list the requisites of PATHS'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l referrers -d 'list the referrers of PATHS'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l verify -d 'verify the integrity of the store
|
||||
OPTS is a comma-separated combination of \'repair\' and \'contents\''
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l list-failures -d 'list cached build failures'
|
||||
complete -f -c guix -n '__fish_guix_using_command gc' -l clear-failures -d 'remove PATHS from the set of cached failures'
|
||||
|
||||
#### environment
|
||||
set -l remotecommands expression load ad-hoc pure search-paths system root container network share expose bootstrap load-path keep-failed keep-going dry-run fallback no-substitutes substitute-urls no-grafts no-build-hook max-silent-time timeout verbosity rounds cores max-jobs
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a environment -d 'Build an environment that includes the dependencies of PACKAGE and execute COMMAND or an interactive shell in that environment.'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s e -d 'Create environment for the package that EXPR evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--expression=" -d 'Create environment for the package that EXPR evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s l -d 'create environment for the package that the code within FILE evaluates to.'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--load=" -d 'create environment for the package that the code within FILE evaluates to.'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l ad-hoc -d 'include all specified packages in the environment instead of only their inputs'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l pure -d 'unset existing environment variables'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l search-paths -d 'display needed environment variable definitions'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s s -d 'attempt to build for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--system=" -d 'attempt to build for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s r -d 'make FILE a symlink to the result, and register it as a garbage collector root'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--root=" -d 'make FILE a symlink to the result, and register it as a garbage collector root'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s C -l container -d 'run command within an isolated container'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s N -l network -d 'allow containers to access the network'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--share=" -d 'for containers, share writable host file system according to SPEC'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--expose=" -d 'for containers, expose read-only host file system according to SPEC'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l bootstrap -d 'use bootstrap binaries to build the environment'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s L -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--load-path=" -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s K -l keep-failed -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s k -l keep-going -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s n -l dry-run -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l fallback -d 'fall back to building when the substituter fails'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l no-substitutes -d 'build instead of resorting to pre-built substitutes'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l no-grafts -d 'do not graft packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -l no-build-hook -d 'do not attempt to offload builds via the build hook'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--verbosity=" -d 'use the given verbosity LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--rounds=" -d 'build N times in a row to detect non-determinism'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s c -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--cores=" -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -s M -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command environment' -a "--max-jobs=" -d 'allow at most N build jobs'
|
||||
|
||||
#### edit
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a edit -d 'Start $VISUAL or $EDITOR to edit the definitions of PACKAGE.'
|
||||
|
||||
#### copy
|
||||
set -l remotecommands to= from= load-path= keep-failed keep-going dry-run fallback no-substitutes substitute-urls= no-grafts no-build-hook max-silent-time= timeout= verbosity= rounds= cores= max-jobs=
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a copy -d 'Copy ITEMS to or from the specified host over SSH.'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--to=" -d 'send ITEMS to HOST'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--from=" -d 'receive ITEMS from HOST'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -s L -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--load-path=" -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -s K -l keep-failed -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -s k -l keep-going -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -s n -l dry-run -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -l fallback -d 'fall back to building when the substituter fails'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -l no-substitutes -d 'build instead of resorting to pre-built substitutes'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -l no-grafts -d 'do not graft packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -l no-build-hook -d 'do not attempt to offload builds via the build hook'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--verbosity=" -d 'use the given verbosity LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--rounds=" -d 'build N times in a row to detect non-determinism'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -s c -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--cores=" -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -s M -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command copy' -a "--max-jobs=" -d 'allow at most N build jobs'
|
||||
|
||||
#### container
|
||||
set -l remotecommands exec
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a container -d 'Build and manipulate Linux containers.'
|
||||
complete -f -c guix -n '__fish_guix_using_command container' -l exec -d 'Execute a command inside of an existing container.'
|
||||
|
||||
#### challenge
|
||||
set -l remotecommands substitute-urls verbose
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a challenge -d 'Challenge the substitutes for PACKAGE provided by one or more servers.'
|
||||
complete -f -c guix -n '__fish_guix_using_command challenge' -a "--substitute-urls=" -d 'compare build results with those at URLS'
|
||||
complete -f -c guix -n '__fish_guix_using_command challenge' -s v -l verbose -d 'show details about successful comparisons'
|
||||
|
||||
#### archive
|
||||
set -l remotecommands export format= recursive import missing extract= generate-key authorize expression= source system= target= load-path= keep-failed keep-going dry-run fallback no-substitutes substitute-urls= no-grafts no-build-hook max-silent-time= timeout= verbosity= rounds= cores= max-jobs=
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a archive -d 'Export/import one or more packages from/to the store.'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l export -d 'export the specified files/packages to stdout'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--format=" -d 'export files/packages in the specified format FMT'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l recursive -d 'combined with \'--export\', include dependencies'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l import -d 'import from the archive passed on stdin'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l missing -d 'print the files from stdin that are missing'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--extract=" -d 'extract the archive on stdin to DIR'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l generate-key -d 'generate a key pair with the given parameters'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l authorize -d 'authorize imports signed by the public key on stdin'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--expression=" -d 'build the package or derivation EXPR evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l source -d 'build the packages\' source derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--system=" -d 'attempt to build for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--target=" -d 'cross-build for TRIPLET--e.g., "armel-linux-gnu"'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--load-path=" -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l keep-failed -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l keep-going -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l dry-run -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l fallback -d 'fall back to building when the substituter fails'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l no-substitutes -d 'build instead of resorting to pre-built substitutes'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l no-grafts -d 'do not graft packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -l no-build-hook -d 'do not attempt to offload builds via the build hook'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--timeout=" -f -d 'mark the build as failed after SECONDS of activity'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--verbosity=" -d 'use the given verbosity LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--rounds=" -d 'build N times in a row to detect non-determinism'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--cores=" -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command archive' -a "--max-jobs=" -d 'allow at most N build jobs'
|
||||
|
||||
#### pack
|
||||
set -l remotecommands --load-path= --keep-failed --keep-going --dry-run --fallback --no-substitutes --substitute-urls= --no-grafts --no-build-hook --max-silent-time= --timeout= --verbosity= --rounds= --cores= --max-jobs= --with-source= --with-input= --with-graft= --format= --expression= --system= --target= --compression= --symlink= --localstatedir --help --version
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a pack -d 'Create a bundle of PACKAGE.'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--load-path=" -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s L -d 'prepend DIR to the package module search path'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--keep-failed" -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s K -d 'keep build tree of failed builds'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--keep-going" -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s k -d 'keep going when some of the derivations fail'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--dry-run" -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s n -d 'do not build the derivations'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--fallback" -d 'fall back to building when the substituter fails'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--no-substitutes" -d 'build instead of resorting to pre-built substitutes'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--no-grafts" -d 'do not graft packages'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--no-build-hook" -d 'do not attempt to offload builds via the build hook'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--verbosity=" -d 'use the given verbosity LEVEL'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--rounds=" -d 'build N times in a row to detect non-determinism'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s c -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--cores=" -d 'allow the use of up to N CPU cores for the build'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--max-jobs=" -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s M -d 'allow at most N build jobs'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--with-source=" -d 'use SOURCE when building the corresponding package'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--with-input=PACKAGE=REPLACEMENT" -d 'replace dependency PACKAGE by REPLACEMENT'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--with-graft=PACKAGE=REPLACEMENT" -d 'graft REPLACEMENT on packages that refer to PACKAGE'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--format=" -d 'build a pack in the given FORMAT'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s f -d 'build a pack in the given FORMAT'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--expression=" -d 'consider the package EXPR evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s e -d 'consider the package EXPR evaluates to'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--system=" -d 'attempt to build for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s s -d 'attempt to build for SYSTEM--eg., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--target=" -d 'cross-build for TRIPLET--e.g., "armel-linux-gnu"'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--compression=" -d 'compress using TOOL--e.g., "lzip"'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s C -d 'compress using TOOL--e.g., "lzip"'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--symlink=" -d 'create symlinks to the profile according to SPEC'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -s S -d 'create symlinks to the profile according to SPEC'
|
||||
complete -f -c guix -n '__fish_guix_using_command pack' -a "--localstatedir" -d 'include /var/guix in the resulting pack'
|
||||
|
||||
|
||||
## weather
|
||||
set -l remotecommands substitute-urls manifest system
|
||||
complete -f -c guix -n '__fish_guix_needs_command' -a weather -d 'Report the availability of substitutes-'
|
||||
complete -f -c guix -n '__fish_guix_using_command weather' -a "--substitute-urls=" -d 'check for available substitutes at URLS'
|
||||
complete -f -c guix -n '__fish_guix_using_command weather' -s m -d 'look up substitutes for packages specified in MANIFEST'
|
||||
complete -f -c guix -n '__fish_guix_using_command weather' -a "--manifest=" -d 'look up substitutes for packages specified in MANIFEST'
|
||||
complete -f -c guix -n '__fish_guix_using_command weather' -s s -d 'consider substitutes for SYSTEM--e.g., "i686-linux"'
|
||||
complete -f -c guix -n '__fish_guix_using_command weather' -a "--system=" -d 'consider substitutes for SYSTEM--e.g., "i686-linux"'
|
||||
@@ -1,285 +0,0 @@
|
||||
; -*- lisp -*-
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;;
|
||||
;;; 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/>.
|
||||
|
||||
;; This is a specification for SELinux 2.7 written in the SELinux Common
|
||||
;; Intermediate Language (CIL). It refers to types that must be defined in
|
||||
;; the system's base policy.
|
||||
|
||||
(block guix_daemon
|
||||
;; Require existing types
|
||||
(typeattributeset cil_gen_require init_t)
|
||||
(typeattributeset cil_gen_require tmp_t)
|
||||
(typeattributeset cil_gen_require nscd_var_run_t)
|
||||
(typeattributeset cil_gen_require var_log_t)
|
||||
(typeattributeset cil_gen_require domain)
|
||||
|
||||
;; Declare own types
|
||||
(type guix_daemon_t)
|
||||
(roletype object_r guix_daemon_t)
|
||||
(type guix_daemon_conf_t)
|
||||
(roletype object_r guix_daemon_conf_t)
|
||||
(type guix_daemon_exec_t)
|
||||
(roletype object_r guix_daemon_exec_t)
|
||||
(type guix_daemon_socket_t)
|
||||
(roletype object_r guix_daemon_socket_t)
|
||||
(type guix_store_content_t)
|
||||
(roletype object_r guix_store_content_t)
|
||||
(type guix_profiles_t)
|
||||
(roletype object_r guix_profiles_t)
|
||||
|
||||
;; These types are domains, thereby allowing process rules
|
||||
(typeattributeset domain (guix_daemon_t guix_daemon_exec_t))
|
||||
|
||||
(level low (s0))
|
||||
|
||||
;; When a process in init_t or guix_store_content_t spawns a
|
||||
;; guix_daemon_exec_t process, let it run in the guix_daemon_t context
|
||||
(typetransition init_t guix_daemon_exec_t
|
||||
process guix_daemon_t)
|
||||
(typetransition guix_store_content_t guix_daemon_exec_t
|
||||
process guix_daemon_t)
|
||||
|
||||
;; Permit communication with NSCD
|
||||
(allow guix_daemon_t
|
||||
nscd_var_run_t
|
||||
(file (map read)))
|
||||
(allow guix_daemon_t
|
||||
nscd_var_run_t
|
||||
(dir (search)))
|
||||
(allow guix_daemon_t
|
||||
nscd_var_run_t
|
||||
(sock_file (write)))
|
||||
(allow guix_daemon_t
|
||||
nscd_t
|
||||
(fd (use)))
|
||||
(allow guix_daemon_t
|
||||
nscd_t
|
||||
(unix_stream_socket (connectto)))
|
||||
|
||||
;; Permit logging and temp file access
|
||||
(allow guix_daemon_t
|
||||
tmp_t
|
||||
(lnk_file (setattr unlink)))
|
||||
(allow guix_daemon_t
|
||||
tmp_t
|
||||
(dir (create
|
||||
rmdir
|
||||
add_name remove_name
|
||||
open read write
|
||||
getattr setattr
|
||||
search)))
|
||||
(allow guix_daemon_t
|
||||
var_log_t
|
||||
(file (create getattr open write)))
|
||||
(allow guix_daemon_t
|
||||
var_log_t
|
||||
(dir (getattr write add_name)))
|
||||
(allow guix_daemon_t
|
||||
var_run_t
|
||||
(lnk_file (read)))
|
||||
(allow guix_daemon_t
|
||||
var_run_t
|
||||
(dir (search)))
|
||||
|
||||
;; Spawning processes, execute helpers
|
||||
(allow guix_daemon_t
|
||||
self
|
||||
(process (fork)))
|
||||
(allow guix_daemon_t
|
||||
guix_daemon_exec_t
|
||||
(file (execute execute_no_trans read open)))
|
||||
|
||||
;; TODO: unknown
|
||||
(allow guix_daemon_t
|
||||
root_t
|
||||
(dir (mounton)))
|
||||
(allow guix_daemon_t
|
||||
fs_t
|
||||
(filesystem (getattr)))
|
||||
(allow guix_daemon_conf_t
|
||||
fs_t
|
||||
(filesystem (associate)))
|
||||
|
||||
;; Build isolation
|
||||
(allow guix_daemon_t
|
||||
guix_store_content_t
|
||||
(file (mounton)))
|
||||
(allow guix_store_content_t
|
||||
fs_t
|
||||
(filesystem (associate)))
|
||||
(allow guix_daemon_t
|
||||
guix_store_content_t
|
||||
(dir (mounton)))
|
||||
(allow guix_daemon_t
|
||||
guix_daemon_t
|
||||
(capability (net_admin
|
||||
fsetid fowner
|
||||
chown setuid setgid
|
||||
dac_override dac_read_search
|
||||
sys_chroot)))
|
||||
(allow guix_daemon_t
|
||||
fs_t
|
||||
(filesystem (unmount)))
|
||||
(allow guix_daemon_t
|
||||
devpts_t
|
||||
(filesystem (mount)))
|
||||
(allow guix_daemon_t
|
||||
devpts_t
|
||||
(chr_file (setattr getattr)))
|
||||
(allow guix_daemon_t
|
||||
tmpfs_t
|
||||
(filesystem (mount)))
|
||||
(allow guix_daemon_t
|
||||
tmpfs_t
|
||||
(dir (getattr)))
|
||||
(allow guix_daemon_t
|
||||
proc_t
|
||||
(filesystem (mount)))
|
||||
(allow guix_daemon_t
|
||||
null_device_t
|
||||
(chr_file (getattr open read write)))
|
||||
(allow guix_daemon_t
|
||||
kvm_device_t
|
||||
(chr_file (getattr)))
|
||||
(allow guix_daemon_t
|
||||
zero_device_t
|
||||
(chr_file (getattr)))
|
||||
(allow guix_daemon_t
|
||||
urandom_device_t
|
||||
(chr_file (getattr)))
|
||||
(allow guix_daemon_t
|
||||
random_device_t
|
||||
(chr_file (getattr)))
|
||||
(allow guix_daemon_t
|
||||
devtty_t
|
||||
(chr_file (getattr)))
|
||||
|
||||
;; Access to store items
|
||||
(allow guix_daemon_t
|
||||
guix_store_content_t
|
||||
(dir (reparent
|
||||
create
|
||||
getattr setattr
|
||||
search rename
|
||||
add_name remove_name
|
||||
open write
|
||||
rmdir)))
|
||||
(allow guix_daemon_t
|
||||
guix_store_content_t
|
||||
(file (create
|
||||
lock
|
||||
setattr getattr
|
||||
execute execute_no_trans
|
||||
link unlink
|
||||
map
|
||||
rename
|
||||
open read write)))
|
||||
(allow guix_daemon_t
|
||||
guix_store_content_t
|
||||
(lnk_file (create
|
||||
getattr setattr
|
||||
link unlink
|
||||
read
|
||||
rename)))
|
||||
|
||||
;; Access to configuration files and directories
|
||||
(allow guix_daemon_t
|
||||
guix_daemon_conf_t
|
||||
(dir (search
|
||||
setattr getattr
|
||||
add_name remove_name
|
||||
open read write)))
|
||||
(allow guix_daemon_t
|
||||
guix_daemon_conf_t
|
||||
(file (create
|
||||
lock
|
||||
map
|
||||
getattr setattr
|
||||
unlink
|
||||
open read write)))
|
||||
(allow guix_daemon_t
|
||||
guix_daemon_conf_t
|
||||
(lnk_file (create getattr rename unlink)))
|
||||
|
||||
;; Access to profiles
|
||||
(allow guix_daemon_t
|
||||
guix_profiles_t
|
||||
(dir (getattr setattr read open)))
|
||||
(allow guix_daemon_t
|
||||
guix_profiles_t
|
||||
(lnk_file (read getattr)))
|
||||
|
||||
;; Access to profile links in the home directory
|
||||
;; TODO: allow access to profile links *anywhere* on the filesystem
|
||||
(allow guix_daemon_t
|
||||
user_home_t
|
||||
(lnk_file (read getattr)))
|
||||
(allow guix_daemon_t
|
||||
user_home_t
|
||||
(dir (search)))
|
||||
|
||||
;; Socket operations
|
||||
(allow guix_daemon_t
|
||||
init_t
|
||||
(fd (use)))
|
||||
(allow guix_daemon_t
|
||||
init_t
|
||||
(unix_stream_socket (write)))
|
||||
(allow guix_daemon_t
|
||||
guix_daemon_conf_t
|
||||
(unix_stream_socket (listen)))
|
||||
(allow guix_daemon_t
|
||||
guix_daemon_conf_t
|
||||
(sock_file (create unlink)))
|
||||
(allow guix_daemon_t
|
||||
self
|
||||
(unix_stream_socket (create
|
||||
read write
|
||||
connect bind accept
|
||||
getopt setopt)))
|
||||
(allow guix_daemon_t
|
||||
self
|
||||
(fifo_file (write read)))
|
||||
(allow guix_daemon_t
|
||||
self
|
||||
(udp_socket (ioctl create)))
|
||||
|
||||
;; Label file system
|
||||
(filecon "@guix_sysconfdir@/guix(/.*)?"
|
||||
any (system_u object_r guix_daemon_conf_t (low low)))
|
||||
(filecon "@guix_localstatedir@/guix(/.*)?"
|
||||
any (system_u object_r guix_daemon_conf_t (low low)))
|
||||
(filecon "@guix_localstatedir@/guix/profiles(/.*)?"
|
||||
any (system_u object_r guix_profiles_t (low low)))
|
||||
(filecon "/gnu"
|
||||
dir (unconfined_u object_r guix_store_content_t (low low)))
|
||||
(filecon "@storedir@(/.+)?"
|
||||
any (unconfined_u object_r guix_store_content_t (low low)))
|
||||
(filecon "@storedir@/[^/]+/.+"
|
||||
any (unconfined_u object_r guix_store_content_t (low low)))
|
||||
(filecon "@prefix@/bin/guix-daemon"
|
||||
file (system_u object_r guix_daemon_exec_t (low low)))
|
||||
(filecon "@storedir@/.+-(guix-.+|profile)/bin/guix-daemon"
|
||||
file (system_u object_r guix_daemon_exec_t (low low)))
|
||||
(filecon "@storedir@/.+-(guix-.+|profile)/libexec/guix-authenticate"
|
||||
file (system_u object_r guix_daemon_exec_t (low low)))
|
||||
(filecon "@storedir@/.+-(guix-.+|profile)/libexec/guix/(.*)?"
|
||||
any (system_u object_r guix_daemon_exec_t (low low)))
|
||||
(filecon "@guix_localstatedir@/guix/daemon-socket/socket"
|
||||
any (system_u object_r guix_daemon_socket_t (low low))))
|
||||
@@ -7,4 +7,6 @@ start on runlevel [2345]
|
||||
|
||||
stop on runlevel [016]
|
||||
|
||||
exec @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
|
||||
task
|
||||
|
||||
exec @localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix-daemon --build-users-group=guixbuild
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
Description=Build daemon for GNU Guix
|
||||
|
||||
[Service]
|
||||
ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
|
||||
Environment=GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale
|
||||
ExecStart=@localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix-daemon --build-users-group=guixbuild
|
||||
Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale
|
||||
RemainAfterExit=yes
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
|
||||
@@ -1,436 +0,0 @@
|
||||
#!/bin/bash
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2017 sharlatan <sharlatanus@gmail.com>
|
||||
# Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
|
||||
# Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
set -e
|
||||
|
||||
[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; }
|
||||
|
||||
REQUIRE=(
|
||||
"dirname"
|
||||
"readlink"
|
||||
"wget"
|
||||
"gpg"
|
||||
"grep"
|
||||
"which"
|
||||
"sed"
|
||||
"sort"
|
||||
"getent"
|
||||
"mktemp"
|
||||
"rm"
|
||||
"chmod"
|
||||
"uname"
|
||||
"groupadd"
|
||||
"tail"
|
||||
"tr"
|
||||
)
|
||||
|
||||
PAS=$'[ \033[32;1mPASS\033[0m ] '
|
||||
ERR=$'[ \033[31;1mFAIL\033[0m ] '
|
||||
INF="[ INFO ] "
|
||||
|
||||
DEBUG=0
|
||||
GNU_URL="https://alpha.gnu.org/gnu/guix/"
|
||||
OPENPGP_SIGNING_KEY_ID="3CE464558A84FDC69DB40CFB090B11993D9AEBB5"
|
||||
|
||||
# This script needs to know where root's home directory is. However, we
|
||||
# cannot simply use the HOME environment variable, since there is no guarantee
|
||||
# that it points to root's home directory.
|
||||
ROOT_HOME="$(echo ~root)"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#+UTILITIES
|
||||
|
||||
_err()
|
||||
{ # All errors go to stderr.
|
||||
printf "[%s]: %s\n" "$(date +%s.%3N)" "$1"
|
||||
}
|
||||
|
||||
_msg()
|
||||
{ # Default message to stdout.
|
||||
printf "[%s]: %s\n" "$(date +%s.%3N)" "$1"
|
||||
}
|
||||
|
||||
_debug()
|
||||
{
|
||||
if [ "${DEBUG}" = '1' ]; then
|
||||
printf "[%s]: %s\n" "$(date +%s.%3N)" "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
chk_require()
|
||||
{ # Check that every required command is available.
|
||||
declare -a cmds
|
||||
declare -a warn
|
||||
|
||||
cmds=(${1})
|
||||
|
||||
_debug "--- [ $FUNCNAME ] ---"
|
||||
|
||||
for c in ${cmds[@]}; do
|
||||
command -v "$c" &>/dev/null || warn+=("$c")
|
||||
done
|
||||
|
||||
[ "${#warn}" -ne 0 ] &&
|
||||
{ _err "${ERR}Missing commands: ${warn[*]}.";
|
||||
return 1; }
|
||||
|
||||
_msg "${PAS}verification of required commands completed"
|
||||
|
||||
gpg --list-keys ${OPENPGP_SIGNING_KEY_ID} >/dev/null 2>&1 || (
|
||||
_err "${ERR}Missing OpenPGP public key. Fetch it with this command:"
|
||||
echo " gpg --keyserver pgp.mit.edu --recv-keys ${OPENPGP_SIGNING_KEY_ID}"
|
||||
exit 1
|
||||
)
|
||||
}
|
||||
|
||||
chk_term()
|
||||
{ # Check for ANSI terminal for color printing.
|
||||
local ansi_term
|
||||
|
||||
if [ -t 2 ]; then
|
||||
if [ "${TERM+set}" = 'set' ]; then
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*|urxvt*|linux*|vt*|eterm*|screen*)
|
||||
ansi_term=true
|
||||
;;
|
||||
*)
|
||||
ansi_term=false
|
||||
ERR="[ FAIL ] "
|
||||
PAS="[ PASS ] "
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
chk_init_sys()
|
||||
{ # Return init system type name.
|
||||
if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then
|
||||
_msg "${INF}init system is: upstart"
|
||||
INIT_SYS="upstart"
|
||||
return 0
|
||||
elif [[ $(systemctl) =~ -\.mount ]]; then
|
||||
_msg "${INF}init system is: systemd"
|
||||
INIT_SYS="systemd"
|
||||
return 0
|
||||
elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then
|
||||
_msg "${INF}init system is: sysv-init"
|
||||
INIT_SYS="sysv-init"
|
||||
return 0
|
||||
else
|
||||
INIT_SYS="NA"
|
||||
_err "${ERR}Init system could not be detected."
|
||||
fi
|
||||
}
|
||||
|
||||
chk_sys_arch()
|
||||
{ # Check for operating system and architecture type.
|
||||
local os
|
||||
local arch
|
||||
|
||||
os="$(uname -s)"
|
||||
arch="$(uname -m)"
|
||||
|
||||
case "$arch" in
|
||||
i386 | i486 | i686 | i786 | x86)
|
||||
local arch=i686
|
||||
;;
|
||||
x86_64 | x86-64 | x64 | amd64)
|
||||
local arch=x86_64
|
||||
;;
|
||||
aarch64)
|
||||
local arch=aarch64
|
||||
;;
|
||||
armv7l)
|
||||
local arch=armhf
|
||||
;;
|
||||
*)
|
||||
_err "${ERR}Unsupported CPU type: ${arch}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
case "$os" in
|
||||
Linux | linux)
|
||||
local os=linux
|
||||
;;
|
||||
*)
|
||||
_err "${ERR}Your operation system (${os}) is not supported."
|
||||
exit 1
|
||||
esac
|
||||
|
||||
ARCH_OS="${arch}-${os}"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#+MAIN
|
||||
|
||||
guix_get_bin_list()
|
||||
{ # Scan GNU archive and save list of binaries
|
||||
local gnu_url="$1"
|
||||
local -a bin_ver_ls
|
||||
local latest_ver
|
||||
local default_ver
|
||||
|
||||
_debug "--- [ $FUNCNAME ] ---"
|
||||
|
||||
# Filter only version and architecture
|
||||
bin_ver_ls=("$(wget -qO- "$gnu_url" \
|
||||
| sed -n -e 's/.*guix-binary-\([0-9.]*\)\..*.tar.xz.*/\1/p' \
|
||||
| sort -Vu)")
|
||||
|
||||
latest_ver="$(echo "$bin_ver_ls" \
|
||||
| grep -oP "([0-9]{1,2}\.){2}[0-9]{1,2}" \
|
||||
| tail -n1)"
|
||||
|
||||
default_ver="guix-binary-${latest_ver}.${ARCH_OS}"
|
||||
|
||||
if [[ "${#bin_ver_ls}" -ne "0" ]]; then
|
||||
_msg "${PAS}Release for your system: ${default_ver}"
|
||||
else
|
||||
_err "${ERR}Could not obtain list of Guix releases."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use default to download according to the list and local ARCH_OS.
|
||||
BIN_VER="$default_ver"
|
||||
}
|
||||
|
||||
guix_get_bin()
|
||||
{ # Download and verify binary package.
|
||||
local url="$1"
|
||||
local bin_ver="$2"
|
||||
local dl_path="$3"
|
||||
|
||||
_debug "--- [ $FUNCNAME ] ---"
|
||||
|
||||
_msg "${INF}Downloading Guix release archive"
|
||||
|
||||
wget --help | grep -q '\--show-progress' && \
|
||||
_PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT=""
|
||||
wget $_PROGRESS_OPT -P "$dl_path" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"
|
||||
|
||||
if [[ "$?" -eq 0 ]]; then
|
||||
_msg "${PAS}download completed."
|
||||
else
|
||||
_err "${ERR}could not download ${url}/${bin_ver}.tar.xz."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pushd $dl_path >/dev/null
|
||||
gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1
|
||||
if [[ "$?" -eq 0 ]]; then
|
||||
_msg "${PAS}Signature is valid."
|
||||
popd >/dev/null
|
||||
else
|
||||
_err "${ERR}could not verify the signature."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
sys_create_store()
|
||||
{ # Unpack and install /gnu/store and /var/guix
|
||||
local pkg="$1"
|
||||
local tmp_path="$2"
|
||||
|
||||
_debug "--- [ $FUNCNAME ] ---"
|
||||
|
||||
cd "$tmp_path"
|
||||
tar --warning=no-timestamp \
|
||||
--extract \
|
||||
--file "$pkg" &&
|
||||
_msg "${PAS}unpacked archive"
|
||||
|
||||
if [[ -e "/var/guix" || -e "/gnu" ]]; then
|
||||
_err "${ERR}A previous Guix installation was found. Refusing to overwrite."
|
||||
exit 1
|
||||
else
|
||||
_msg "${INF}Installing /var/guix and /gnu..."
|
||||
mv "${tmp_path}/var/guix" /var/
|
||||
mv "${tmp_path}/gnu" /
|
||||
fi
|
||||
|
||||
_msg "${INF}Linking the root user's profile"
|
||||
mkdir -p "${ROOT_HOME}/.config/guix"
|
||||
ln -sf /var/guix/profiles/per-user/root/current-guix \
|
||||
"${ROOT_HOME}/.config/guix/current"
|
||||
|
||||
GUIX_PROFILE="${ROOT_HOME}/.config/guix/current"
|
||||
source "${GUIX_PROFILE}/etc/profile"
|
||||
_msg "${PAS}activated root profile at ${ROOT_HOME}/.config/guix/current"
|
||||
}
|
||||
|
||||
sys_create_build_user()
|
||||
{ # Create the group and user accounts for build users.
|
||||
|
||||
_debug "--- [ $FUNCNAME ] ---"
|
||||
|
||||
if [ $(getent group guixbuild) ]; then
|
||||
_msg "${INF}group guixbuild exists"
|
||||
else
|
||||
groupadd --system guixbuild
|
||||
_msg "${PAS}group <guixbuild> created"
|
||||
fi
|
||||
|
||||
for i in $(seq -w 1 10); do
|
||||
if id "guixbuilder${i}" &>/dev/null; then
|
||||
_msg "${INF}user is already in the system, reset"
|
||||
usermod -g guixbuild -G guixbuild \
|
||||
-d /var/empty -s "$(which nologin)" \
|
||||
-c "Guix build user $i" \
|
||||
"guixbuilder${i}";
|
||||
else
|
||||
useradd -g guixbuild -G guixbuild \
|
||||
-d /var/empty -s "$(which nologin)" \
|
||||
-c "Guix build user $i" --system \
|
||||
"guixbuilder${i}";
|
||||
_msg "${PAS}user added <guixbuilder${i}>"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
sys_enable_guix_daemon()
|
||||
{ # Run the daemon, and set it to automatically start on boot.
|
||||
|
||||
local info_path
|
||||
local local_bin
|
||||
local var_guix
|
||||
|
||||
_debug "--- [ $FUNCNAME ] ---"
|
||||
|
||||
info_path="/usr/local/share/info"
|
||||
local_bin="/usr/local/bin"
|
||||
var_guix="/var/guix/profiles/per-user/root/current-guix"
|
||||
|
||||
case "$INIT_SYS" in
|
||||
upstart)
|
||||
{ initctl reload-configuration;
|
||||
cp "${ROOT_HOME}/.config/guix/current/lib/upstart/system/guix-daemon.conf" \
|
||||
/etc/init/ &&
|
||||
start guix-daemon; } &&
|
||||
_msg "${PAS}enabled Guix daemon via upstart"
|
||||
;;
|
||||
systemd)
|
||||
{ cp "${ROOT_HOME}/.config/guix/current/lib/systemd/system/guix-daemon.service" \
|
||||
/etc/systemd/system/;
|
||||
chmod 664 /etc/systemd/system/guix-daemon.service;
|
||||
systemctl daemon-reload &&
|
||||
systemctl start guix-daemon &&
|
||||
systemctl enable guix-daemon; } &&
|
||||
_msg "${PAS}enabled Guix daemon via systemd"
|
||||
;;
|
||||
NA|*)
|
||||
_msg "${ERR}unsupported init system; run the daemon manually:"
|
||||
echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild"
|
||||
;;
|
||||
esac
|
||||
|
||||
_msg "${INF}making the guix command available to other users"
|
||||
|
||||
[ -e "$local_bin" ] || mkdir -p "$local_bin"
|
||||
ln -sf "${var_guix}/bin/guix" "$local_bin"
|
||||
|
||||
[ -e "$info_path" ] || mkdir -p "$info_path"
|
||||
for i in ${var_guix}/share/info/*; do
|
||||
ln -sf "$i" "$info_path"
|
||||
done
|
||||
}
|
||||
|
||||
sys_authorize_build_farms()
|
||||
{ # authorize the public keys of the two build farms
|
||||
while true; do
|
||||
read -p "Permit downloading pre-built package binaries from the project's build farms? (yes/no) " yn
|
||||
case $yn in
|
||||
[Yy]*) guix archive --authorize < "${ROOT_HOME}/.config/guix/current/share/guix/hydra.gnu.org.pub" &&
|
||||
_msg "${PAS}Authorized public key for hydra.gnu.org";
|
||||
guix archive --authorize < "${ROOT_HOME}/.config/guix/current/share/guix/ci.guix.info.pub" &&
|
||||
_msg "${PAS}Authorized public key for ci.guix.info";
|
||||
break;;
|
||||
[Nn]*) _msg "${INF}Skipped authorizing build farm public keys"
|
||||
break;;
|
||||
*) _msg "Please answer yes or no.";
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
welcome()
|
||||
{
|
||||
cat<<"EOF"
|
||||
░░░ ░░░
|
||||
░░▒▒░░░░░░░░░ ░░░░░░░░░▒▒░░
|
||||
░░▒▒▒▒▒░░░░░░░ ░░░░░░░▒▒▒▒▒░
|
||||
░▒▒▒░░▒▒▒▒▒ ░░░░░░░▒▒░
|
||||
░▒▒▒▒░ ░░░░░░
|
||||
▒▒▒▒▒ ░░░░░░
|
||||
▒▒▒▒▒ ░░░░░
|
||||
░▒▒▒▒▒ ░░░░░
|
||||
▒▒▒▒▒ ░░░░░
|
||||
▒▒▒▒▒ ░░░░░
|
||||
░▒▒▒▒▒░░░░░
|
||||
▒▒▒▒▒▒░░░
|
||||
▒▒▒▒▒▒░
|
||||
_____ _ _ _ _ _____ _
|
||||
/ ____| \ | | | | | / ____| (_)
|
||||
| | __| \| | | | | | | __ _ _ ___ __
|
||||
| | |_ | . ' | | | | | | |_ | | | | \ \/ /
|
||||
| |__| | |\ | |__| | | |__| | |_| | |> <
|
||||
\_____|_| \_|\____/ \_____|\__,_|_/_/\_\
|
||||
|
||||
This script installs GNU Guix on your system
|
||||
|
||||
https://www.gnu.org/software/guix/
|
||||
EOF
|
||||
echo -n "Press return to continue..."
|
||||
read -r ANSWER
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
local tmp_path
|
||||
welcome
|
||||
|
||||
_msg "Starting installation ($(date))"
|
||||
|
||||
chk_term
|
||||
chk_require "${REQUIRE[*]}"
|
||||
chk_init_sys
|
||||
chk_sys_arch
|
||||
|
||||
_msg "${INF}system is ${ARCH_OS}"
|
||||
|
||||
tmp_path="$(mktemp -t -d guix.XXX)"
|
||||
|
||||
guix_get_bin_list "${GNU_URL}"
|
||||
guix_get_bin "${GNU_URL}" "${BIN_VER}" "$tmp_path"
|
||||
|
||||
sys_create_store "${BIN_VER}.tar.xz" "${tmp_path}"
|
||||
sys_create_build_user
|
||||
sys_enable_guix_daemon
|
||||
sys_authorize_build_farms
|
||||
|
||||
_msg "${INF}cleaning up ${tmp_path}"
|
||||
rm -r "${tmp_path}"
|
||||
|
||||
_msg "${PAS}Guix has successfully been installed!"
|
||||
_msg "${INF}Run 'info guix' to read the manual."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -9,4 +9,4 @@ stop on runlevel [016]
|
||||
|
||||
task
|
||||
|
||||
exec @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix publish --user=nobody --port=8181
|
||||
exec @localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix publish --user=nobody --port=8181
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
Description=Publish the GNU Guix store
|
||||
|
||||
[Service]
|
||||
ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix publish --user=nobody --port=8181
|
||||
Environment=GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale
|
||||
ExecStart=@localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix publish --user=nobody --port=8181
|
||||
Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale
|
||||
RemainAfterExit=yes
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-cvs-reference
|
||||
# key: cvs-reference...
|
||||
# --
|
||||
(cvs-reference
|
||||
(root-directory "${1:root-directory}")
|
||||
(module "${2:module}")
|
||||
(revision "${3:revision}"))
|
||||
@@ -1,7 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-git-reference
|
||||
# key: git-reference...
|
||||
# --
|
||||
(git-reference
|
||||
(url "$1")
|
||||
(commit ${2:commit}))
|
||||
@@ -1,7 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-hg-reference
|
||||
# key: hg-reference...
|
||||
# --
|
||||
(hg-reference
|
||||
(url "$1")
|
||||
(changeset ${2:changeset}))
|
||||
@@ -1,25 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-origin
|
||||
# key: origin...
|
||||
# --
|
||||
(origin
|
||||
(method ${1:$$(yas-choose-value "url-fetch"
|
||||
"url-fetch/tarbomb"
|
||||
"url-fetch/zipbomb"
|
||||
"cvs-fetch"
|
||||
"git-fetch"
|
||||
"hg-fetch"
|
||||
"svn-fetch")})
|
||||
(uri ${1:$(cond ((equal yas-text "git-fetch") "git-reference...")
|
||||
((equal yas-text "svn-fetch") "svn-reference...")
|
||||
((equal yas-text "hg-fetch") "hg-reference...")
|
||||
((equal yas-text "cvs-fetch") "cvs-reference...")
|
||||
(t "(string-append \\"https://\\" version \\".tar.gz\\")"))}$0)
|
||||
${1:$(cond ((equal yas-text "git-fetch")
|
||||
"(file-name (git-file-name name version))")
|
||||
((member yas-text '("svn-fetch" "hg-fetch" "cvs-fetch"))
|
||||
"(file-name (string-append name \\"-\\" version \\"-checkout\\"))")
|
||||
(t ""))}
|
||||
(sha256
|
||||
(base32
|
||||
"$2")))
|
||||
@@ -1,36 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-package
|
||||
# key: package...
|
||||
# --
|
||||
(define-public $1
|
||||
(package
|
||||
(name "$1")
|
||||
(version "$2")
|
||||
(source origin...$0)
|
||||
(build-system ${3:$$(yas-choose-value "android-ndk-build-system"
|
||||
"ant-build-system"
|
||||
"asdf-build-system"
|
||||
"cargo-build-system"
|
||||
"cmake-build-system"
|
||||
"dub-build-system"
|
||||
"emacs-build-system"
|
||||
"font-build-system"
|
||||
"glib-or-gtk-build-system"
|
||||
"gnu-build-system"
|
||||
"go-build-system"
|
||||
"haskell-build-system"
|
||||
"meson-build-system"
|
||||
"minify-build-system"
|
||||
"ocaml-build-system"
|
||||
"perl-build-system"
|
||||
"python-build-system"
|
||||
"r-build-system"
|
||||
"ruby-build-system"
|
||||
"scons-build-system"
|
||||
"texlive-build-system"
|
||||
"trivial-build-system"
|
||||
"waf-build-system")})
|
||||
(home-page "$4")
|
||||
(synopsis "$5")
|
||||
(description "$6")
|
||||
(license $7)))
|
||||
@@ -1,7 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-svn-reference
|
||||
# key: svn-reference...
|
||||
# --
|
||||
(svn-reference
|
||||
(url "$1")
|
||||
(revision ${2:svn-revision}))
|
||||
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-commit-message-add-package
|
||||
# key: add
|
||||
# condition: git-commit-mode
|
||||
# --
|
||||
gnu: Add $1.
|
||||
|
||||
* `(car (magit-staged-files))` ($1): New variable.
|
||||
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-commit-message-update-package
|
||||
# key: update
|
||||
# condition: git-commit-mode
|
||||
# --
|
||||
gnu: $1: Update to $2.
|
||||
|
||||
* `(car (magit-staged-files))` ($1): Update to $2.$0
|
||||
`(mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files)) "\n")`
|
||||
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guix-commit-message-use-https-home-page
|
||||
# key: https
|
||||
# condition: git-commit-mode
|
||||
# --
|
||||
gnu: $1: Use HTTPS home page URI.
|
||||
|
||||
* `(car (magit-staged-files))` ($1)[home-page]: Use HTTPS URI.
|
||||
`(mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files)) "\n")`
|
||||
@@ -1 +0,0 @@
|
||||
berlin.guixsd.org.pub
|
||||
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015 Joshua S. Grant <jgrant@parenthetical.io>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;;
|
||||
@@ -19,14 +19,6 @@
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gnu)
|
||||
#:use-module (guix i18n)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (srfi srfi-34)
|
||||
#:use-module (srfi srfi-35)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu services)
|
||||
#:export (use-package-modules
|
||||
use-service-modules
|
||||
use-system-modules))
|
||||
@@ -60,97 +52,13 @@
|
||||
(module-use! i (resolve-interface m))))
|
||||
%public-modules)))
|
||||
|
||||
(define (%try-use-modules modules location make-hint)
|
||||
"Attempt to load all of MODULES. Report errors as coming from LOCATION, a
|
||||
<location> record, and use MAKE-HINT to produce a fix hint."
|
||||
(define (location->string loc)
|
||||
(match loc
|
||||
(#f "")
|
||||
(($ <location> file line column)
|
||||
(format #f "~a:~a:~a: " file line column))))
|
||||
|
||||
(for-each (lambda (module)
|
||||
(catch 'misc-error
|
||||
(lambda ()
|
||||
(process-use-modules `((,module))))
|
||||
(lambda _
|
||||
(raise
|
||||
(apply
|
||||
make-compound-condition
|
||||
(condition
|
||||
(&message
|
||||
(message (format #f (G_ "module ~a not found")
|
||||
module))))
|
||||
(condition
|
||||
(&error-location (location location)))
|
||||
(or (and=> (make-hint module) list)
|
||||
'()))))))
|
||||
modules))
|
||||
|
||||
(define (package-module-hint module)
|
||||
(define last-name
|
||||
(match module
|
||||
((_ ... last)
|
||||
(symbol->string last))))
|
||||
|
||||
(match (find-packages-by-name last-name)
|
||||
(()
|
||||
(condition
|
||||
(&fix-hint
|
||||
(hint (G_ "\
|
||||
You may use @command{guix package --show=foo | grep location} to search
|
||||
for the location of package @code{foo}.
|
||||
If you get the line @code{location: gnu/packages/bar.scm:174:2},
|
||||
add @code{bar} to the @code{use-package-modules} form.")))))
|
||||
((package _ ...)
|
||||
(condition
|
||||
(&fix-hint
|
||||
(hint (format #f (G_ "\
|
||||
Try adding @code{(use-package-modules ~a)}.")
|
||||
(basename (location-file (package-location package))
|
||||
".scm"))))))))
|
||||
|
||||
(define (service-module-hint module)
|
||||
(define last-name
|
||||
(match module
|
||||
((_ ... last)
|
||||
last)))
|
||||
|
||||
(match (lookup-service-types last-name)
|
||||
(()
|
||||
(condition
|
||||
(&fix-hint
|
||||
(hint (format #f (G_ "\
|
||||
You may use @command{guix system search ~a} to search for a service
|
||||
matching @code{~a}.
|
||||
If you get the line @code{location: gnu/services/foo.scm:188:2},
|
||||
add @code{foo} to the @code{use-service-modules} form.")
|
||||
last-name last-name)))))
|
||||
((package _ ...)
|
||||
(condition
|
||||
(&fix-hint
|
||||
(hint (format #f (G_ "\
|
||||
Try adding @code{(use-service-modules ~a)}.")
|
||||
(basename (location-file (service-type-location package))
|
||||
".scm"))))))))
|
||||
|
||||
(define-syntax-rule (try-use-modules hint modules ...)
|
||||
(eval-when (expand load eval)
|
||||
(%try-use-modules '(modules ...)
|
||||
(source-properties->location
|
||||
(current-source-location))
|
||||
hint)))
|
||||
|
||||
(define-syntax-rule (use-package-modules module ...)
|
||||
(try-use-modules package-module-hint
|
||||
(gnu packages module) ...))
|
||||
(use-modules (gnu packages module) ...))
|
||||
|
||||
(define-syntax-rule (use-service-modules module ...)
|
||||
(try-use-modules service-module-hint
|
||||
(gnu services module) ...))
|
||||
(use-modules (gnu services module) ...))
|
||||
|
||||
(define-syntax-rule (use-system-modules module ...)
|
||||
(try-use-modules (const #f) ;no hint
|
||||
(gnu system module) ...))
|
||||
(use-modules (gnu system module) ...))
|
||||
|
||||
;;; gnu.scm ends here
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2015, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
@@ -33,7 +33,7 @@
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://git.savannah.gnu.org/git/guix/guix-artwork.git")
|
||||
(url "git://git.savannah.gnu.org/guix/guix-artwork.git")
|
||||
(commit commit)))
|
||||
(file-name (string-append "guix-artwork-" (string-take commit 7)
|
||||
"-checkout"))
|
||||
|
||||
+2
-17
@@ -30,7 +30,6 @@
|
||||
menu-entry-linux
|
||||
menu-entry-linux-arguments
|
||||
menu-entry-initrd
|
||||
menu-entry-device-mount-point
|
||||
|
||||
bootloader
|
||||
bootloader?
|
||||
@@ -43,7 +42,7 @@
|
||||
bootloader-configuration
|
||||
bootloader-configuration?
|
||||
bootloader-configuration-bootloader
|
||||
bootloader-configuration-target
|
||||
bootloader-configuration-device
|
||||
bootloader-configuration-menu-entries
|
||||
bootloader-configuration-default-entry
|
||||
bootloader-configuration-timeout
|
||||
@@ -68,8 +67,6 @@
|
||||
(label menu-entry-label)
|
||||
(device menu-entry-device ; file system uuid, label, or #f
|
||||
(default #f))
|
||||
(device-mount-point menu-entry-device-mount-point
|
||||
(default #f))
|
||||
(linux menu-entry-linux)
|
||||
(linux-arguments menu-entry-linux-arguments
|
||||
(default '())) ; list of string-valued gexps
|
||||
@@ -107,8 +104,6 @@
|
||||
(bootloader bootloader-configuration-bootloader) ; <bootloader>
|
||||
(device bootloader-configuration-device ; string
|
||||
(default #f))
|
||||
(target %bootloader-configuration-target ; string
|
||||
(default #f))
|
||||
(menu-entries bootloader-configuration-menu-entries ; list of <boot-parameters>
|
||||
(default '()))
|
||||
(default-entry bootloader-configuration-default-entry ; integer
|
||||
@@ -128,15 +123,6 @@
|
||||
(additional-configuration bootloader-configuration-additional-configuration ; record
|
||||
(default #f)))
|
||||
|
||||
(define (bootloader-configuration-target config)
|
||||
(or (%bootloader-configuration-target config)
|
||||
(let ((device (bootloader-configuration-device config)))
|
||||
(when device
|
||||
(warning
|
||||
(G_ "The 'device' field of bootloader configurations is deprecated.~%"))
|
||||
(warning (G_ "Use 'target' instead.~%")))
|
||||
device)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Bootloaders.
|
||||
@@ -146,8 +132,7 @@
|
||||
"Return the list of bootloader modules."
|
||||
(all-modules (map (lambda (entry)
|
||||
`(,entry . "gnu/bootloader"))
|
||||
%load-path)
|
||||
#:warn warn-about-load-error))
|
||||
%load-path)))
|
||||
|
||||
(define %bootloaders
|
||||
;; The list of publically-known bootloaders.
|
||||
|
||||
+25
-15
@@ -19,8 +19,11 @@
|
||||
|
||||
(define-module (gnu bootloader extlinux)
|
||||
#:use-module (gnu bootloader)
|
||||
#:use-module (gnu system)
|
||||
#:use-module (gnu packages bootloaders)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix monads)
|
||||
#:use-module (guix records)
|
||||
#:use-module (guix utils)
|
||||
#:export (extlinux-bootloader
|
||||
extlinux-bootloader-gpt))
|
||||
@@ -35,13 +38,14 @@
|
||||
corresponding to old generations of the system."
|
||||
|
||||
(define all-entries
|
||||
(append entries (bootloader-configuration-menu-entries config)))
|
||||
(append entries (map menu-entry->boot-parameters
|
||||
(bootloader-configuration-menu-entries config))))
|
||||
|
||||
(define (menu-entry->gexp entry)
|
||||
(let ((label (menu-entry-label entry))
|
||||
(kernel (menu-entry-linux entry))
|
||||
(kernel-arguments (menu-entry-linux-arguments entry))
|
||||
(initrd (menu-entry-initrd entry)))
|
||||
(define (boot-parameters->gexp params)
|
||||
(let ((label (boot-parameters-label params))
|
||||
(kernel (boot-parameters-kernel params))
|
||||
(kernel-arguments (boot-parameters-kernel-arguments params))
|
||||
(initrd (boot-parameters-initrd params)))
|
||||
#~(format port "LABEL ~a
|
||||
MENU LABEL ~a
|
||||
KERNEL ~a
|
||||
@@ -50,7 +54,7 @@ corresponding to old generations of the system."
|
||||
APPEND ~a
|
||||
~%"
|
||||
#$label #$label
|
||||
#$kernel (dirname #$kernel) #$initrd
|
||||
#$kernel #$kernel #$initrd
|
||||
(string-join (list #$@kernel-arguments)))))
|
||||
|
||||
(define builder
|
||||
@@ -60,21 +64,20 @@ corresponding to old generations of the system."
|
||||
(format port "# This file was generated from your GuixSD configuration. Any changes
|
||||
# will be lost upon reconfiguration.
|
||||
UI menu.c32
|
||||
MENU TITLE GuixSD Boot Options
|
||||
PROMPT ~a
|
||||
TIMEOUT ~a~%"
|
||||
(if (> timeout 0) 1 0)
|
||||
;; timeout is expressed in 1/10s of seconds.
|
||||
(* 10 timeout))
|
||||
#$@(map menu-entry->gexp all-entries)
|
||||
#$@(map boot-parameters->gexp all-entries)
|
||||
|
||||
#$@(if (pair? old-entries)
|
||||
#~((format port "~%")
|
||||
#$@(map menu-entry->gexp old-entries)
|
||||
#$@(map boot-parameters->gexp old-entries)
|
||||
(format port "~%"))
|
||||
#~())))))
|
||||
|
||||
(computed-file "extlinux.conf" builder))
|
||||
(gexp->derivation "extlinux.conf" builder))
|
||||
|
||||
|
||||
|
||||
@@ -83,6 +86,14 @@ TIMEOUT ~a~%"
|
||||
;;; Install procedures.
|
||||
;;;
|
||||
|
||||
(define dd
|
||||
#~(lambda (bs count if of)
|
||||
(zero? (system* "dd"
|
||||
(string-append "bs=" (number->string bs))
|
||||
(string-append "count=" (number->string count))
|
||||
(string-append "if=" if)
|
||||
(string-append "of=" of)))))
|
||||
|
||||
(define (install-extlinux mbr)
|
||||
#~(lambda (bootloader device mount-point)
|
||||
(let ((extlinux (string-append bootloader "/sbin/extlinux"))
|
||||
@@ -91,10 +102,9 @@ TIMEOUT ~a~%"
|
||||
(for-each (lambda (file)
|
||||
(install-file file install-dir))
|
||||
(find-files syslinux-dir "\\.c32$"))
|
||||
(unless
|
||||
(and (zero? (system* extlinux "--install" install-dir))
|
||||
(write-file-on-device
|
||||
(string-append syslinux-dir "/" #$mbr) 440 device 0))
|
||||
|
||||
(unless (and (zero? (system* extlinux "--install" install-dir))
|
||||
(#$dd 440 1 (string-append syslinux-dir "/" #$mbr) device))
|
||||
(error "failed to install SYSLINUX")))))
|
||||
|
||||
(define install-extlinux-mbr
|
||||
|
||||
+84
-90
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
|
||||
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
@@ -20,18 +20,25 @@
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gnu bootloader grub)
|
||||
#:use-module (guix store)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix derivations)
|
||||
#:use-module (guix records)
|
||||
#:use-module ((guix utils) #:select (%current-system))
|
||||
#:use-module (guix monads)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix download)
|
||||
#:use-module (gnu artwork)
|
||||
#:use-module (gnu system)
|
||||
#:use-module (gnu bootloader)
|
||||
#:use-module (gnu system uuid)
|
||||
#:use-module (gnu system file-systems)
|
||||
#:autoload (gnu packages bootloaders) (grub)
|
||||
#:autoload (gnu packages compression) (gzip)
|
||||
#:autoload (gnu packages gtk) (guile-cairo guile-rsvg)
|
||||
#:autoload (gnu packages guile) (guile-2.2)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 regex)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (rnrs bytevectors)
|
||||
#:export (grub-image
|
||||
grub-image?
|
||||
grub-image-aspect-ratio
|
||||
@@ -48,7 +55,6 @@
|
||||
|
||||
grub-bootloader
|
||||
grub-efi-bootloader
|
||||
grub-mkrescue-bootloader
|
||||
|
||||
grub-configuration))
|
||||
|
||||
@@ -113,14 +119,25 @@ otherwise."
|
||||
|
||||
(define* (svg->png svg #:key width height)
|
||||
"Build a PNG of HEIGHT x WIDTH from SVG."
|
||||
(computed-file "grub-image.png"
|
||||
(with-imported-modules '((gnu build svg))
|
||||
(with-extensions (list guile-rsvg guile-cairo)
|
||||
#~(begin
|
||||
(use-modules (gnu build svg))
|
||||
(svg->png #+svg #$output
|
||||
#:width #$width
|
||||
#:height #$height))))))
|
||||
;; Note: Guile-RSVG & co. are now built for Guile 2.2, so we use 2.2 here.
|
||||
;; TODO: Remove #:guile-for-build when 2.2 has become the default.
|
||||
(mlet %store-monad ((guile (package->derivation guile-2.2 #:graft? #f)))
|
||||
(gexp->derivation "grub-image.png"
|
||||
(with-imported-modules '((gnu build svg))
|
||||
#~(begin
|
||||
;; We need these two libraries.
|
||||
(add-to-load-path (string-append #+guile-rsvg
|
||||
"/share/guile/site/"
|
||||
(effective-version)))
|
||||
(add-to-load-path (string-append #+guile-cairo
|
||||
"/share/guile/site/"
|
||||
(effective-version)))
|
||||
|
||||
(use-modules (gnu build svg))
|
||||
(svg->png #+svg #$output
|
||||
#:width #$width
|
||||
#:height #$height)))
|
||||
#:guile-for-build guile)))
|
||||
|
||||
(define* (grub-background-image config #:key (width 1024) (height 768))
|
||||
"Return the GRUB background image defined in CONFIG with a ratio of
|
||||
@@ -130,13 +147,15 @@ WIDTH/HEIGHT, or #f if none was found."
|
||||
(= (grub-image-aspect-ratio image) ratio))
|
||||
(grub-theme-images
|
||||
(bootloader-theme config)))))
|
||||
(and image
|
||||
(svg->png (grub-image-file image)
|
||||
#:width width #:height height))))
|
||||
(if image
|
||||
(svg->png (grub-image-file image)
|
||||
#:width width #:height height)
|
||||
(with-monad %store-monad
|
||||
(return #f)))))
|
||||
|
||||
(define* (eye-candy config store-device store-mount-point
|
||||
#:key system port)
|
||||
"Return a gexp that writes to PORT (a port-valued gexp) the
|
||||
"Return in %STORE-MONAD a gexp that writes to PORT (a port-valued gexp) the
|
||||
'grub.cfg' part concerned with graphics mode, background images, colors, and
|
||||
all that. STORE-DEVICE designates the device holding the store, and
|
||||
STORE-MOUNT-POINT is its mount point; these are used to determine where the
|
||||
@@ -184,11 +203,9 @@ fi~%" #$font-file)
|
||||
(strip-mount-point store-mount-point
|
||||
(file-append grub "/share/grub/unicode.pf2")))
|
||||
|
||||
(define image
|
||||
(grub-background-image config))
|
||||
|
||||
(and image
|
||||
#~(format #$port "
|
||||
(mlet* %store-monad ((image (grub-background-image config)))
|
||||
(return (and image
|
||||
#~(format #$port "
|
||||
function setup_gfxterm {~a}
|
||||
|
||||
# Set 'root' to the partition that contains /gnu/store.
|
||||
@@ -205,14 +222,14 @@ else
|
||||
set menu_color_normal=cyan/blue
|
||||
set menu_color_highlight=white/blue
|
||||
fi~%"
|
||||
#$setup-gfxterm-body
|
||||
#$(grub-root-search store-device font-file)
|
||||
#$(setup-gfxterm config font-file)
|
||||
#$(grub-setup-io config)
|
||||
#$setup-gfxterm-body
|
||||
#$(grub-root-search store-device font-file)
|
||||
#$(setup-gfxterm config font-file)
|
||||
#$(grub-setup-io config)
|
||||
|
||||
#$(strip-mount-point store-mount-point image)
|
||||
#$(theme-colors grub-theme-color-normal)
|
||||
#$(theme-colors grub-theme-color-highlight))))
|
||||
#$(strip-mount-point store-mount-point image)
|
||||
#$(theme-colors grub-theme-color-normal)
|
||||
#$(theme-colors grub-theme-color-highlight))))))
|
||||
|
||||
|
||||
;;;
|
||||
@@ -282,13 +299,12 @@ code."
|
||||
(match device
|
||||
;; Preferably refer to DEVICE by its UUID or label. This is more
|
||||
;; efficient and less ambiguous, see <http://bugs.gnu.org/22281>.
|
||||
((? uuid? uuid)
|
||||
((? bytevector? uuid)
|
||||
(format #f "search --fs-uuid --set ~a"
|
||||
(uuid->string device)))
|
||||
((? file-system-label? label)
|
||||
(format #f "search --label --set ~a"
|
||||
(file-system-label->string label)))
|
||||
((or #f (? string?))
|
||||
((? string? label)
|
||||
(format #f "search --label --set ~a" label))
|
||||
(#f
|
||||
#~(format #f "search --file --set ~a" #$file)))))
|
||||
|
||||
(define* (grub-configuration-file config entries
|
||||
@@ -300,14 +316,16 @@ code."
|
||||
STORE-FS, a <file-system> object. OLD-ENTRIES is taken to be a list of menu
|
||||
entries corresponding to old generations of the system."
|
||||
(define all-entries
|
||||
(append entries (bootloader-configuration-menu-entries config)))
|
||||
(define (menu-entry->gexp entry)
|
||||
(let ((device (menu-entry-device entry))
|
||||
(device-mount-point (menu-entry-device-mount-point entry))
|
||||
(label (menu-entry-label entry))
|
||||
(kernel (menu-entry-linux entry))
|
||||
(arguments (menu-entry-linux-arguments entry))
|
||||
(initrd (menu-entry-initrd entry)))
|
||||
(append entries (map menu-entry->boot-parameters
|
||||
(bootloader-configuration-menu-entries config))))
|
||||
|
||||
(define (boot-parameters->gexp params)
|
||||
(let ((device (boot-parameters-store-device params))
|
||||
(device-mount-point (boot-parameters-store-mount-point params))
|
||||
(label (boot-parameters-label params))
|
||||
(kernel (boot-parameters-kernel params))
|
||||
(arguments (boot-parameters-kernel-arguments params))
|
||||
(initrd (boot-parameters-initrd params)))
|
||||
;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point.
|
||||
;; Use the right file names for KERNEL and INITRD in case
|
||||
;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a
|
||||
@@ -323,36 +341,37 @@ entries corresponding to old generations of the system."
|
||||
#$(grub-root-search device kernel)
|
||||
#$kernel (string-join (list #$@arguments))
|
||||
#$initrd))))
|
||||
(define sugar
|
||||
(eye-candy config
|
||||
(menu-entry-device (first all-entries))
|
||||
(menu-entry-device-mount-point (first all-entries))
|
||||
#:system system
|
||||
#:port #~port))
|
||||
|
||||
(define builder
|
||||
#~(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(format port
|
||||
"# This file was generated from your GuixSD configuration. Any changes
|
||||
(mlet %store-monad ((sugar (eye-candy config
|
||||
(boot-parameters-store-device
|
||||
(first all-entries))
|
||||
(boot-parameters-store-mount-point
|
||||
(first all-entries))
|
||||
#:system system
|
||||
#:port #~port)))
|
||||
(define builder
|
||||
#~(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(format port
|
||||
"# This file was generated from your GuixSD configuration. Any changes
|
||||
# will be lost upon reconfiguration.
|
||||
")
|
||||
#$sugar
|
||||
(format port "
|
||||
#$sugar
|
||||
(format port "
|
||||
set default=~a
|
||||
set timeout=~a~%"
|
||||
#$(bootloader-configuration-default-entry config)
|
||||
#$(bootloader-configuration-timeout config))
|
||||
#$@(map menu-entry->gexp all-entries)
|
||||
#$(bootloader-configuration-default-entry config)
|
||||
#$(bootloader-configuration-timeout config))
|
||||
#$@(map boot-parameters->gexp all-entries)
|
||||
|
||||
#$@(if (pair? old-entries)
|
||||
#~((format port "
|
||||
#$@(if (pair? old-entries)
|
||||
#~((format port "
|
||||
submenu \"GNU system, old configurations...\" {~%")
|
||||
#$@(map menu-entry->gexp old-entries)
|
||||
(format port "}~%"))
|
||||
#~()))))
|
||||
#$@(map boot-parameters->gexp old-entries)
|
||||
(format port "}~%"))
|
||||
#~()))))
|
||||
|
||||
(computed-file "grub.cfg" builder))
|
||||
(gexp->derivation "grub.cfg" builder)))
|
||||
|
||||
|
||||
|
||||
@@ -369,29 +388,10 @@ submenu \"GNU system, old configurations...\" {~%")
|
||||
;; root partition.
|
||||
(setenv "GRUB_ENABLE_CRYPTODISK" "y")
|
||||
|
||||
(unless (zero? (system* grub "--no-floppy" "--target=i386-pc"
|
||||
(unless (zero? (system* grub "--no-floppy"
|
||||
"--boot-directory" install-dir
|
||||
device))
|
||||
(error "failed to install GRUB (BIOS)")))))
|
||||
|
||||
(define install-grub-efi
|
||||
#~(lambda (bootloader efi-dir mount-point)
|
||||
;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the
|
||||
;; system whose root is mounted at MOUNT-POINT.
|
||||
(let ((grub-install (string-append bootloader "/sbin/grub-install"))
|
||||
(install-dir (string-append mount-point "/boot"))
|
||||
;; When installing GuixSD, it's common to mount EFI-DIR below
|
||||
;; MOUNT-POINT rather than /boot/efi on the live image.
|
||||
(target-esp (if (file-exists? (string-append mount-point efi-dir))
|
||||
(string-append mount-point efi-dir)
|
||||
efi-dir)))
|
||||
;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
|
||||
;; root partition.
|
||||
(setenv "GRUB_ENABLE_CRYPTODISK" "y")
|
||||
(unless (zero? (system* grub-install "--boot-directory" install-dir
|
||||
"--bootloader-id=GuixSD"
|
||||
"--efi-directory" target-esp))
|
||||
(error "failed to install GRUB (EFI)")))))
|
||||
(error "failed to install GRUB")))))
|
||||
|
||||
|
||||
|
||||
@@ -410,15 +410,9 @@ submenu \"GNU system, old configurations...\" {~%")
|
||||
(define* grub-efi-bootloader
|
||||
(bootloader
|
||||
(inherit grub-bootloader)
|
||||
(installer install-grub-efi)
|
||||
(name 'grub-efi)
|
||||
(package grub-efi)))
|
||||
|
||||
(define* grub-mkrescue-bootloader
|
||||
(bootloader
|
||||
(inherit grub-efi-bootloader)
|
||||
(package grub-hybrid)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Compatibility macros.
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017 David Craven <david@craven.ch>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;;
|
||||
;;; 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 bootloader u-boot)
|
||||
#:use-module (gnu bootloader extlinux)
|
||||
#:use-module (gnu bootloader)
|
||||
#:use-module (gnu packages bootloaders)
|
||||
#:use-module (guix gexp)
|
||||
#:export (u-boot-bootloader
|
||||
u-boot-a20-olinuxino-lime-bootloader
|
||||
u-boot-a20-olinuxino-lime2-bootloader
|
||||
u-boot-a20-olinuxino-micro-bootloader
|
||||
u-boot-bananapi-m2-ultra-bootloader
|
||||
u-boot-beaglebone-black-bootloader
|
||||
u-boot-mx6cuboxi-bootloader
|
||||
u-boot-nintendo-nes-classic-edition-bootloader
|
||||
u-boot-novena-bootloader
|
||||
u-boot-pine64-plus-bootloader
|
||||
u-boot-pinebook-bootloader
|
||||
u-boot-puma-rk3399-bootloader
|
||||
u-boot-wandboard-bootloader))
|
||||
|
||||
(define install-u-boot
|
||||
#~(lambda (bootloader device mount-point)
|
||||
(if bootloader
|
||||
(error "Failed to install U-Boot"))))
|
||||
|
||||
(define install-beaglebone-black-u-boot
|
||||
;; http://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Upgrading_uBoot
|
||||
;; This first stage bootloader called MLO (U-Boot SPL) is expected at
|
||||
;; 0x20000 by BBB ROM code. The second stage bootloader will be loaded by
|
||||
;; the MLO and is expected at 0x60000. Write both first stage ("MLO") and
|
||||
;; second stage ("u-boot.img") images, read in BOOTLOADER directory, to the
|
||||
;; specified DEVICE.
|
||||
#~(lambda (bootloader device mount-point)
|
||||
(let ((mlo (string-append bootloader "/libexec/MLO"))
|
||||
(u-boot (string-append bootloader "/libexec/u-boot.img")))
|
||||
(write-file-on-device mlo (* 256 512)
|
||||
device (* 256 512))
|
||||
(write-file-on-device u-boot (* 1024 512)
|
||||
device (* 768 512)))))
|
||||
|
||||
(define install-allwinner-u-boot
|
||||
#~(lambda (bootloader device mount-point)
|
||||
(let ((u-boot (string-append bootloader
|
||||
"/libexec/u-boot-sunxi-with-spl.bin")))
|
||||
(write-file-on-device u-boot (stat:size (stat u-boot))
|
||||
device (* 8 1024)))))
|
||||
|
||||
(define install-allwinner64-u-boot
|
||||
#~(lambda (bootloader device mount-point)
|
||||
(let ((spl (string-append bootloader "/libexec/spl/sunxi-spl.bin"))
|
||||
(u-boot (string-append bootloader "/libexec/u-boot.itb")))
|
||||
(write-file-on-device spl (stat:size (stat spl))
|
||||
device (* 8 1024))
|
||||
(write-file-on-device u-boot (stat:size (stat u-boot))
|
||||
device (* 40 1024)))))
|
||||
|
||||
(define install-imx-u-boot
|
||||
#~(lambda (bootloader device mount-point)
|
||||
(let ((spl (string-append bootloader "/libexec/SPL"))
|
||||
(u-boot (string-append bootloader "/libexec/u-boot.img")))
|
||||
(write-file-on-device spl (stat:size (stat spl))
|
||||
device (* 1 1024))
|
||||
(write-file-on-device u-boot (stat:size (stat u-boot))
|
||||
device (* 69 1024)))))
|
||||
|
||||
(define install-puma-rk3399-u-boot
|
||||
#~(lambda (bootloader device mount-point)
|
||||
(let ((spl (string-append bootloader "/libexec/u-boot-spl.rksd"))
|
||||
(u-boot (string-append bootloader "/libexec/u-boot.itb")))
|
||||
(write-file-on-device spl (stat:size (stat spl))
|
||||
device (* 64 512))
|
||||
(write-file-on-device u-boot (stat:size (stat u-boot))
|
||||
device (* 512 512)))))
|
||||
|
||||
|
||||
|
||||
;;;
|
||||
;;; Bootloader definitions.
|
||||
;;;
|
||||
|
||||
(define u-boot-bootloader
|
||||
(bootloader
|
||||
(inherit extlinux-bootloader)
|
||||
(name 'u-boot)
|
||||
(package #f)
|
||||
(installer install-u-boot)))
|
||||
|
||||
(define u-boot-beaglebone-black-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-bootloader)
|
||||
(package u-boot-beagle-bone-black)
|
||||
(installer install-beaglebone-black-u-boot)))
|
||||
|
||||
(define u-boot-allwinner-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-bootloader)
|
||||
(installer install-allwinner-u-boot)))
|
||||
|
||||
(define u-boot-allwinner64-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-bootloader)
|
||||
(installer install-allwinner64-u-boot)))
|
||||
|
||||
(define u-boot-imx-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-bootloader)
|
||||
(installer install-imx-u-boot)))
|
||||
|
||||
(define u-boot-nintendo-nes-classic-edition-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-allwinner-bootloader)
|
||||
(package u-boot-nintendo-nes-classic-edition)))
|
||||
|
||||
(define u-boot-a20-olinuxino-lime-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-allwinner-bootloader)
|
||||
(package u-boot-a20-olinuxino-lime)))
|
||||
|
||||
(define u-boot-a20-olinuxino-lime2-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-allwinner-bootloader)
|
||||
(package u-boot-a20-olinuxino-lime2)))
|
||||
|
||||
(define u-boot-a20-olinuxino-micro-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-allwinner-bootloader)
|
||||
(package u-boot-a20-olinuxino-micro)))
|
||||
|
||||
(define u-boot-bananapi-m2-ultra-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-allwinner-bootloader)
|
||||
(package u-boot-bananapi-m2-ultra)))
|
||||
|
||||
(define u-boot-mx6cuboxi-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-imx-bootloader)
|
||||
(package u-boot-mx6cuboxi)))
|
||||
|
||||
(define u-boot-wandboard-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-imx-bootloader)
|
||||
(package u-boot-wandboard)))
|
||||
|
||||
(define u-boot-novena-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-imx-bootloader)
|
||||
(package u-boot-novena)))
|
||||
|
||||
(define u-boot-pine64-plus-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-allwinner64-bootloader)
|
||||
(package u-boot-pine64-plus)))
|
||||
|
||||
(define u-boot-pinebook-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-allwinner64-bootloader)
|
||||
(package u-boot-pinebook)))
|
||||
|
||||
(define u-boot-puma-rk3399-bootloader
|
||||
(bootloader
|
||||
(inherit u-boot-bootloader)
|
||||
(package u-boot-puma-rk3399)
|
||||
(installer install-puma-rk3399-u-boot)))
|
||||
+22
-14
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
@@ -148,15 +148,11 @@ properties. Return #t on success."
|
||||
`("-G" ,(string-join supplementary-groups ","))
|
||||
'())
|
||||
,@(if comment `("-c" ,comment) '())
|
||||
,@(if home `("-d" ,home) '())
|
||||
|
||||
;; Home directories of non-system accounts are created by
|
||||
;; 'activate-user-home'.
|
||||
,@(if (and home create-home? system?
|
||||
(not (file-exists? home)))
|
||||
'("--create-home")
|
||||
,@(if (and home create-home?)
|
||||
(if (file-exists? home)
|
||||
`("-d" ,home) ; avoid warning from 'useradd'
|
||||
`("-d" ,home "--create-home"))
|
||||
'())
|
||||
|
||||
,@(if shell `("-s" ,shell) '())
|
||||
,@(if password `("-p" ,password) '())
|
||||
,@(if system? '("--system") '())
|
||||
@@ -183,8 +179,7 @@ properties. Return #t on success."
|
||||
`("-G" ,(string-join supplementary-groups ","))
|
||||
'())
|
||||
,@(if comment `("-c" ,comment) '())
|
||||
;; Don't use '--move-home'.
|
||||
,@(if home `("-d" ,home) '())
|
||||
;; Don't use '--move-home', so ignore HOME.
|
||||
,@(if shell `("-s" ,shell) '())
|
||||
,name)))
|
||||
(zero? (apply system* "usermod" args))))
|
||||
@@ -233,7 +228,10 @@ numeric gid or #f."
|
||||
#:supplementary-groups supplementary-groups
|
||||
#:comment comment
|
||||
#:home home
|
||||
#:create-home? create-home?
|
||||
|
||||
;; Home directories of non-system accounts are created by
|
||||
;; 'activate-user-home'.
|
||||
#:create-home? (and create-home? system?)
|
||||
|
||||
#:shell shell
|
||||
#:password password)
|
||||
@@ -315,7 +313,6 @@ they already exist."
|
||||
(false-if-exception (delete-file file)))
|
||||
|
||||
(format #t "populating /etc from ~a...~%" etc)
|
||||
(mkdir-p "/etc")
|
||||
|
||||
;; Create the /etc/ssl -> /run/current-system/profile/etc/ssl symlink. This
|
||||
;; symlink, to a target outside of the store, probably doesn't belong in the
|
||||
@@ -355,13 +352,24 @@ they already exist."
|
||||
;; Place where setuid programs are stored.
|
||||
"/run/setuid-programs")
|
||||
|
||||
(define (link-or-copy source target)
|
||||
"Attempt to make TARGET a hard link to SOURCE; if it fails, fall back to
|
||||
copy SOURCE to TARGET."
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(link source target))
|
||||
(lambda args
|
||||
;; Perhaps SOURCE and TARGET live in a different file system, so copy
|
||||
;; SOURCE.
|
||||
(copy-file source target))))
|
||||
|
||||
(define (activate-setuid-programs programs)
|
||||
"Turn PROGRAMS, a list of file names, into setuid programs stored under
|
||||
%SETUID-DIRECTORY."
|
||||
(define (make-setuid-program prog)
|
||||
(let ((target (string-append %setuid-directory
|
||||
"/" (basename prog))))
|
||||
(copy-file prog target)
|
||||
(link-or-copy prog target)
|
||||
(chown target 0 0)
|
||||
(chmod target #o6555)))
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;;
|
||||
;;; 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 build bootloader)
|
||||
#:use-module (ice-9 binary-ports)
|
||||
#:export (write-file-on-device))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Writing utils.
|
||||
;;;
|
||||
|
||||
(define (write-file-on-device file size device offset)
|
||||
"Write SIZE bytes from FILE to DEVICE starting at OFFSET."
|
||||
(call-with-input-file file
|
||||
(lambda (input)
|
||||
(let ((bv (get-bytevector-n input size)))
|
||||
(call-with-output-file device
|
||||
(lambda (output)
|
||||
(seek output offset SEEK_SET)
|
||||
(put-bytevector output bv))
|
||||
#:binary #t)))))
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
|
||||
;;;
|
||||
@@ -119,7 +119,7 @@ C_*INCLUDE_PATH."
|
||||
;; libc is false, so we are building xgcc-sans-libc.
|
||||
;; Add essential headers from mingw-w64.
|
||||
(let ((mingw-source (assoc-ref inputs "mingw-source")))
|
||||
(invoke "tar" "xvf" mingw-source)
|
||||
(system* "tar" "xvf" mingw-source)
|
||||
(let ((mingw-headers (unpacked-mingw-dir)))
|
||||
;; We need _mingw.h which will gets built from _mingw.h.in by
|
||||
;; mingw-w64's configure. We cannot configure mingw-w64 until we
|
||||
@@ -160,7 +160,7 @@ C_*INCLUDE_PATH."
|
||||
"Install a stripped GCC."
|
||||
;; Unlike our 'strip' phase, this will do the right thing for
|
||||
;; cross-compilers.
|
||||
(invoke "make" "install-strip"))
|
||||
(zero? (system* "make" "install-strip")))
|
||||
|
||||
(define* (cross-gcc-build-phases target
|
||||
#:optional (phases %standard-phases))
|
||||
|
||||
+216
-96
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;;
|
||||
@@ -19,16 +19,15 @@
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gnu build file-systems)
|
||||
#:use-module (gnu system uuid)
|
||||
#:use-module (gnu system file-systems)
|
||||
#:use-module (guix build utils)
|
||||
#:use-module (guix build bournish)
|
||||
#:use-module ((guix build syscalls)
|
||||
#:hide (file-system-type))
|
||||
#:use-module (guix build syscalls)
|
||||
#:use-module (rnrs io ports)
|
||||
#:use-module (rnrs bytevectors)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 rdelim)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (ice-9 regex)
|
||||
#:use-module (system foreign)
|
||||
#:autoload (system repl repl) (start-repl)
|
||||
#:use-module (srfi srfi-1)
|
||||
@@ -42,6 +41,15 @@
|
||||
find-partition-by-luks-uuid
|
||||
canonicalize-device-spec
|
||||
|
||||
uuid->string
|
||||
string->uuid
|
||||
string->iso9660-uuid
|
||||
string->ext2-uuid
|
||||
string->ext3-uuid
|
||||
string->ext4-uuid
|
||||
string->btrfs-uuid
|
||||
iso9660-uuid->string
|
||||
|
||||
bind-mount
|
||||
|
||||
mount-flags->bit-mask
|
||||
@@ -87,6 +95,20 @@ takes a bytevector and returns #t when it's a valid superblock."
|
||||
(and (magic? block)
|
||||
block)))))))))
|
||||
|
||||
(define (sub-bytevector bv start size)
|
||||
"Return a copy of the SIZE bytes of BV starting from offset START."
|
||||
(let ((result (make-bytevector size)))
|
||||
(bytevector-copy! bv start result 0 size)
|
||||
result))
|
||||
|
||||
(define (latin1->string bv terminator)
|
||||
"Return a string of BV, a latin1 bytevector, or #f. TERMINATOR is a predicate
|
||||
that takes a number and returns #t when a termination character is found."
|
||||
(let ((bytes (take-while (negate terminator) (bytevector->u8-list bv))))
|
||||
(if (null? bytes)
|
||||
#f
|
||||
(list->string (map integer->char bytes)))))
|
||||
|
||||
(define null-terminated-latin1->string
|
||||
(cut latin1->string <> zero?))
|
||||
|
||||
@@ -174,6 +196,10 @@ if DEVICE does not contain a btrfs file system."
|
||||
|
||||
;; <http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-107.pdf>.
|
||||
|
||||
(define-syntax %fat32-endianness
|
||||
;; Endianness of fat file systems.
|
||||
(identifier-syntax (endianness little)))
|
||||
|
||||
(define (fat32-superblock? sblock)
|
||||
"Return #t when SBLOCK is a fat32 superblock."
|
||||
(bytevector=? (sub-bytevector sblock 82 8)
|
||||
@@ -188,13 +214,19 @@ if DEVICE does not contain a btrfs file system."
|
||||
"Return the Volume ID of a fat superblock SBLOCK as a 4-byte bytevector."
|
||||
(sub-bytevector sblock 67 4))
|
||||
|
||||
(define (fat32-uuid->string uuid)
|
||||
"Convert fat32 UUID, a 4-byte bytevector, to its string representation."
|
||||
(let ((high (bytevector-uint-ref uuid 0 %fat32-endianness 2))
|
||||
(low (bytevector-uint-ref uuid 2 %fat32-endianness 2)))
|
||||
(format #f "~:@(~x-~x~)" low high)))
|
||||
|
||||
(define (fat32-superblock-volume-name sblock)
|
||||
"Return the volume name of SBLOCK as a string of at most 11 characters, or
|
||||
#f if SBLOCK has no volume name. The volume name is a latin1 string.
|
||||
Trailing spaces are trimmed."
|
||||
(string-trim-right (latin1->string (sub-bytevector sblock 71 11) (lambda (c) #f)) #\space))
|
||||
|
||||
(define (check-fat-file-system device)
|
||||
(define (check-fat32-file-system device)
|
||||
"Return the health of a fat file system on DEVICE."
|
||||
(match (status:exit-val
|
||||
(system* "fsck.vfat" "-v" "-a" device))
|
||||
@@ -202,33 +234,6 @@ Trailing spaces are trimmed."
|
||||
(1 'errors-corrected)
|
||||
(_ 'fatal-error)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; FAT16 file systems.
|
||||
;;;
|
||||
|
||||
(define (fat16-superblock? sblock)
|
||||
"Return #t when SBLOCK is a fat16 boot record."
|
||||
(bytevector=? (sub-bytevector sblock 54 8)
|
||||
(string->utf8 "FAT16 ")))
|
||||
|
||||
(define (read-fat16-superblock device)
|
||||
"Return the raw contents of DEVICE's fat16 superblock as a bytevector, or
|
||||
#f if DEVICE does not contain a fat16 file system."
|
||||
(read-superblock device 0 62 fat16-superblock?))
|
||||
|
||||
(define (fat16-superblock-uuid sblock)
|
||||
"Return the Volume ID of a fat superblock SBLOCK as a 4-byte bytevector."
|
||||
(sub-bytevector sblock 39 4))
|
||||
|
||||
(define (fat16-superblock-volume-name sblock)
|
||||
"Return the volume name of SBLOCK as a string of at most 11 characters, or
|
||||
#f if SBLOCK has no volume name. The volume name is a latin1 string.
|
||||
Trailing spaces are trimmed."
|
||||
(string-trim-right (latin1->string (sub-bytevector sblock 43 11)
|
||||
(lambda (c) #f))
|
||||
#\space))
|
||||
|
||||
|
||||
;;;
|
||||
;;; ISO9660 file systems.
|
||||
@@ -236,6 +241,27 @@ Trailing spaces are trimmed."
|
||||
|
||||
;; <http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf>.
|
||||
|
||||
(define %iso9660-uuid-rx
|
||||
;; Y m d H M S ss
|
||||
(make-regexp "^([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2})-([[:digit:]]{2})-([[:digit:]]{2})-([[:digit:]]{2})-([[:digit:]]{2})$"))
|
||||
|
||||
(define (string->iso9660-uuid str)
|
||||
"Parse STR as a ISO9660 UUID (which is really a timestamp - see /dev/disk/by-uuid).
|
||||
Return its contents as a 16-byte bytevector. Return #f if STR is not a valid
|
||||
ISO9660 UUID representation."
|
||||
(and=> (regexp-exec %iso9660-uuid-rx str)
|
||||
(lambda (match)
|
||||
(letrec-syntax ((match-numerals
|
||||
(syntax-rules ()
|
||||
((_ index (name rest ...) body)
|
||||
(let ((name (match:substring match index)))
|
||||
(match-numerals (+ 1 index) (rest ...) body)))
|
||||
((_ index () body)
|
||||
body))))
|
||||
(match-numerals 1 (year month day hour minute second hundredths)
|
||||
(string->utf8 (string-append year month day
|
||||
hour minute second hundredths)))))))
|
||||
|
||||
(define (iso9660-superblock? sblock)
|
||||
"Return #t when SBLOCK is an iso9660 volume descriptor."
|
||||
(bytevector=? (sub-bytevector sblock 1 6)
|
||||
@@ -261,11 +287,11 @@ volume descriptor from ~s"
|
||||
"Return the raw contents of DEVICE's iso9660 primary volume descriptor
|
||||
as a bytevector, or #f if DEVICE does not contain an iso9660 file system."
|
||||
;; Start reading at sector 16.
|
||||
;; Since we are not sure that the device contains an ISO9660 file system,
|
||||
;; Since we are not sure that the device contains an ISO9660 filesystem,
|
||||
;; we have to find that out first.
|
||||
(if (read-superblock device (* 2048 16) 2048 iso9660-superblock?)
|
||||
(read-iso9660-primary-volume-descriptor device (* 2048 16))
|
||||
#f)) ; Device does not contain an iso9660 file system.
|
||||
#f)) ; Device does not contain an iso9660 filesystem.
|
||||
|
||||
(define (iso9660-superblock-uuid sblock)
|
||||
"Return the modification time of an iso9660 primary volume descriptor
|
||||
@@ -282,6 +308,20 @@ SBLOCK as a bytevector. If that's not set, returns the creation time."
|
||||
modification-time)))
|
||||
(sub-bytevector time 0 16))) ; strips GMT offset.
|
||||
|
||||
(define (iso9660-uuid->string uuid)
|
||||
"Given an UUID bytevector, return its timestamp string."
|
||||
(define (digits->string bytes)
|
||||
(latin1->string bytes (lambda (c) #f)))
|
||||
(let* ((year (sub-bytevector uuid 0 4))
|
||||
(month (sub-bytevector uuid 4 2))
|
||||
(day (sub-bytevector uuid 6 2))
|
||||
(hour (sub-bytevector uuid 8 2))
|
||||
(minute (sub-bytevector uuid 10 2))
|
||||
(second (sub-bytevector uuid 12 2))
|
||||
(hundredths (sub-bytevector uuid 14 2))
|
||||
(parts (list year month day hour minute second hundredths)))
|
||||
(string-append (string-join (map digits->string parts) "-"))))
|
||||
|
||||
(define (iso9660-superblock-volume-name sblock)
|
||||
"Return the volume name of SBLOCK as a string. The volume name is an ASCII
|
||||
string. Trailing spaces are trimmed."
|
||||
@@ -333,16 +373,15 @@ not valid header was found."
|
||||
|
||||
(define (disk-partitions)
|
||||
"Return the list of device names corresponding to valid disk partitions."
|
||||
(define (last-character str)
|
||||
(string-ref str (- (string-length str) 1)))
|
||||
|
||||
(define (partition? name major minor)
|
||||
;; grub-mkrescue does some funny things for EFI support which
|
||||
;; makes it a lot more difficult than one would expect to support
|
||||
;; booting an ISO-9660 image from an USB flash drive.
|
||||
;; For example there's a buggy (too small) hidden partition in it
|
||||
;; which Linux mounts and then proceeds to fail while trying to
|
||||
;; fall off the edge.
|
||||
;; In any case, partition tables are supposed to be optional so
|
||||
;; here we allow checking entire disks for file systems, too.
|
||||
(> major 2)) ;ignore RAM disks and floppy disks
|
||||
;; Select device names that end in a digit, like libblkid's 'probe_all'
|
||||
;; function does. Checking for "/sys/dev/block/MAJOR:MINOR/partition"
|
||||
;; doesn't work for partitions coming from mapped devices.
|
||||
(and (char-set-contains? char-set:digit (last-character name))
|
||||
(> major 2))) ;ignore RAM disks and floppy disks
|
||||
|
||||
(call-with-input-file "/proc/partitions"
|
||||
(lambda (port)
|
||||
@@ -413,9 +452,7 @@ partition field reader that returned a value."
|
||||
(partition-field-reader read-btrfs-superblock
|
||||
btrfs-superblock-volume-name)
|
||||
(partition-field-reader read-fat32-superblock
|
||||
fat32-superblock-volume-name)
|
||||
(partition-field-reader read-fat16-superblock
|
||||
fat16-superblock-volume-name)))
|
||||
fat32-superblock-volume-name)))
|
||||
|
||||
(define %partition-uuid-readers
|
||||
(list (partition-field-reader read-iso9660-superblock
|
||||
@@ -425,9 +462,7 @@ partition field reader that returned a value."
|
||||
(partition-field-reader read-btrfs-superblock
|
||||
btrfs-superblock-uuid)
|
||||
(partition-field-reader read-fat32-superblock
|
||||
fat32-superblock-uuid)
|
||||
(partition-field-reader read-fat16-superblock
|
||||
fat16-superblock-uuid)))
|
||||
fat32-superblock-uuid)))
|
||||
|
||||
(define read-partition-label
|
||||
(cut read-partition-field <> %partition-label-readers))
|
||||
@@ -448,12 +483,12 @@ was READ is = to the given value."
|
||||
(partition-predicate read-partition-label string=?))
|
||||
|
||||
(define partition-uuid-predicate
|
||||
(partition-predicate read-partition-uuid uuid=?))
|
||||
(partition-predicate read-partition-uuid bytevector=?))
|
||||
|
||||
(define luks-partition-uuid-predicate
|
||||
(partition-predicate
|
||||
(partition-field-reader read-luks-header luks-header-uuid)
|
||||
uuid=?))
|
||||
bytevector=?))
|
||||
|
||||
(define (find-partition predicate)
|
||||
"Return the first partition found that matches PREDICATE, or #f if none
|
||||
@@ -473,9 +508,77 @@ were found."
|
||||
(find-partition luks-partition-uuid-predicate))
|
||||
|
||||
|
||||
(define (canonicalize-device-spec spec)
|
||||
"Return the device name corresponding to SPEC, which can be a <uuid>, a
|
||||
<file-system-label>, or a string (typically a /dev file name)."
|
||||
;;;
|
||||
;;; UUIDs.
|
||||
;;;
|
||||
|
||||
(define-syntax %network-byte-order
|
||||
(identifier-syntax (endianness big)))
|
||||
|
||||
(define (uuid->string uuid)
|
||||
"Convert UUID, a 16-byte bytevector, to its string representation, something
|
||||
like \"6b700d61-5550-48a1-874c-a3d86998990e\"."
|
||||
;; See <https://tools.ietf.org/html/rfc4122>.
|
||||
(let ((time-low (bytevector-uint-ref uuid 0 %network-byte-order 4))
|
||||
(time-mid (bytevector-uint-ref uuid 4 %network-byte-order 2))
|
||||
(time-hi (bytevector-uint-ref uuid 6 %network-byte-order 2))
|
||||
(clock-seq (bytevector-uint-ref uuid 8 %network-byte-order 2))
|
||||
(node (bytevector-uint-ref uuid 10 %network-byte-order 6)))
|
||||
(format #f "~8,'0x-~4,'0x-~4,'0x-~4,'0x-~12,'0x"
|
||||
time-low time-mid time-hi clock-seq node)))
|
||||
|
||||
(define %uuid-rx
|
||||
;; The regexp of a UUID.
|
||||
(make-regexp "^([[:xdigit:]]{8})-([[:xdigit:]]{4})-([[:xdigit:]]{4})-([[:xdigit:]]{4})-([[:xdigit:]]{12})$"))
|
||||
|
||||
(define (string->uuid str)
|
||||
"Parse STR as a DCE UUID (see <https://tools.ietf.org/html/rfc4122>) and
|
||||
return its contents as a 16-byte bytevector. Return #f if STR is not a valid
|
||||
UUID representation."
|
||||
(and=> (regexp-exec %uuid-rx str)
|
||||
(lambda (match)
|
||||
(letrec-syntax ((hex->number
|
||||
(syntax-rules ()
|
||||
((_ index)
|
||||
(string->number (match:substring match index)
|
||||
16))))
|
||||
(put!
|
||||
(syntax-rules ()
|
||||
((_ bv index (number len) rest ...)
|
||||
(begin
|
||||
(bytevector-uint-set! bv index number
|
||||
(endianness big) len)
|
||||
(put! bv (+ index len) rest ...)))
|
||||
((_ bv index)
|
||||
bv))))
|
||||
(let ((time-low (hex->number 1))
|
||||
(time-mid (hex->number 2))
|
||||
(time-hi (hex->number 3))
|
||||
(clock-seq (hex->number 4))
|
||||
(node (hex->number 5))
|
||||
(uuid (make-bytevector 16)))
|
||||
(put! uuid 0
|
||||
(time-low 4) (time-mid 2) (time-hi 2)
|
||||
(clock-seq 2) (node 6)))))))
|
||||
|
||||
(define string->ext2-uuid string->uuid)
|
||||
(define string->ext3-uuid string->uuid)
|
||||
(define string->ext4-uuid string->uuid)
|
||||
(define string->btrfs-uuid string->uuid)
|
||||
|
||||
|
||||
(define* (canonicalize-device-spec spec #:optional (title 'any))
|
||||
"Return the device name corresponding to SPEC. TITLE is a symbol, one of
|
||||
the following:
|
||||
|
||||
• 'device', in which case SPEC is known to designate a device node--e.g.,
|
||||
\"/dev/sda1\";
|
||||
• 'label', in which case SPEC is known to designate a partition label--e.g.,
|
||||
\"my-root-part\";
|
||||
• 'uuid', in which case SPEC must be a UUID (a 16-byte bytevector)
|
||||
designating a partition;
|
||||
• 'any', in which case SPEC can be anything.
|
||||
"
|
||||
(define max-trials
|
||||
;; Number of times we retry partition label resolution, 1 second per
|
||||
;; trial. Note: somebody reported a delay of 16 seconds (!) before their
|
||||
@@ -483,6 +586,19 @@ were found."
|
||||
;; this long.
|
||||
20)
|
||||
|
||||
(define canonical-title
|
||||
;; The realm of canonicalization.
|
||||
(if (eq? title 'any)
|
||||
(if (string? spec)
|
||||
;; The "--root=SPEC" kernel command-line option always provides a
|
||||
;; string, but the string can represent a device, a UUID, or a
|
||||
;; label. So check for all three.
|
||||
(cond ((string-prefix? "/" spec) 'device)
|
||||
((string->uuid spec) 'uuid)
|
||||
(else 'label))
|
||||
'uuid)
|
||||
title))
|
||||
|
||||
(define (resolve find-partition spec fmt)
|
||||
(let loop ((count 0))
|
||||
(let ((device (find-partition spec)))
|
||||
@@ -497,19 +613,21 @@ were found."
|
||||
(sleep 1)
|
||||
(loop (+ 1 count))))))))
|
||||
|
||||
(match spec
|
||||
((? string?)
|
||||
;; Nothing to do, but wait until SPEC shows up.
|
||||
(resolve identity spec identity))
|
||||
((? file-system-label?)
|
||||
(case canonical-title
|
||||
((device)
|
||||
;; Nothing to do.
|
||||
spec)
|
||||
((label)
|
||||
;; Resolve the label.
|
||||
(resolve find-partition-by-label
|
||||
(file-system-label->string spec)
|
||||
identity))
|
||||
((? uuid?)
|
||||
(resolve find-partition-by-label spec identity))
|
||||
((uuid)
|
||||
(resolve find-partition-by-uuid
|
||||
(uuid-bytevector spec)
|
||||
uuid->string))))
|
||||
(if (string? spec)
|
||||
(string->uuid spec)
|
||||
spec)
|
||||
uuid->string))
|
||||
(else
|
||||
(error "unknown device title" title))))
|
||||
|
||||
(define (check-file-system device type)
|
||||
"Run a file system check of TYPE on DEVICE."
|
||||
@@ -517,7 +635,7 @@ were found."
|
||||
(cond
|
||||
((string-prefix? "ext" type) check-ext2-file-system)
|
||||
((string-prefix? "btrfs" type) check-btrfs-file-system)
|
||||
((string-suffix? "fat" type) check-fat-file-system)
|
||||
((string-suffix? "fat" type) check-fat32-file-system)
|
||||
(else #f)))
|
||||
|
||||
(if check-procedure
|
||||
@@ -561,8 +679,11 @@ corresponds to the symbols listed in FLAGS."
|
||||
(()
|
||||
0))))
|
||||
|
||||
(define* (mount-file-system fs #:key (root "/root"))
|
||||
"Mount the file system described by FS, a <file-system> object, under ROOT.
|
||||
(define* (mount-file-system spec #:key (root "/root"))
|
||||
"Mount the file system described by SPEC under ROOT. SPEC must have the
|
||||
form:
|
||||
|
||||
(DEVICE TITLE MOUNT-POINT TYPE (FLAGS ...) OPTIONS CHECK?)
|
||||
|
||||
DEVICE, MOUNT-POINT, and TYPE must be strings; OPTIONS can be a string or #f;
|
||||
FLAGS must be a list of symbols. CHECK? is a Boolean indicating whether to
|
||||
@@ -588,35 +709,34 @@ run a file system check."
|
||||
(if options
|
||||
(string-append "," options)
|
||||
"")))))
|
||||
(let ((type (file-system-type fs))
|
||||
(options (file-system-options fs))
|
||||
(source (canonicalize-device-spec (file-system-device fs)))
|
||||
(mount-point (string-append root "/"
|
||||
(file-system-mount-point fs)))
|
||||
(flags (mount-flags->bit-mask (file-system-flags fs))))
|
||||
(when (file-system-check? fs)
|
||||
(check-file-system source type))
|
||||
(match spec
|
||||
((source title mount-point type (flags ...) options check?)
|
||||
(let ((source (canonicalize-device-spec source title))
|
||||
(mount-point (string-append root "/" mount-point))
|
||||
(flags (mount-flags->bit-mask flags)))
|
||||
(when check?
|
||||
(check-file-system source type))
|
||||
|
||||
;; Create the mount point. Most of the time this is a directory, but
|
||||
;; in the case of a bind mount, a regular file or socket may be needed.
|
||||
(if (and (= MS_BIND (logand flags MS_BIND))
|
||||
(not (file-is-directory? source)))
|
||||
(unless (file-exists? mount-point)
|
||||
(mkdir-p (dirname mount-point))
|
||||
(call-with-output-file mount-point (const #t)))
|
||||
(mkdir-p mount-point))
|
||||
;; Create the mount point. Most of the time this is a directory, but
|
||||
;; in the case of a bind mount, a regular file or socket may be needed.
|
||||
(if (and (= MS_BIND (logand flags MS_BIND))
|
||||
(not (file-is-directory? source)))
|
||||
(unless (file-exists? mount-point)
|
||||
(mkdir-p (dirname mount-point))
|
||||
(call-with-output-file mount-point (const #t)))
|
||||
(mkdir-p mount-point))
|
||||
|
||||
(cond
|
||||
((string-prefix? "nfs" type)
|
||||
(mount-nfs source mount-point type flags options))
|
||||
(else
|
||||
(mount source mount-point type flags options)))
|
||||
(cond
|
||||
((string-prefix? "nfs" type)
|
||||
(mount-nfs source mount-point type flags options))
|
||||
(else
|
||||
(mount source mount-point type flags options)))
|
||||
|
||||
;; For read-only bind mounts, an extra remount is needed, as per
|
||||
;; <http://lwn.net/Articles/281157/>, which still applies to Linux 4.0.
|
||||
(when (and (= MS_BIND (logand flags MS_BIND))
|
||||
(= MS_RDONLY (logand flags MS_RDONLY)))
|
||||
(let ((flags (logior MS_BIND MS_REMOUNT MS_RDONLY)))
|
||||
(mount source mount-point type flags #f)))))
|
||||
;; For read-only bind mounts, an extra remount is needed, as per
|
||||
;; <http://lwn.net/Articles/281157/>, which still applies to Linux 4.0.
|
||||
(when (and (= MS_BIND (logand flags MS_BIND))
|
||||
(= MS_RDONLY (logand flags MS_RDONLY)))
|
||||
(let ((flags (logior MS_BIND MS_REMOUNT MS_RDONLY)))
|
||||
(mount source mount-point type flags #f)))))))
|
||||
|
||||
;;; file-systems.scm ends here
|
||||
|
||||
+57
-51
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
@@ -25,8 +25,8 @@
|
||||
#:export (install-boot-config
|
||||
evaluate-populate-directive
|
||||
populate-root-file-system
|
||||
reset-timestamps
|
||||
register-closure
|
||||
install-database-and-gc-roots
|
||||
populate-single-profile-directory))
|
||||
|
||||
;;; Commentary:
|
||||
@@ -110,6 +110,9 @@ STORE."
|
||||
|
||||
("/var/guix/gcroots/booted-system" -> "/run/booted-system")
|
||||
("/var/guix/gcroots/current-system" -> "/run/current-system")
|
||||
|
||||
;; XXX: 'guix-register' creates this symlink with a wrong target, so
|
||||
;; create it upfront to be sure.
|
||||
("/var/guix/gcroots/profiles" -> "/var/guix/profiles")
|
||||
|
||||
(directory "/bin")
|
||||
@@ -141,53 +144,51 @@ includes /etc, /var, /run, /bin/sh, etc., and all the symlinks to SYSTEM."
|
||||
(try))
|
||||
(apply throw args)))))))
|
||||
|
||||
(define %root-profile
|
||||
"/var/guix/profiles/per-user/root")
|
||||
(define (reset-timestamps directory)
|
||||
"Reset the timestamps of all the files under DIRECTORY, so that they appear
|
||||
as created and modified at the Epoch."
|
||||
(display "clearing file timestamps...\n")
|
||||
(for-each (lambda (file)
|
||||
(let ((s (lstat file)))
|
||||
;; XXX: Guile uses libc's 'utime' function (not 'futime'), so
|
||||
;; the timestamp of symlinks cannot be changed, and there are
|
||||
;; symlinks here pointing to /gnu/store, which is the host,
|
||||
;; read-only store.
|
||||
(unless (eq? (stat:type s) 'symlink)
|
||||
(utime file 0 0 0 0))))
|
||||
(find-files directory #:directories? #t)))
|
||||
|
||||
(define* (install-database-and-gc-roots root database profile
|
||||
#:key (profile-name "guix-profile"))
|
||||
"Install DATABASE, the store database, under directory ROOT. Create
|
||||
PROFILE-NAME and have it link to PROFILE, a store item."
|
||||
(define (scope file)
|
||||
(string-append root "/" file))
|
||||
|
||||
(define (mkdir-p* dir)
|
||||
(mkdir-p (scope dir)))
|
||||
|
||||
(define (symlink* old new)
|
||||
(symlink old (scope new)))
|
||||
|
||||
(install-file database (scope "/var/guix/db/"))
|
||||
(chmod (scope "/var/guix/db/db.sqlite") #o644)
|
||||
(mkdir-p* "/var/guix/profiles")
|
||||
(mkdir-p* "/var/guix/gcroots")
|
||||
(symlink* "/var/guix/profiles" "/var/guix/gcroots/profiles")
|
||||
|
||||
;; Make root's profile, which makes it a GC root.
|
||||
(mkdir-p* %root-profile)
|
||||
(symlink* profile
|
||||
(string-append %root-profile "/" profile-name "-1-link"))
|
||||
(symlink* (string-append profile-name "-1-link")
|
||||
(string-append %root-profile "/" profile-name)))
|
||||
(define* (register-closure store closure
|
||||
#:key (deduplicate? #t))
|
||||
"Register CLOSURE in STORE, where STORE is the directory name of the target
|
||||
store and CLOSURE is the name of a file containing a reference graph as used
|
||||
by 'guix-register'. As a side effect, this resets timestamps on store files
|
||||
and, if DEDUPLICATE? is true, deduplicates files common to CLOSURE and the
|
||||
rest of STORE."
|
||||
(let ((status (apply system* "guix-register" "--prefix" store
|
||||
(append (if deduplicate? '() '("--no-deduplication"))
|
||||
(list closure)))))
|
||||
(unless (zero? status)
|
||||
(error "failed to register store items" closure))))
|
||||
|
||||
(define* (populate-single-profile-directory directory
|
||||
#:key profile closure
|
||||
(profile-name "guix-profile")
|
||||
database)
|
||||
deduplicate?
|
||||
register?)
|
||||
"Populate DIRECTORY with a store containing PROFILE, whose closure is given
|
||||
in the file called CLOSURE (as generated by #:references-graphs.) DIRECTORY
|
||||
is initialized to contain a single profile under /root pointing to PROFILE.
|
||||
|
||||
When DATABASE is true, copy it to DIRECTORY/var/guix/db and create
|
||||
DIRECTORY/var/guix/gcroots and friends.
|
||||
|
||||
PROFILE-NAME is the name of the profile being created under
|
||||
/var/guix/profiles, typically either \"guix-profile\" or \"current-guix\".
|
||||
When REGISTER? is true, initialize DIRECTORY/var/guix/db to reflect the
|
||||
contents of the store; DEDUPLICATE? determines whether to deduplicate files in
|
||||
the store.
|
||||
|
||||
This is used to create the self-contained tarballs with 'guix pack'."
|
||||
(define (scope file)
|
||||
(string-append directory "/" file))
|
||||
|
||||
(define %root-profile
|
||||
"/var/guix/profiles/per-user/root")
|
||||
|
||||
(define (mkdir-p* dir)
|
||||
(mkdir-p (scope dir)))
|
||||
|
||||
@@ -197,20 +198,25 @@ This is used to create the self-contained tarballs with 'guix pack'."
|
||||
;; Populate the store.
|
||||
(populate-store (list closure) directory)
|
||||
|
||||
(when database
|
||||
(install-database-and-gc-roots directory database profile
|
||||
#:profile-name profile-name))
|
||||
(when register?
|
||||
(register-closure (canonicalize-path directory) closure
|
||||
#:deduplicate? deduplicate?)
|
||||
|
||||
(match profile-name
|
||||
("guix-profile"
|
||||
(mkdir-p* "/root")
|
||||
(symlink* (string-append %root-profile "/guix-profile")
|
||||
"/root/.guix-profile"))
|
||||
("current-guix"
|
||||
(mkdir-p* "/root/.config/guix")
|
||||
(symlink* (string-append %root-profile "/current-guix")
|
||||
"/root/.config/guix/current"))
|
||||
(_
|
||||
#t)))
|
||||
;; XXX: 'guix-register' registers profiles as GC roots but the symlink
|
||||
;; target uses $TMPDIR. Fix that.
|
||||
(delete-file (scope "/var/guix/gcroots/profiles"))
|
||||
(symlink* "/var/guix/profiles"
|
||||
"/var/guix/gcroots/profiles"))
|
||||
|
||||
;; Make root's profile, which makes it a GC root.
|
||||
(mkdir-p* %root-profile)
|
||||
(symlink* profile
|
||||
(string-append %root-profile "/guix-profile-1-link"))
|
||||
(symlink* (string-append %root-profile "/guix-profile-1-link")
|
||||
(string-append %root-profile "/guix-profile"))
|
||||
|
||||
(mkdir-p* "/root")
|
||||
(symlink* (string-append %root-profile "/guix-profile")
|
||||
"/root/.guix-profile"))
|
||||
|
||||
;;; install.scm ends here
|
||||
|
||||
+47
-158
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
@@ -21,27 +21,22 @@
|
||||
#:use-module (rnrs io ports)
|
||||
#:use-module (system repl error-handling)
|
||||
#:autoload (system repl repl) (start-repl)
|
||||
#:autoload (system base compile) (compile-file)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 rdelim)
|
||||
#:use-module (ice-9 regex)
|
||||
#:use-module (ice-9 ftw)
|
||||
#:use-module (guix build utils)
|
||||
#:use-module ((guix build syscalls)
|
||||
#:hide (file-system-type))
|
||||
#:use-module (guix build syscalls)
|
||||
#:use-module (gnu build linux-modules)
|
||||
#:use-module (gnu build file-systems)
|
||||
#:use-module (gnu system file-systems)
|
||||
#:export (mount-essential-file-systems
|
||||
linux-command-line
|
||||
find-long-option
|
||||
find-long-options
|
||||
make-essential-device-nodes
|
||||
make-static-device-nodes
|
||||
configure-qemu-networking
|
||||
|
||||
bind-mount
|
||||
device-number
|
||||
boot-system))
|
||||
|
||||
@@ -99,16 +94,6 @@ Return the value associated with OPTION, or #f on failure."
|
||||
(lambda (arg)
|
||||
(substring arg (+ 1 (string-index arg #\=)))))))
|
||||
|
||||
(define (find-long-options option arguments)
|
||||
"Find OPTIONs among ARGUMENTS, where OPTION is something like \"console\".
|
||||
Return the values associated with OPTIONs as a list, or the empty list if
|
||||
OPTION doesn't appear in ARGUMENTS."
|
||||
(let ((opt (string-append option "=")))
|
||||
(filter-map (lambda (arg)
|
||||
(and (string-prefix? opt arg)
|
||||
(substring arg (+ 1 (string-index arg #\=)))))
|
||||
arguments)))
|
||||
|
||||
(define* (make-disk-device-nodes base major #:optional (minor 0))
|
||||
"Make the block device nodes around BASE (something like \"/root/dev/sda\")
|
||||
with the given MAJOR number, starting with MINOR."
|
||||
@@ -119,109 +104,6 @@ with the given MAJOR number, starting with MINOR."
|
||||
'block-special #o644 (device-number major (+ minor i)))
|
||||
(loop (+ i 1)))))
|
||||
|
||||
;; Representation of a /dev node.
|
||||
(define-record-type <device-node>
|
||||
(device-node name type major minor module)
|
||||
device-node?
|
||||
(name device-node-name)
|
||||
(type device-node-type)
|
||||
(major device-node-major)
|
||||
(minor device-node-minor)
|
||||
(module device-node-module))
|
||||
|
||||
(define (read-static-device-nodes port)
|
||||
"Read from PORT a list of <device-node> written in the format used by
|
||||
/lib/modules/*/*.devname files."
|
||||
(let loop ((line (read-line port)))
|
||||
(if (eof-object? line)
|
||||
'()
|
||||
(match (string-split line #\space)
|
||||
(((? (cut string-prefix? "#" <>)) _ ...)
|
||||
(loop (read-line port)))
|
||||
((module-name device-name device-spec)
|
||||
(let* ((device-parts
|
||||
(string-match "([bc])([0-9][0-9]*):([0-9][0-9]*)"
|
||||
device-spec))
|
||||
(type-string (match:substring device-parts 1))
|
||||
(type (match type-string
|
||||
("c" 'char-special)
|
||||
("b" 'block-special)))
|
||||
(major-string (match:substring device-parts 2))
|
||||
(major (string->number major-string 10))
|
||||
(minor-string (match:substring device-parts 3))
|
||||
(minor (string->number minor-string 10)))
|
||||
(cons (device-node device-name type major minor module-name)
|
||||
(loop (read-line port)))))
|
||||
(_
|
||||
(begin
|
||||
(format (current-error-port)
|
||||
"read-static-device-nodes: ignored devname line '~a'~%" line)
|
||||
(loop (read-line port))))))))
|
||||
|
||||
(define* (mkdir-p* dir #:optional (mode #o755))
|
||||
"This is a variant of 'mkdir-p' that works around
|
||||
<http://bugs.gnu.org/24659> by passing MODE explicitly in each 'mkdir' call."
|
||||
(define absolute?
|
||||
(string-prefix? "/" dir))
|
||||
|
||||
(define not-slash
|
||||
(char-set-complement (char-set #\/)))
|
||||
|
||||
(let loop ((components (string-tokenize dir not-slash))
|
||||
(root (if absolute?
|
||||
""
|
||||
".")))
|
||||
(match components
|
||||
((head tail ...)
|
||||
(let ((path (string-append root "/" head)))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(mkdir path mode)
|
||||
(loop tail path))
|
||||
(lambda args
|
||||
(if (= EEXIST (system-error-errno args))
|
||||
(loop tail path)
|
||||
(apply throw args))))))
|
||||
(() #t))))
|
||||
|
||||
(define (report-system-error name . args)
|
||||
"Report a system error for the file NAME."
|
||||
(let ((errno (system-error-errno args)))
|
||||
(format (current-error-port) "could not create '~a': ~a~%" name
|
||||
(strerror errno))))
|
||||
|
||||
;; Catch a system-error, log it and don't die from it.
|
||||
(define-syntax-rule (catch-system-error name exp)
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
exp)
|
||||
(lambda args
|
||||
(apply report-system-error name args))))
|
||||
|
||||
;; Create a device node like the <device-node> passed here on the file system.
|
||||
(define create-device-node
|
||||
(match-lambda
|
||||
(($ <device-node> xname type major minor module)
|
||||
(let ((name (string-append "/dev/" xname)))
|
||||
(mkdir-p* (dirname name))
|
||||
(catch-system-error name
|
||||
(mknod name type #o600 (device-number major minor)))))))
|
||||
|
||||
(define* (make-static-device-nodes linux-release-module-directory)
|
||||
"Create static device nodes required by the given Linux release.
|
||||
This is required in order to solve a chicken-or-egg problem:
|
||||
The Linux kernel has a feature to autoload modules when a device is first
|
||||
accessed.
|
||||
And udev has a feature to set the permissions of static nodes correctly
|
||||
when it is starting up and also to automatically create nodes when hardware
|
||||
is hotplugged. That leaves universal device files which are not linked to
|
||||
one specific hardware device. These we have to create."
|
||||
(let ((devname-name (string-append linux-release-module-directory "/"
|
||||
"modules.devname")))
|
||||
(for-each create-device-node
|
||||
(call-with-input-file devname-name
|
||||
read-static-device-nodes))))
|
||||
|
||||
(define* (make-essential-device-nodes #:key (root "/"))
|
||||
"Make essential device nodes under ROOT/dev."
|
||||
;; The hand-made devtmpfs/udev!
|
||||
@@ -357,10 +239,20 @@ the last argument of `mknod'."
|
||||
(filter-map string->number (scandir "/proc")))))
|
||||
|
||||
(define* (mount-root-file-system root type
|
||||
#:key volatile-root?)
|
||||
#:key volatile-root? (unionfs "unionfs"))
|
||||
"Mount the root file system of type TYPE at device ROOT. If VOLATILE-ROOT?
|
||||
is true, mount ROOT read-only and make it a overlay with a writable tmpfs
|
||||
using the kernel build-in overlayfs."
|
||||
is true, mount ROOT read-only and make it a union with a writable tmpfs using
|
||||
UNIONFS."
|
||||
(define (mark-as-not-killable pid)
|
||||
;; Tell the 'user-processes' shepherd service that PID must be kept alive
|
||||
;; when shutting down.
|
||||
(mkdir-p "/root/etc/shepherd")
|
||||
(let ((port (open-file "/root/etc/shepherd/do-not-kill" "a")))
|
||||
(chmod port #o600)
|
||||
(write pid port)
|
||||
(newline port)
|
||||
(close-port port)))
|
||||
|
||||
(if volatile-root?
|
||||
(begin
|
||||
(mkdir-p "/real-root")
|
||||
@@ -368,17 +260,24 @@ using the kernel build-in overlayfs."
|
||||
(mkdir-p "/rw-root")
|
||||
(mount "none" "/rw-root" "tmpfs")
|
||||
|
||||
;; Create the upperdir and the workdir of the overlayfs
|
||||
(mkdir-p "/rw-root/upper")
|
||||
(mkdir-p "/rw-root/work")
|
||||
|
||||
;; We want read-write /dev nodes.
|
||||
(mkdir-p "/rw-root/upper/dev")
|
||||
(mount "none" "/rw-root/upper/dev" "devtmpfs")
|
||||
(mkdir-p "/rw-root/dev")
|
||||
(mount "none" "/rw-root/dev" "devtmpfs")
|
||||
|
||||
;; Make /root an overlay of the tmpfs and the actual root.
|
||||
(mount "none" "/root" "overlay" 0
|
||||
"lowerdir=/real-root,upperdir=/rw-root/upper,workdir=/rw-root/work"))
|
||||
;; Make /root a union of the tmpfs and the actual root. Use
|
||||
;; 'max_files' to set a high RLIMIT_NOFILE for the unionfs process
|
||||
;; itself. Failing to do that, we quickly run out of file
|
||||
;; descriptors; see <http://bugs.gnu.org/17827>.
|
||||
(unless (zero? (system* unionfs "-o"
|
||||
"cow,allow_other,use_ino,suid,dev,max_files=65536"
|
||||
"/rw-root=RW:/real-root=RO"
|
||||
"/root"))
|
||||
(error "unionfs failed"))
|
||||
|
||||
;; Make sure unionfs remains alive till the end. Because
|
||||
;; 'fuse_daemonize' doesn't tell the PID of the forked daemon, we
|
||||
;; have to resort to 'pidof' here.
|
||||
(mark-as-not-killable (pidof unionfs)))
|
||||
(begin
|
||||
(check-file-system root type)
|
||||
(mount root "/root" type)))
|
||||
@@ -386,7 +285,6 @@ using the kernel build-in overlayfs."
|
||||
;; Make sure /root/etc/mtab is a symlink to /proc/self/mounts.
|
||||
(false-if-exception
|
||||
(delete-file "/root/etc/mtab"))
|
||||
(mkdir-p "/root/etc")
|
||||
(symlink "/proc/self/mounts" "/root/etc/mtab"))
|
||||
|
||||
(define (switch-root root)
|
||||
@@ -440,8 +338,7 @@ bailing out.~%root contents: ~s~%" (scandir "/"))
|
||||
qemu-guest-networking?
|
||||
volatile-root?
|
||||
pre-mount
|
||||
(mounts '())
|
||||
(on-error 'debug))
|
||||
(mounts '()))
|
||||
"This procedure is meant to be called from an initrd. Boot a system by
|
||||
first loading LINUX-MODULES (a list of module names) from
|
||||
LINUX-MODULE-DIRECTORY, then setting up QEMU guest networking if
|
||||
@@ -452,20 +349,19 @@ supports kernel command-line options '--load', '--root', and '--repl'.
|
||||
Mount the root file system, specified by the '--root' command-line argument,
|
||||
if any.
|
||||
|
||||
MOUNTS must be a list of <file-system> objects.
|
||||
MOUNTS must be a list suitable for 'mount-file-system'.
|
||||
|
||||
When VOLATILE-ROOT? is true, the root file system is writable but any changes
|
||||
to it are lost.
|
||||
|
||||
ON-ERROR is passed to 'call-with-error-handling'; it determines what happens
|
||||
upon error."
|
||||
(define (root-mount-point? fs)
|
||||
(string=? (file-system-mount-point fs) "/"))
|
||||
to it are lost."
|
||||
(define root-mount-point?
|
||||
(match-lambda
|
||||
((device _ "/" _ ...) #t)
|
||||
(_ #f)))
|
||||
|
||||
(define root-fs-type
|
||||
(or (any (lambda (fs)
|
||||
(and (root-mount-point? fs)
|
||||
(file-system-type fs)))
|
||||
(or (any (match-lambda
|
||||
((device _ "/" type _ ...) type)
|
||||
(_ #f))
|
||||
mounts)
|
||||
"ext4"))
|
||||
|
||||
@@ -507,15 +403,9 @@ upon error."
|
||||
(error "pre-mount actions failed")))
|
||||
|
||||
(if root
|
||||
;; The "--root=SPEC" kernel command-line option always provides a
|
||||
;; string, but the string can represent a device, a UUID, or a
|
||||
;; label. So check for all three.
|
||||
(let ((root (cond ((string-prefix? "/" root) root)
|
||||
((uuid root) => identity)
|
||||
(else (file-system-label root)))))
|
||||
(mount-root-file-system (canonicalize-device-spec root)
|
||||
root-fs-type
|
||||
#:volatile-root? volatile-root?))
|
||||
(mount-root-file-system (canonicalize-device-spec root)
|
||||
root-fs-type
|
||||
#:volatile-root? volatile-root?)
|
||||
(mount "none" "/root" "tmpfs"))
|
||||
|
||||
;; Mount the specified file systems.
|
||||
@@ -537,7 +427,6 @@ upon error."
|
||||
(begin
|
||||
(display "no boot file passed via '--load'\n")
|
||||
(display "entering a warm and cozy REPL\n")
|
||||
(start-repl)))))
|
||||
#:on-error on-error))
|
||||
(start-repl)))))))
|
||||
|
||||
;;; linux-initrd.scm ends here
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2015 David Thompson <davet@gnu.org>
|
||||
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -61,14 +61,9 @@ exists."
|
||||
(const #t)
|
||||
(lambda ()
|
||||
(thunk)
|
||||
|
||||
;; XXX: Somehow we sometimes get EBADF from write(2) or close(2) upon
|
||||
;; exit (coming from fd finalizers) when used by the Shepherd. To work
|
||||
;; around that, exit forcefully so fd finalizers don't have a chance to
|
||||
;; run and fail.
|
||||
(primitive-_exit 0))
|
||||
(primitive-exit 0))
|
||||
(lambda ()
|
||||
(primitive-_exit 1))))
|
||||
(primitive-exit 1))))
|
||||
|
||||
(define (purify-environment)
|
||||
"Unset all environment variables."
|
||||
@@ -157,7 +152,8 @@ for the process."
|
||||
|
||||
;; Mount user-specified file systems.
|
||||
(for-each (lambda (file-system)
|
||||
(mount-file-system file-system #:root root))
|
||||
(mount-file-system (file-system->spec file-system)
|
||||
#:root root))
|
||||
mounts)
|
||||
|
||||
;; Jail the process inside the container's root file system.
|
||||
@@ -340,8 +336,7 @@ return the exit status."
|
||||
(match (container-excursion pid
|
||||
(lambda ()
|
||||
(close-port in)
|
||||
(write (thunk) out)
|
||||
(close-port out)))
|
||||
(write (thunk) out)))
|
||||
(0
|
||||
(close-port out)
|
||||
(let ((result (read in)))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -72,23 +72,11 @@ COMPRESS? is true, compress it using GZIP. On success, return OUTPUT."
|
||||
#:file->header cpio:file->cpio-header*)))
|
||||
|
||||
(or (not compress?)
|
||||
|
||||
;; Gzip insists on adding a '.gz' suffix and does nothing if the input
|
||||
;; file already has that suffix. Shuffle files around to placate it.
|
||||
(let* ((gz-suffix? (string-suffix? ".gz" output))
|
||||
(sans-gz (if gz-suffix?
|
||||
(string-drop-right output 3)
|
||||
output)))
|
||||
(when gz-suffix?
|
||||
(rename-file output sans-gz))
|
||||
;; Use '--no-name' so that gzip records neither a file name nor a time
|
||||
;; stamp in its output.
|
||||
(and (zero? (system* gzip "--best" "--no-name" sans-gz))
|
||||
(begin
|
||||
(unless gz-suffix?
|
||||
(rename-file (string-append output ".gz") output))
|
||||
output)))
|
||||
|
||||
;; Use '--no-name' so that gzip records neither a file name nor a time
|
||||
;; stamp in its output.
|
||||
(and (zero? (system* gzip "--best" "--no-name" output))
|
||||
(rename-file (string-append output ".gz")
|
||||
output))
|
||||
output))
|
||||
|
||||
(define (cache-compiled-file-name file)
|
||||
@@ -151,12 +139,6 @@ REFERENCES-GRAPHS."
|
||||
|
||||
(write-cpio-archive output "." #:gzip gzip))
|
||||
|
||||
;; Make sure directories are writable so we can delete files.
|
||||
(for-each make-file-writable
|
||||
(find-files "contents"
|
||||
(lambda (file stat)
|
||||
(eq? 'directory (stat:type stat)))
|
||||
#:directories? #t))
|
||||
(delete-file-recursively "contents"))
|
||||
|
||||
;;; linux-initrd.scm ends here
|
||||
|
||||
+14
-223
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
@@ -19,33 +19,22 @@
|
||||
|
||||
(define-module (gnu build linux-modules)
|
||||
#:use-module (guix elf)
|
||||
#:use-module (guix glob)
|
||||
#:use-module (guix build syscalls)
|
||||
#:use-module ((guix build utils) #:select (find-files))
|
||||
#:use-module (rnrs io ports)
|
||||
#:use-module (rnrs bytevectors)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (ice-9 vlist)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 rdelim)
|
||||
#:export (dot-ko
|
||||
ensure-dot-ko
|
||||
module-aliases
|
||||
module-dependencies
|
||||
normalize-module-name
|
||||
file-name->module-name
|
||||
find-module-file
|
||||
recursive-module-dependencies
|
||||
modules-loaded
|
||||
module-loaded?
|
||||
load-linux-module*
|
||||
|
||||
current-module-debugging-port
|
||||
|
||||
device-module-aliases
|
||||
known-module-aliases
|
||||
matching-modules))
|
||||
current-module-debugging-port))
|
||||
|
||||
;;; Commentary:
|
||||
;;;
|
||||
@@ -58,10 +47,11 @@
|
||||
|
||||
(define (section-contents elf section)
|
||||
"Return the contents of SECTION in ELF as a bytevector."
|
||||
(let ((contents (make-bytevector (elf-section-size section))))
|
||||
(bytevector-copy! (elf-bytes elf) (elf-section-offset section)
|
||||
(let* ((modinfo (elf-section-by-name elf ".modinfo"))
|
||||
(contents (make-bytevector (elf-section-size modinfo))))
|
||||
(bytevector-copy! (elf-bytes elf) (elf-section-offset modinfo)
|
||||
contents 0
|
||||
(elf-section-size section))
|
||||
(elf-section-size modinfo))
|
||||
contents))
|
||||
|
||||
(define %not-nul
|
||||
@@ -84,8 +74,7 @@ string list."
|
||||
key/value pairs.."
|
||||
(let* ((bv (call-with-input-file file get-bytevector-all))
|
||||
(elf (parse-elf bv))
|
||||
(section (elf-section-by-name elf ".modinfo"))
|
||||
(modinfo (section-contents elf section)))
|
||||
(modinfo (section-contents elf ".modinfo")))
|
||||
(map key=value->pair
|
||||
(nul-separated-string->list (utf8->string modinfo)))))
|
||||
|
||||
@@ -100,15 +89,6 @@ contains module names, not actual file names."
|
||||
(('depends . what)
|
||||
(string-tokenize what %not-comma)))))
|
||||
|
||||
(define (module-aliases file)
|
||||
"Return the list of aliases of module FILE."
|
||||
(let ((info (modinfo-section-contents file)))
|
||||
(filter-map (match-lambda
|
||||
(('alias . value)
|
||||
value)
|
||||
(_ #f))
|
||||
(modinfo-section-contents file))))
|
||||
|
||||
(define dot-ko
|
||||
(cut string-append <> ".ko"))
|
||||
|
||||
@@ -133,39 +113,6 @@ underscores."
|
||||
and normalizing it."
|
||||
(normalize-module-name (basename file ".ko")))
|
||||
|
||||
(define (find-module-file directory module)
|
||||
"Lookup module NAME under DIRECTORY, and return its absolute file name.
|
||||
NAME can be a file name with or without '.ko', or it can be a module name.
|
||||
Raise an error if it could not be found.
|
||||
|
||||
Module names can differ from file names in interesting ways; for instance,
|
||||
module names usually (always?) use underscores as the inter-word separator,
|
||||
whereas file names often, but not always, use hyphens. Examples:
|
||||
\"usb-storage.ko\", \"serpent_generic.ko\"."
|
||||
(define names
|
||||
;; List of possible file names. XXX: It would of course be cleaner to
|
||||
;; have a database that maps module names to file names and vice versa,
|
||||
;; but everyone seems to be doing hacks like this one. Oh well!
|
||||
(map ensure-dot-ko
|
||||
(delete-duplicates
|
||||
(list module
|
||||
(normalize-module-name module)
|
||||
(string-map (lambda (chr) ;converse of 'normalize-module-name'
|
||||
(case chr
|
||||
((#\_) #\-)
|
||||
(else chr)))
|
||||
module)))))
|
||||
|
||||
(match (find-files directory
|
||||
(lambda (file stat)
|
||||
(member (basename file) names)))
|
||||
((file)
|
||||
file)
|
||||
(()
|
||||
(error "kernel module not found" module directory))
|
||||
((_ ...)
|
||||
(error "several modules by that name" module directory))))
|
||||
|
||||
(define* (recursive-module-dependencies files
|
||||
#:key (lookup-module dot-ko))
|
||||
"Return the topologically-sorted list of file names of the modules depended
|
||||
@@ -233,6 +180,10 @@ success, false otherwise. When RECURSIVE? is true, load its dependencies
|
||||
first (à la 'modprobe'.) The actual files containing modules depended on are
|
||||
obtained by calling LOOKUP-MODULE with the module name. Modules whose name
|
||||
appears in BLACK-LIST are not loaded."
|
||||
(define (slurp module)
|
||||
;; TODO: Use 'finit_module' to reduce memory usage.
|
||||
(call-with-input-file file get-bytevector-all))
|
||||
|
||||
(define (black-listed? module)
|
||||
(let ((result (member module black-list)))
|
||||
(when result
|
||||
@@ -243,183 +194,23 @@ appears in BLACK-LIST are not loaded."
|
||||
|
||||
(define (load-dependencies file)
|
||||
(let ((dependencies (module-dependencies file)))
|
||||
(every (cut load-linux-module* <>
|
||||
#:lookup-module lookup-module
|
||||
#:black-list black-list)
|
||||
(every (cut load-linux-module* <> #:lookup-module lookup-module)
|
||||
(map lookup-module dependencies))))
|
||||
|
||||
(and (not (black-listed? (file-name->module-name file)))
|
||||
(or (not recursive?)
|
||||
(load-dependencies file))
|
||||
(let ((fd #f))
|
||||
(begin
|
||||
(format (current-module-debugging-port)
|
||||
"loading Linux module from '~a'...~%" file)
|
||||
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(set! fd (open-fdes file O_RDONLY))
|
||||
(load-linux-module/fd fd)
|
||||
(close-fdes fd)
|
||||
#t)
|
||||
(load-linux-module (slurp file)))
|
||||
(lambda args
|
||||
;; If this module was already loaded and we're in modprobe style, ignore
|
||||
;; the error.
|
||||
(when fd (close-fdes fd))
|
||||
(or (and recursive? (= EEXIST (system-error-errno args)))
|
||||
(apply throw args)))))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Device modules.
|
||||
;;;
|
||||
|
||||
;; Copied from (guix utils). FIXME: Factorize.
|
||||
(define (readlink* file)
|
||||
"Call 'readlink' until the result is not a symlink."
|
||||
(define %max-symlink-depth 50)
|
||||
|
||||
(let loop ((file file)
|
||||
(depth 0))
|
||||
(define (absolute target)
|
||||
(if (absolute-file-name? target)
|
||||
target
|
||||
(string-append (dirname file) "/" target)))
|
||||
|
||||
(if (>= depth %max-symlink-depth)
|
||||
file
|
||||
(call-with-values
|
||||
(lambda ()
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(values #t (readlink file)))
|
||||
(lambda args
|
||||
(let ((errno (system-error-errno args)))
|
||||
(if (or (= errno EINVAL))
|
||||
(values #f file)
|
||||
(apply throw args))))))
|
||||
(lambda (success? target)
|
||||
(if success?
|
||||
(loop (absolute target) (+ depth 1))
|
||||
file))))))
|
||||
|
||||
;; See 'major' and 'minor' in <sys/sysmacros.h>.
|
||||
|
||||
(define (stat->device-major st)
|
||||
(ash (logand #xfff00 (stat:rdev st)) -8))
|
||||
|
||||
(define (stat->device-minor st)
|
||||
(logand #xff (stat:rdev st)))
|
||||
|
||||
(define %not-slash
|
||||
(char-set-complement (char-set #\/)))
|
||||
|
||||
(define (read-uevent port)
|
||||
"Read a /sys 'uevent' file from PORT and return an alist where each car is a
|
||||
key such as 'MAJOR or 'DEVTYPE and each cdr is the corresponding value."
|
||||
(let loop ((result '()))
|
||||
(match (read-line port)
|
||||
((? eof-object?)
|
||||
(reverse result))
|
||||
(line
|
||||
(loop (cons (key=value->pair line) result))))))
|
||||
|
||||
(define (device-module-aliases device)
|
||||
"Return the list of module aliases required by DEVICE, a /dev file name, as
|
||||
in this example:
|
||||
|
||||
(device-module-aliases \"/dev/sda\")
|
||||
=> (\"scsi:t-0x00\" \"pci:v00008086d00009D03sv0000103Csd000080FAbc01sc06i01\")
|
||||
|
||||
The modules corresponding to these aliases can then be found using
|
||||
'matching-modules'."
|
||||
;; The approach is adapted from
|
||||
;; <https://unix.stackexchange.com/questions/97676/how-to-find-the-driver-module-associated-with-a-device-on-linux>.
|
||||
(let* ((st (stat device))
|
||||
(type (stat:type st))
|
||||
(major (stat->device-major st))
|
||||
(minor (stat->device-minor st))
|
||||
(sys-name (string-append "/sys/dev/"
|
||||
(case type
|
||||
((block-special) "block")
|
||||
((char-special) "char")
|
||||
(else (symbol->string type)))
|
||||
"/" (number->string major) ":"
|
||||
(number->string minor)))
|
||||
(directory (canonicalize-path (readlink* sys-name))))
|
||||
(let loop ((components (string-tokenize directory %not-slash))
|
||||
(aliases '()))
|
||||
(match components
|
||||
(("sys" "devices" _)
|
||||
(reverse aliases))
|
||||
((head ... _)
|
||||
(let ((uevent (string-append (string-join components "/" 'prefix)
|
||||
"/uevent")))
|
||||
(if (file-exists? uevent)
|
||||
(let ((props (call-with-input-file uevent read-uevent)))
|
||||
(match (assq-ref props 'MODALIAS)
|
||||
(#f (loop head aliases))
|
||||
(alias (loop head (cons alias aliases)))))
|
||||
(loop head aliases))))))))
|
||||
|
||||
(define (read-module-aliases port)
|
||||
"Read from PORT data in the Linux 'modules.alias' file format. Return a
|
||||
list of alias/module pairs where each alias is a glob pattern as like the
|
||||
result of:
|
||||
|
||||
(string->compiled-sglob \"scsi:t-0x01*\")
|
||||
|
||||
and each module is a module name like \"snd_hda_intel\"."
|
||||
(define (comment? str)
|
||||
(string-prefix? "#" str))
|
||||
|
||||
(define (tokenize str)
|
||||
;; Lines have the form "alias ALIAS MODULE", where ALIAS can contain
|
||||
;; whitespace. This is why we don't use 'string-tokenize'.
|
||||
(let* ((str (string-trim-both str))
|
||||
(left (string-index str #\space))
|
||||
(right (string-rindex str #\space)))
|
||||
(list (string-take str left)
|
||||
(string-trim-both (substring str left right))
|
||||
(string-trim-both (string-drop str right)))))
|
||||
|
||||
(let loop ((aliases '()))
|
||||
(match (read-line port)
|
||||
((? eof-object?)
|
||||
(reverse aliases))
|
||||
((? comment?)
|
||||
(loop aliases))
|
||||
(line
|
||||
(match (tokenize line)
|
||||
(("alias" alias module)
|
||||
(loop (alist-cons (string->compiled-sglob alias) module
|
||||
aliases)))
|
||||
(() ;empty line
|
||||
(loop aliases)))))))
|
||||
|
||||
(define (current-kernel-directory)
|
||||
"Return the directory of the currently running Linux kernel."
|
||||
(string-append (or (getenv "LINUX_MODULE_DIRECTORY")
|
||||
"/run/booted-system/kernel/lib/modules")
|
||||
"/" (utsname:release (uname))))
|
||||
|
||||
(define (current-alias-file)
|
||||
"Return the absolute file name of the default 'modules.alias' file."
|
||||
(string-append (current-kernel-directory) "/modules.alias"))
|
||||
|
||||
(define* (known-module-aliases #:optional (alias-file (current-alias-file)))
|
||||
"Return the list of alias/module pairs read from ALIAS-FILE. Each alias is
|
||||
actually a pattern."
|
||||
(call-with-input-file alias-file read-module-aliases))
|
||||
|
||||
(define* (matching-modules alias
|
||||
#:optional (known-aliases (known-module-aliases)))
|
||||
"Return the list of modules that match ALIAS according to KNOWN-ALIASES.
|
||||
ALIAS is a string like \"scsi:t-0x00\" as returned by
|
||||
'device-module-aliases'."
|
||||
(filter-map (match-lambda
|
||||
((pattern . module)
|
||||
(and (glob-match? pattern alias)
|
||||
module)))
|
||||
known-aliases))
|
||||
|
||||
;;; linux-modules.scm ends here
|
||||
|
||||
+18
-90
@@ -1,6 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
|
||||
;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -27,8 +26,6 @@
|
||||
make-marionette
|
||||
marionette-eval
|
||||
wait-for-file
|
||||
wait-for-tcp-port
|
||||
wait-for-unix-socket
|
||||
marionette-control
|
||||
marionette-screen-text
|
||||
wait-for-screen-text
|
||||
@@ -100,11 +97,8 @@ QEMU monitor and to the guest's backdoor REPL."
|
||||
"-monitor" (string-append "unix:" socket-directory "/monitor")
|
||||
"-chardev" (string-append "socket,id=repl,path=" socket-directory
|
||||
"/repl")
|
||||
|
||||
;; See
|
||||
;; <http://www.linux-kvm.org/page/VMchannel_Requirements#Invocation>.
|
||||
"-device" "virtio-serial"
|
||||
"-device" "virtserialport,chardev=repl,name=org.gnu.guix.port.0"))
|
||||
"-device" "virtconsole,chardev=repl"))
|
||||
|
||||
(define (accept* port)
|
||||
(match (select (list port) '() (list port) timeout)
|
||||
@@ -171,73 +165,19 @@ QEMU monitor and to the guest's backdoor REPL."
|
||||
(newline repl)
|
||||
(read repl))))
|
||||
|
||||
(define* (wait-for-file file marionette
|
||||
#:key (timeout 10) (read 'read))
|
||||
"Wait until FILE exists in MARIONETTE; READ its content and return it. If
|
||||
(define* (wait-for-file file marionette #:key (timeout 10))
|
||||
"Wait until FILE exists in MARIONETTE; 'read' its content and return it. If
|
||||
FILE has not shown up after TIMEOUT seconds, raise an error."
|
||||
(match (marionette-eval
|
||||
`(let loop ((i ,timeout))
|
||||
(cond ((file-exists? ,file)
|
||||
(cons 'success (call-with-input-file ,file ,read)))
|
||||
((> i 0)
|
||||
(sleep 1)
|
||||
(loop (- i 1)))
|
||||
(else
|
||||
'failure)))
|
||||
marionette)
|
||||
(('success . result)
|
||||
result)
|
||||
('failure
|
||||
(error "file didn't show up" file))))
|
||||
|
||||
(define* (wait-for-tcp-port port marionette
|
||||
#:key (timeout 20))
|
||||
"Wait for up to TIMEOUT seconds for PORT to accept connections in
|
||||
MARIONETTE. Raise an error on failure."
|
||||
;; Note: The 'connect' loop has to run within the guest because, when we
|
||||
;; forward ports to the host, connecting to the host never raises
|
||||
;; ECONNREFUSED.
|
||||
(match (marionette-eval
|
||||
`(begin
|
||||
(let ((sock (socket PF_INET SOCK_STREAM 0)))
|
||||
(let loop ((i 0))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(connect sock AF_INET INADDR_LOOPBACK ,port)
|
||||
'success)
|
||||
(lambda args
|
||||
(if (< i ,timeout)
|
||||
(begin
|
||||
(sleep 1)
|
||||
(loop (+ 1 i)))
|
||||
'failure))))))
|
||||
marionette)
|
||||
('success #t)
|
||||
('failure
|
||||
(error "nobody's listening on port" port))))
|
||||
|
||||
(define* (wait-for-unix-socket file-name marionette
|
||||
#:key (timeout 20))
|
||||
"Wait for up to TIMEOUT seconds for FILE-NAME, a Unix domain socket, to
|
||||
accept connections in MARIONETTE. Raise an error on failure."
|
||||
(match (marionette-eval
|
||||
`(begin
|
||||
(let ((sock (socket PF_UNIX SOCK_STREAM 0)))
|
||||
(let loop ((i 0))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(connect sock AF_UNIX ,file-name)
|
||||
'success)
|
||||
(lambda args
|
||||
(if (< i ,timeout)
|
||||
(begin
|
||||
(sleep 1)
|
||||
(loop (+ 1 i)))
|
||||
'failure))))))
|
||||
marionette)
|
||||
('success #t)
|
||||
('failure
|
||||
(error "nobody's listening on unix domain socket" file-name))))
|
||||
(marionette-eval
|
||||
`(let loop ((i ,timeout))
|
||||
(cond ((file-exists? ,file)
|
||||
(call-with-input-file ,file read))
|
||||
((> i 0)
|
||||
(sleep 1)
|
||||
(loop (- i 1)))
|
||||
(else
|
||||
(error "file didn't show up" ,file))))
|
||||
marionette))
|
||||
|
||||
(define (marionette-control command marionette)
|
||||
"Run COMMAND in the QEMU monitor of MARIONETTE. COMMAND is a string such as
|
||||
@@ -247,8 +187,7 @@ pcsys_monitor\")."
|
||||
(($ <marionette> _ _ monitor)
|
||||
(display command monitor)
|
||||
(newline monitor)
|
||||
;; The "quit" command terminates QEMU immediately, with no output.
|
||||
(unless (string=? command "quit") (wait-for-monitor-prompt monitor)))))
|
||||
(wait-for-monitor-prompt monitor))))
|
||||
|
||||
(define* (marionette-screen-text marionette
|
||||
#:key
|
||||
@@ -318,20 +257,9 @@ PREDICATE, whichever comes first. Raise an error when TIMEOUT is exceeded."
|
||||
(#\. . "dot")
|
||||
(#\, . "comma")
|
||||
(#\; . "semicolon")
|
||||
(#\' . "apostrophe")
|
||||
(#\" . "shift-apostrophe")
|
||||
(#\` . "grave_accent")
|
||||
(#\bs . "backspace")
|
||||
(#\tab . "tab")))
|
||||
|
||||
(define (character->keystroke chr keystrokes)
|
||||
"Return the keystroke for CHR according to the keyboard layout defined by
|
||||
KEYSTROKES."
|
||||
(if (char-set-contains? char-set:upper-case chr)
|
||||
(string-append "shift-" (string (char-downcase chr)))
|
||||
(or (assoc-ref keystrokes chr)
|
||||
(string chr))))
|
||||
|
||||
(define* (string->keystroke-commands str
|
||||
#:optional
|
||||
(keystrokes
|
||||
@@ -340,9 +268,9 @@ KEYSTROKES."
|
||||
to STR. KEYSTROKES is an alist specifying a mapping from characters to
|
||||
keystrokes."
|
||||
(string-fold-right (lambda (chr result)
|
||||
(cons (string-append
|
||||
"sendkey "
|
||||
(character->keystroke chr keystrokes))
|
||||
(cons (string-append "sendkey "
|
||||
(or (assoc-ref keystrokes chr)
|
||||
(string chr)))
|
||||
result))
|
||||
'()
|
||||
str))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -55,17 +55,16 @@
|
||||
(define (tmpfs directory)
|
||||
(file-system
|
||||
(device "none")
|
||||
(title 'device)
|
||||
(mount-point directory)
|
||||
(type "tmpfs")
|
||||
(check? #f)))
|
||||
|
||||
(define accounts
|
||||
(define passwd
|
||||
;; This is for processes in the default user namespace but living in a
|
||||
;; different mount namespace, so that they can lookup users.
|
||||
(list (file-system-mapping
|
||||
(source "/etc/passwd") (target source))
|
||||
(file-system-mapping
|
||||
(source "/etc/group") (target source))))
|
||||
(file-system-mapping
|
||||
(source "/etc/passwd") (target source)))
|
||||
|
||||
(define nscd-socket
|
||||
(file-system-mapping
|
||||
@@ -79,7 +78,7 @@
|
||||
%network-file-mappings))
|
||||
,@(if (and (memq 'mnt namespaces)
|
||||
(not (memq 'user namespaces)))
|
||||
accounts
|
||||
(list passwd)
|
||||
'())
|
||||
,%store-mapping))) ;XXX: coarse-grain
|
||||
(map file-system-mapping->bind-mount
|
||||
|
||||
+8
-3
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
@@ -18,11 +18,16 @@
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gnu build svg)
|
||||
#:use-module (rsvg)
|
||||
#:use-module (cairo)
|
||||
#:use-module (srfi srfi-11)
|
||||
#:export (svg->png))
|
||||
|
||||
;; We need Guile-RSVG and Guile-Cairo. Load them lazily, at run time, to
|
||||
;; allow compilation to proceed. See also <http://bugs.gnu.org/12202>.
|
||||
(module-autoload! (current-module)
|
||||
'(rsvg) '(rsvg-handle-new-from-file))
|
||||
(module-autoload! (current-module)
|
||||
'(cairo) '(cairo-image-surface-create))
|
||||
|
||||
(define* (downscaled-surface surface
|
||||
#:key
|
||||
source-width source-height
|
||||
|
||||
+99
-224
@@ -1,10 +1,9 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
|
||||
;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
|
||||
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
|
||||
;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -25,16 +24,14 @@
|
||||
#:use-module (guix build utils)
|
||||
#:use-module (guix build store-copy)
|
||||
#:use-module (guix build syscalls)
|
||||
#:use-module (guix store database)
|
||||
#:use-module (gnu build linux-boot)
|
||||
#:use-module (gnu build install)
|
||||
#:use-module (gnu system uuid)
|
||||
#:use-module (gnu build file-systems)
|
||||
#:use-module (guix records)
|
||||
#:use-module ((guix combinators) #:select (fold2))
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 regex)
|
||||
#:use-module (ice-9 popen)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (srfi srfi-26)
|
||||
@@ -79,15 +76,11 @@
|
||||
(qemu (qemu-command)) (memory-size 512)
|
||||
linux initrd
|
||||
make-disk-image?
|
||||
single-file-output?
|
||||
target-arm32?
|
||||
(disk-image-size (* 100 (expt 2 20)))
|
||||
(disk-image-format "qcow2")
|
||||
(references-graphs '()))
|
||||
"Run BUILDER, a Scheme file, into a VM running LINUX with INITRD, and copy
|
||||
the result to OUTPUT. If SINGLE-FILE-OUTPUT? is true, copy a single file from
|
||||
/xchg to OUTPUT. Otherwise, copy the contents of /xchg to a new directory
|
||||
OUTPUT.
|
||||
the result to OUTPUT.
|
||||
|
||||
When MAKE-DISK-IMAGE? is true, OUTPUT will contain a VM image of
|
||||
DISK-IMAGE-SIZE bytes resulting from the execution of BUILDER, which may
|
||||
@@ -95,51 +88,16 @@ access it via /dev/hda.
|
||||
|
||||
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
|
||||
the #:references-graphs parameter of 'derivation'."
|
||||
|
||||
(define arch-specific-flags
|
||||
`(;; On ARM, a machine has to be specified. Use "virt" machine to avoid
|
||||
;; hardware limits imposed by other machines.
|
||||
,@(if target-arm32? '("-M" "virt") '())
|
||||
|
||||
;; Only enable kvm if we see /dev/kvm exists. This allows users without
|
||||
;; hardware virtualization to still use these commands. KVM support is
|
||||
;; still buggy on some ARM32 boards. Do not use it even if available.
|
||||
,@(if (and (file-exists? "/dev/kvm")
|
||||
(not target-arm32?)
|
||||
|
||||
;; XXX: 32-bit 'qemu-system-i386 -enable-kvm' segfaults on
|
||||
;; x86_64 hosts running Linux-libre 4.17:
|
||||
;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31380#18> and
|
||||
;; <https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg01166.html>.
|
||||
(not (string-suffix? "-i386" qemu)))
|
||||
'("-enable-kvm")
|
||||
'())
|
||||
|
||||
;; Pass "panic=1" so that the guest dies upon error.
|
||||
"-append"
|
||||
,(string-append "panic=1 --load=" builder
|
||||
|
||||
;; The serial port name differs between emulated
|
||||
;; architectures/machines.
|
||||
" console="
|
||||
(if target-arm32? "ttyAMA0" "ttyS0"))
|
||||
|
||||
;; NIC is not supported on ARM "virt" machine, so use a user mode
|
||||
;; network stack instead.
|
||||
,@(if target-arm32?
|
||||
'("-device" "virtio-net-pci,netdev=mynet"
|
||||
"-netdev" "user,id=mynet")
|
||||
'("-net" "nic,model=virtio"))))
|
||||
|
||||
(when make-disk-image?
|
||||
(format #t "creating ~a image of ~,2f MiB...~%"
|
||||
disk-image-format (/ disk-image-size (expt 2 20)))
|
||||
(force-output)
|
||||
(invoke "qemu-img" "create" "-f" disk-image-format output
|
||||
(number->string disk-image-size)))
|
||||
(unless (zero? (system* "qemu-img" "create" "-f" disk-image-format
|
||||
output
|
||||
(number->string disk-image-size)))
|
||||
(error "qemu-img failed")))
|
||||
|
||||
(mkdir "xchg")
|
||||
(mkdir "tmp")
|
||||
|
||||
(match references-graphs
|
||||
((graph-files ...)
|
||||
@@ -149,64 +107,38 @@ the #:references-graphs parameter of 'derivation'."
|
||||
graph-files))
|
||||
(_ #f))
|
||||
|
||||
(apply invoke qemu "-nographic" "-no-reboot"
|
||||
"-m" (number->string memory-size)
|
||||
"-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
|
||||
"-device" "virtio-rng-pci,rng=guixsd-vm-rng"
|
||||
"-virtfs"
|
||||
(string-append "local,id=store_dev,path="
|
||||
(%store-directory)
|
||||
",security_model=none,mount_tag=store")
|
||||
"-virtfs"
|
||||
(string-append "local,id=xchg_dev,path=xchg"
|
||||
",security_model=none,mount_tag=xchg")
|
||||
"-virtfs"
|
||||
;; Some programs require more space in /tmp than is normally
|
||||
;; available in the guest. Accommodate such programs by sharing a
|
||||
;; temporary directory.
|
||||
(string-append "local,id=tmp_dev,path=tmp"
|
||||
",security_model=none,mount_tag=tmp")
|
||||
"-kernel" linux
|
||||
"-initrd" initrd
|
||||
(append
|
||||
(if make-disk-image?
|
||||
`("-device" "virtio-blk,drive=myhd"
|
||||
"-drive" ,(string-append "if=none,file=" output
|
||||
",format=" disk-image-format
|
||||
",id=myhd"))
|
||||
'())
|
||||
arch-specific-flags))
|
||||
(unless (zero?
|
||||
(apply system* qemu "-nographic" "-no-reboot"
|
||||
"-m" (number->string memory-size)
|
||||
"-net" "nic,model=virtio"
|
||||
"-virtfs"
|
||||
(string-append "local,id=store_dev,path="
|
||||
(%store-directory)
|
||||
",security_model=none,mount_tag=store")
|
||||
"-virtfs"
|
||||
(string-append "local,id=xchg_dev,path=xchg"
|
||||
",security_model=none,mount_tag=xchg")
|
||||
"-kernel" linux
|
||||
"-initrd" initrd
|
||||
"-append" (string-append "console=ttyS0 --load="
|
||||
builder)
|
||||
(append
|
||||
(if make-disk-image?
|
||||
`("-drive" ,(string-append "file=" output
|
||||
",if=virtio"))
|
||||
'())
|
||||
;; Only enable kvm if we see /dev/kvm exists.
|
||||
;; This allows users without hardware virtualization to still
|
||||
;; use these commands.
|
||||
(if (file-exists? "/dev/kvm")
|
||||
'("-enable-kvm")
|
||||
'()))))
|
||||
(error "qemu failed" qemu))
|
||||
|
||||
;; When MAKE-DISK-IMAGE? is true, the image is in OUTPUT already.
|
||||
(unless make-disk-image?
|
||||
(if single-file-output?
|
||||
(let ((graph? (lambda (name stat)
|
||||
(member (basename name) references-graphs))))
|
||||
(match (find-files "xchg" (negate graph?))
|
||||
((result)
|
||||
(copy-file result output))
|
||||
(x
|
||||
(error "did not find a single result file" x))))
|
||||
(begin
|
||||
(mkdir output)
|
||||
(copy-recursively "xchg" output)))))
|
||||
|
||||
(define* (register-closure prefix closure
|
||||
#:key
|
||||
(deduplicate? #t) (reset-timestamps? #t)
|
||||
(schema (sql-schema)))
|
||||
"Register CLOSURE in PREFIX, where PREFIX is the directory name of the
|
||||
target store and CLOSURE is the name of a file containing a reference graph as
|
||||
produced by #:references-graphs.. As a side effect, if RESET-TIMESTAMPS? is
|
||||
true, reset timestamps on store files and, if DEDUPLICATE? is true,
|
||||
deduplicates files common to CLOSURE and the rest of PREFIX."
|
||||
(let ((items (call-with-input-file closure read-reference-graph)))
|
||||
(register-items items
|
||||
#:prefix prefix
|
||||
#:deduplicate? deduplicate?
|
||||
#:reset-timestamps? reset-timestamps?
|
||||
#:registration-time %epoch
|
||||
#:schema schema)))
|
||||
(mkdir output)
|
||||
(copy-recursively "xchg" output)))
|
||||
|
||||
|
||||
;;;
|
||||
@@ -219,15 +151,14 @@ deduplicates files common to CLOSURE and the rest of PREFIX."
|
||||
(size partition-size)
|
||||
(file-system partition-file-system (default "ext4"))
|
||||
(label partition-label (default #f))
|
||||
(uuid partition-uuid (default #f))
|
||||
(flags partition-flags (default '()))
|
||||
(initializer partition-initializer (default (const #t))))
|
||||
|
||||
(define (estimated-partition-size graphs)
|
||||
"Return the estimated size of a partition that can store the store items
|
||||
given by GRAPHS, a list of file names produced by #:references-graphs."
|
||||
;; Simply add a 25% overhead.
|
||||
(round (* 1.25 (closure-size graphs))))
|
||||
;; Simply add a 20% overhead.
|
||||
(round (* 1.2 (closure-size graphs))))
|
||||
|
||||
(define* (initialize-partition-table device partitions
|
||||
#:key
|
||||
@@ -272,9 +203,10 @@ actual /dev name based on DEVICE."
|
||||
partition-size)
|
||||
partitions)
|
||||
", "))
|
||||
(apply invoke "parted" "--script"
|
||||
device "mklabel" label-type
|
||||
(options partitions offset))
|
||||
(unless (zero? (apply system* "parted" "--script"
|
||||
device "mklabel" label-type
|
||||
(options partitions offset)))
|
||||
(error "failed to create partition table"))
|
||||
|
||||
;; Set the 'device' field of each partition.
|
||||
(reverse
|
||||
@@ -292,38 +224,37 @@ actual /dev name based on DEVICE."
|
||||
(define MS_BIND 4096) ; <sys/mounts.h> again!
|
||||
|
||||
(define* (create-ext-file-system partition type
|
||||
#:key label uuid)
|
||||
"Create an ext-family file system of TYPE on PARTITION. If LABEL is true,
|
||||
use that as the volume name. If UUID is true, use it as the partition UUID."
|
||||
(format #t "creating ~a partition... ~@[label: ~s~] ~@[uuid: ~s~]\n"
|
||||
type label (and uuid (uuid->string uuid)))
|
||||
(apply invoke (string-append "mkfs." type)
|
||||
"-F" partition
|
||||
`(,@(if label
|
||||
`("-L" ,label)
|
||||
'())
|
||||
,@(if uuid
|
||||
`("-U" ,(uuid->string uuid))
|
||||
'()))))
|
||||
#:key label)
|
||||
"Create an ext-family filesystem of TYPE on PARTITION. If LABEL is true,
|
||||
use that as the volume name."
|
||||
(format #t "creating ~a partition...\n" type)
|
||||
(unless (zero? (apply system* (string-append "mkfs." type)
|
||||
"-F" partition
|
||||
(if label
|
||||
`("-L" ,label)
|
||||
'())))
|
||||
(error "failed to create partition")))
|
||||
|
||||
(define* (create-fat-file-system partition
|
||||
#:key label uuid)
|
||||
"Create a FAT file system on PARTITION. The number of File Allocation Tables
|
||||
will be determined based on file system size. If LABEL is true, use that as the
|
||||
#:key label)
|
||||
"Create a FAT filesystem on PARTITION. The number of File Allocation Tables
|
||||
will be determined based on filesystem size. If LABEL is true, use that as the
|
||||
volume name."
|
||||
;; FIXME: UUID is ignored!
|
||||
(format #t "creating FAT partition...\n")
|
||||
(apply invoke "mkfs.fat" partition
|
||||
(if label `("-n" ,label) '())))
|
||||
(unless (zero? (apply system* "mkfs.fat" partition
|
||||
(if label
|
||||
`("-n" ,label)
|
||||
'())))
|
||||
(error "failed to create FAT partition")))
|
||||
|
||||
(define* (format-partition partition type
|
||||
#:key label uuid)
|
||||
#:key label)
|
||||
"Create a file system TYPE on PARTITION. If LABEL is true, use that as the
|
||||
volume name."
|
||||
(cond ((string-prefix? "ext" type)
|
||||
(create-ext-file-system partition type #:label label #:uuid uuid))
|
||||
(create-ext-file-system partition type #:label label))
|
||||
((or (string-prefix? "fat" type) (string= "vfat" type))
|
||||
(create-fat-file-system partition #:label label #:uuid uuid))
|
||||
(create-fat-file-system partition #:label label))
|
||||
(else (error "Unsupported file system."))))
|
||||
|
||||
(define (initialize-partition partition)
|
||||
@@ -332,8 +263,7 @@ it, run its initializer, and unmount it."
|
||||
(let ((target "/fs"))
|
||||
(format-partition (partition-device partition)
|
||||
(partition-file-system partition)
|
||||
#:label (partition-label partition)
|
||||
#:uuid (partition-uuid partition))
|
||||
#:label (partition-label partition))
|
||||
(mkdir-p target)
|
||||
(mount (partition-device partition) target
|
||||
(partition-file-system partition))
|
||||
@@ -346,14 +276,11 @@ it, run its initializer, and unmount it."
|
||||
(define* (root-partition-initializer #:key (closures '())
|
||||
copy-closures?
|
||||
(register-closures? #t)
|
||||
system-directory
|
||||
(deduplicate? #t))
|
||||
system-directory)
|
||||
"Return a procedure to initialize a root partition.
|
||||
|
||||
If REGISTER-CLOSURES? is true, register all of CLOSURES in the partition's
|
||||
store. If DEDUPLICATE? is true, then also deduplicate files common to
|
||||
CLOSURES and the rest of the store when registering the closures. If
|
||||
COPY-CLOSURES? is true, copy all of CLOSURES to the partition.
|
||||
If REGISTER-CLOSURES? is true, register all of CLOSURES is the partition's
|
||||
store. If COPY-CLOSURES? is true, copy all of CLOSURES to the partition.
|
||||
SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
|
||||
(lambda (target)
|
||||
(define target-store
|
||||
@@ -370,7 +297,7 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
|
||||
;; Optionally, register the inputs in the image's store.
|
||||
(when register-closures?
|
||||
(unless copy-closures?
|
||||
;; XXX: 'register-closure' wants to palpate the things it registers, so
|
||||
;; XXX: 'guix-register' wants to palpate the things it registers, so
|
||||
;; bind-mount the store on the target.
|
||||
(mkdir-p target-store)
|
||||
(mount (%store-directory) target-store "" MS_BIND))
|
||||
@@ -378,9 +305,7 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
|
||||
(display "registering closures...\n")
|
||||
(for-each (lambda (closure)
|
||||
(register-closure target
|
||||
(string-append "/xchg/" closure)
|
||||
#:reset-timestamps? copy-closures?
|
||||
#:deduplicate? deduplicate?))
|
||||
(string-append "/xchg/" closure)))
|
||||
closures)
|
||||
(unless copy-closures?
|
||||
(umount target-store)))
|
||||
@@ -389,7 +314,7 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
|
||||
(display "populating...\n")
|
||||
(populate-root-file-system system-directory target)
|
||||
|
||||
;; 'register-closure' resets timestamps and everything, so no need to do it
|
||||
;; 'guix-register' resets timestamps and everything, so no need to do it
|
||||
;; once more in that case.
|
||||
(unless register-closures?
|
||||
(reset-timestamps target))))
|
||||
@@ -421,83 +346,36 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
|
||||
(setenv "TMPDIR" esp)
|
||||
|
||||
(mkdir-p efi-directory)
|
||||
(invoke grub-mkstandalone "-O" (car efi-targets)
|
||||
"-o" (string-append efi-directory "/"
|
||||
(cdr efi-targets))
|
||||
;; Graft the configuration file onto the image.
|
||||
(string-append "boot/grub/grub.cfg=" config-file))))
|
||||
(unless (zero? (system* grub-mkstandalone "-O" (car efi-targets)
|
||||
"-o" (string-append efi-directory "/"
|
||||
(cdr efi-targets))
|
||||
;; Graft the configuration file onto the image.
|
||||
(string-append "boot/grub/grub.cfg=" config-file)))
|
||||
(error "failed to create GRUB EFI image"))))
|
||||
|
||||
(define* (make-iso9660-image grub config-file os-drv target
|
||||
#:key (volume-id "GuixSD_image") (volume-uuid #f)
|
||||
register-closures? (closures '()))
|
||||
#:key (volume-id "GuixSD") (volume-uuid #f))
|
||||
"Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as
|
||||
GRUB configuration and OS-DRV as the stuff in it."
|
||||
(define grub-mkrescue
|
||||
(string-append grub "/bin/grub-mkrescue"))
|
||||
|
||||
(define target-store
|
||||
(string-append "/tmp/root" (%store-directory)))
|
||||
|
||||
(define items
|
||||
;; The store items to add to the image.
|
||||
(delete-duplicates
|
||||
(append-map (lambda (closure)
|
||||
(map store-info-item
|
||||
(call-with-input-file (string-append "/xchg/" closure)
|
||||
read-reference-graph)))
|
||||
closures)))
|
||||
|
||||
(populate-root-file-system os-drv "/tmp/root")
|
||||
(mount (%store-directory) target-store "" MS_BIND)
|
||||
|
||||
(when register-closures?
|
||||
(display "registering closures...\n")
|
||||
(for-each (lambda (closure)
|
||||
(register-closure
|
||||
"/tmp/root"
|
||||
(string-append "/xchg/" closure)
|
||||
|
||||
;; TARGET-STORE is a read-only bind-mount so we shouldn't try
|
||||
;; to modify it.
|
||||
#:deduplicate? #f
|
||||
#:reset-timestamps? #f))
|
||||
closures)
|
||||
(register-bootcfg-root "/tmp/root" config-file))
|
||||
|
||||
(let ((pipe
|
||||
(apply open-pipe* OPEN_WRITE
|
||||
grub-mkrescue "-o" target
|
||||
(string-append "boot/grub/grub.cfg=" config-file)
|
||||
"etc=/tmp/root/etc"
|
||||
"var=/tmp/root/var"
|
||||
"run=/tmp/root/run"
|
||||
;; /mnt is used as part of the installation
|
||||
;; process, as the mount point for the target
|
||||
;; file system, so create it.
|
||||
"mnt=/tmp/root/mnt"
|
||||
"-path-list" "-"
|
||||
"--"
|
||||
|
||||
;; XXX: Add padding to avoid I/O errors on i686:
|
||||
;; <https://bugs.gnu.org/33639>.
|
||||
"-padding" "10m"
|
||||
|
||||
"-volid" (string-upcase volume-id)
|
||||
(if volume-uuid
|
||||
`("-volume_date" "uuid"
|
||||
,(string-filter (lambda (value)
|
||||
(not (char=? #\- value)))
|
||||
(iso9660-uuid->string
|
||||
volume-uuid)))
|
||||
`()))))
|
||||
;; Pass lines like 'gnu/store/…-x=/gnu/store/…-x' corresponding to the
|
||||
;; '-path-list -' option.
|
||||
(for-each (lambda (item)
|
||||
(format pipe "~a=~a~%"
|
||||
(string-drop item 1) item))
|
||||
items)
|
||||
(unless (zero? (close-pipe pipe))
|
||||
(error "oh, my! grub-mkrescue failed" grub-mkrescue))))
|
||||
Grub configuration and OS-DRV as the stuff in it."
|
||||
(let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue")))
|
||||
(mkdir-p "/tmp/root/var/run")
|
||||
(mkdir-p "/tmp/root/run")
|
||||
(unless (zero? (apply system*
|
||||
`(,grub-mkrescue "-o" ,target
|
||||
,(string-append "boot/grub/grub.cfg=" config-file)
|
||||
,(string-append "gnu/store=" os-drv "/..")
|
||||
"var=/tmp/root/var"
|
||||
"run=/tmp/root/run"
|
||||
"--"
|
||||
"-volid" ,(string-upcase volume-id)
|
||||
,@(if volume-uuid
|
||||
`("-volume_date" "uuid"
|
||||
,(string-filter (lambda (value)
|
||||
(not (char=? #\- value)))
|
||||
(iso9660-uuid->string
|
||||
volume-uuid)))
|
||||
`()))))
|
||||
(error "failed to create ISO9660 image"))))
|
||||
|
||||
(define* (initialize-hard-disk device
|
||||
#:key
|
||||
@@ -549,14 +427,11 @@ passing it a directory name where it is mounted."
|
||||
|
||||
;; Create a tiny configuration file telling the embedded grub
|
||||
;; where to load the real thing.
|
||||
;; XXX This is quite fragile, and can prevent the image from booting
|
||||
;; when there's more than one volume with this label present.
|
||||
;; Reproducible almost-UUIDs could reduce the risk (not eliminate it).
|
||||
(call-with-output-file grub-config
|
||||
(lambda (port)
|
||||
(format port
|
||||
"insmod part_msdos~@
|
||||
search --set=root --label GuixSD_image~@
|
||||
search --set=root --label gnu-disk-image~@
|
||||
configfile /boot/grub/grub.cfg~%")))
|
||||
|
||||
(display "creating EFI firmware image...")
|
||||
|
||||
+234
-370
File diff suppressed because it is too large
Load Diff
+19
-51
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
|
||||
;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
|
||||
@@ -30,7 +30,6 @@
|
||||
#:select ((package-name->name+version
|
||||
. hyphen-separated-name->name+version)))
|
||||
#:autoload (guix profiles) (packages->manifest)
|
||||
#:use-module (guix describe)
|
||||
#:use-module (ice-9 vlist)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (srfi srfi-1)
|
||||
@@ -47,7 +46,6 @@
|
||||
%auxiliary-files-path
|
||||
%bootstrap-binaries-path
|
||||
%package-module-path
|
||||
%default-package-module-path
|
||||
|
||||
fold-packages
|
||||
|
||||
@@ -112,29 +110,8 @@ for system '~a'")
|
||||
file-name system)))))))
|
||||
|
||||
(define %distro-root-directory
|
||||
;; Absolute file name of the module hierarchy. Since (gnu packages …) might
|
||||
;; live in a directory different from (guix), try to get the best match.
|
||||
(letrec-syntax ((dirname* (syntax-rules ()
|
||||
((_ file)
|
||||
(dirname file))
|
||||
((_ file head tail ...)
|
||||
(dirname (dirname* file tail ...)))))
|
||||
(try (syntax-rules ()
|
||||
((_ (file things ...) rest ...)
|
||||
(match (search-path %load-path file)
|
||||
(#f
|
||||
(try rest ...))
|
||||
(absolute
|
||||
(dirname* absolute things ...))))
|
||||
((_)
|
||||
#f))))
|
||||
(try ("gnu/packages/base.scm" gnu/ packages/)
|
||||
("gnu/packages.scm" gnu/)
|
||||
("guix.scm"))))
|
||||
|
||||
(define %default-package-module-path
|
||||
;; Default search path for package modules.
|
||||
`((,%distro-root-directory . "gnu/packages")))
|
||||
;; Absolute file name of the module hierarchy.
|
||||
(dirname (search-path %load-path "guix.scm")))
|
||||
|
||||
(define %package-module-path
|
||||
;; Search path for package modules. Each item must be either a directory
|
||||
@@ -142,21 +119,16 @@ for system '~a'")
|
||||
;; to narrow the search.
|
||||
(let* ((not-colon (char-set-complement (char-set #\:)))
|
||||
(environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "")
|
||||
not-colon))
|
||||
(channels (package-path-entries)))
|
||||
;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's
|
||||
;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the
|
||||
;; front; channels go to the back so that they don't override Guix' own
|
||||
;; modules.
|
||||
(set! %load-path
|
||||
(append environment %load-path channels))
|
||||
(set! %load-compiled-path
|
||||
(append environment %load-compiled-path channels))
|
||||
not-colon)))
|
||||
;; Automatically add items from $GUIX_PACKAGE_PATH to Guile's search path.
|
||||
(for-each (lambda (directory)
|
||||
(set! %load-path (cons directory %load-path))
|
||||
(set! %load-compiled-path
|
||||
(cons directory %load-compiled-path)))
|
||||
environment)
|
||||
|
||||
(make-parameter
|
||||
(append environment
|
||||
%default-package-module-path
|
||||
channels))))
|
||||
(append environment `((,%distro-root-directory . "gnu/packages"))))))
|
||||
|
||||
(define %patch-path
|
||||
;; Define it after '%package-module-path' so that '%load-path' contains user
|
||||
@@ -168,21 +140,17 @@ for system '~a'")
|
||||
directory))
|
||||
%load-path)))
|
||||
|
||||
(define* (fold-packages proc init
|
||||
#:optional
|
||||
(modules (all-modules (%package-module-path)
|
||||
#:warn
|
||||
warn-about-load-error))
|
||||
#:key (select? (negate hidden-package?)))
|
||||
"Call (PROC PACKAGE RESULT) for each available package defined in one of
|
||||
MODULES that matches SELECT?, using INIT as the initial value of RESULT. It
|
||||
is guaranteed to never traverse the same package twice."
|
||||
(define (fold-packages proc init)
|
||||
"Call (PROC PACKAGE RESULT) for each available package, using INIT as
|
||||
the initial value of RESULT. It is guaranteed to never traverse the
|
||||
same package twice."
|
||||
(fold-module-public-variables (lambda (object result)
|
||||
(if (and (package? object) (select? object))
|
||||
(if (and (package? object)
|
||||
(not (hidden-package? object)))
|
||||
(proc object result)
|
||||
result))
|
||||
init
|
||||
modules))
|
||||
(all-modules (%package-module-path))))
|
||||
|
||||
(define find-packages-by-name
|
||||
(let ((packages (delay
|
||||
@@ -199,7 +167,7 @@ decreasing version order."
|
||||
version>?)))
|
||||
(if version
|
||||
(filter (lambda (package)
|
||||
(version-prefix? version (package-version package)))
|
||||
(string-prefix? version (package-version package)))
|
||||
matching)
|
||||
matching)))))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014 Marek Benc <merkur32@gmail.com>
|
||||
;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
|
||||
;;;
|
||||
@@ -62,7 +62,7 @@
|
||||
(build-system glib-or-gtk-build-system)
|
||||
(arguments ;; NOTE: rsvg is disabled, since Abiword
|
||||
`(#:configure-flags ;; supports it directly, and its BS is broken.
|
||||
(list ;; wmf was removed from Guix for security.
|
||||
(list
|
||||
"--enable-clipart" ;; TODO: The following plugins have unresolved
|
||||
"--enable-templates" ;; dependencies: aiksaurus, grammar, wpg, gda,
|
||||
(string-append ;; wordperfect, psion, mathview.
|
||||
@@ -73,7 +73,7 @@
|
||||
"latex " "loadbindings " "mht " "mif " "mswrite " "opendocument "
|
||||
"openwriter " "openxml " "opml " "ots " "paint " "passepartout "
|
||||
"pdb " "pdf " "presentation " "s5 " "sdw " "t602 " "urldict "
|
||||
"wikipedia " "wml " "xslfo"))
|
||||
"wikipedia " "wmf " "wml " "xslfo"))
|
||||
;; tests fail with: Gtk-CRITICAL **: gtk_settings_get_for_screen:
|
||||
;; assertion 'GDK_IS_SCREEN (screen)' failed
|
||||
;; GLib-GObject-CRITICAL **: g_object_get_qdata:
|
||||
@@ -82,7 +82,7 @@
|
||||
;; the tests to pass.
|
||||
#:tests? #f
|
||||
#:make-flags
|
||||
(list "CXXFLAGS=-std=c++11" "gtk_update_icon_cache=true")))
|
||||
(list "CXXFLAGS=-std=c++11")))
|
||||
(inputs
|
||||
`(("boost" ,boost)
|
||||
("enchant" ,enchant)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
|
||||
;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2017 ng0 <ng0@no-reply.pragmatique.xyz>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -22,8 +20,6 @@
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system glib-or-gtk)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages xml)
|
||||
@@ -33,8 +29,7 @@
|
||||
#:use-module (gnu packages xorg)
|
||||
#:use-module (gnu packages gettext)
|
||||
#:use-module (gnu packages glib)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (gnu packages libusb))
|
||||
#:use-module (gnu packages pkg-config))
|
||||
|
||||
(define-public florence
|
||||
(package
|
||||
@@ -81,44 +76,3 @@ available to help to click.")
|
||||
;; The documentation is under FDL1.2, but we do not install the
|
||||
;; documentation.
|
||||
(license license:gpl2+)))
|
||||
|
||||
(define-public footswitch
|
||||
(let ((commit "ca43d53fc2002520cc825d119702afc124303e73")
|
||||
(revision "2"))
|
||||
(package
|
||||
(name "footswitch")
|
||||
(version (git-version "0.1" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/rgerganov/footswitch")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"14pyzc4ws1mj859xs9n4x83wzxxvd3bh5bdxzr6nv267xwx1mq68"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)))
|
||||
(inputs
|
||||
`(("hidapi" ,hidapi)))
|
||||
(arguments
|
||||
`(#:tests? #f ; no tests
|
||||
#:make-flags (list "CC=gcc")
|
||||
#:phases (modify-phases %standard-phases
|
||||
(delete 'configure)
|
||||
;; Install target in the Makefile does not work for Guix
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let ((bin (string-append (assoc-ref outputs "out")
|
||||
"/bin")))
|
||||
(install-file "footswitch" bin)
|
||||
(install-file "scythe" bin)
|
||||
#t))))))
|
||||
(home-page "https://github.com/rgerganov/footswitch")
|
||||
(synopsis "Command line utility for PCsensor foot switch")
|
||||
(description
|
||||
"Command line utility for programming foot switches sold by PCsensor.
|
||||
It works for both single pedal devices and three pedal devices. All supported
|
||||
devices have vendorId:productId = 0c45:7403 or 0c45:7404.")
|
||||
(license license:expat))))
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
(define-public acct
|
||||
(package
|
||||
(name "acct")
|
||||
(version "6.6.4")
|
||||
(version "6.6.3")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
@@ -33,7 +33,7 @@
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0gv6m8giazshvgpvwbng98chpas09myyfw1zr2y7hqxib0mvy5ac"))))
|
||||
"14x0zklwlg7cc7amlyzffqr8az3fqj1h9dyj0hvl1kpi7cr7kbjy"))))
|
||||
(build-system gnu-build-system)
|
||||
(home-page "https://gnu.org/software/acct/")
|
||||
(synopsis "Standard login and process accounting utilities")
|
||||
|
||||
+15
-40
@@ -1,9 +1,7 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
|
||||
;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
|
||||
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -43,50 +41,27 @@
|
||||
(sha256
|
||||
(base32
|
||||
"08qd9s3wfhv0ajswsylnfwr5h0d7j9d4rgip855nrh400nxp940p"))
|
||||
(patches (search-patches "acl-fix-perl-regex.patch"
|
||||
"acl-hurd-path-max.patch"))))
|
||||
(patches (search-patches "acl-hurd-path-max.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:test-target "tests"
|
||||
#:modules ((ice-9 ftw)
|
||||
,@%gnu-build-system-modules)
|
||||
`(#:tests? #f ; FIXME: Investigate test suite failures
|
||||
#:test-target "tests"
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
;; XXX After repacking the sources the timestamps are reset to the
|
||||
;; epoch, which leads to a failure in gzipping the CHANGES file.
|
||||
(add-after 'unpack 'ensure-no-mtimes-pre-1980
|
||||
(lambda _
|
||||
(let ((early-1980 315619200)) ; 1980-01-02 UTC
|
||||
(ftw "." (lambda (file stat flag)
|
||||
(unless (<= early-1980 (stat:mtime stat))
|
||||
(utime file early-1980 early-1980))
|
||||
#t))
|
||||
#t)))
|
||||
(add-after 'build 'patch-exec-bin-sh
|
||||
(lambda _
|
||||
(substitute* "test/run"
|
||||
(("/bin/sh") (which "sh")))
|
||||
#t))
|
||||
(add-before 'check 'patch-tests
|
||||
(lambda _
|
||||
;; The coreutils do not have an ACL bit to remove from their
|
||||
;; output, so the sed expression that removes the bit is disabled.
|
||||
(substitute* "test/sbits-restore.test"
|
||||
(("\\| sed.*'") ""))
|
||||
;; These tests require the existence of a user named "bin", but
|
||||
;; this user does not exist within Guix's build environment.
|
||||
(for-each (lambda (file)
|
||||
(delete-file (string-append "test/" file)))
|
||||
'("setfacl-X.test" "cp.test" "misc.test"))
|
||||
#t))
|
||||
(replace 'install
|
||||
(lambda _
|
||||
(invoke "make" "install" "install-lib" "install-dev"))))))
|
||||
(alist-cons-after
|
||||
'build 'patch-exec-bin-sh
|
||||
(lambda _
|
||||
(substitute* "test/run"
|
||||
(("/bin/sh") (which "sh"))))
|
||||
(alist-replace
|
||||
'install
|
||||
(lambda _
|
||||
(zero? (system* "make" "install" "install-lib" "install-dev")))
|
||||
%standard-phases))))
|
||||
(inputs `(("attr" ,attr)))
|
||||
(native-inputs
|
||||
`(("gettext" ,gettext-minimal)
|
||||
("perl" ,perl)))
|
||||
(home-page "https://savannah.nongnu.org/projects/acl")
|
||||
(home-page "http://savannah.nongnu.org/projects/acl")
|
||||
(synopsis
|
||||
"Library and tools for manipulating access control lists")
|
||||
(description
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.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 ada)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system python)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages check)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages python))
|
||||
|
||||
(define-public python2-langkit
|
||||
(let ((commit "fe0bc8bf60dbd2937759810df76ac420d99fc15f")
|
||||
(revision "0"))
|
||||
(package
|
||||
(name "python2-langkit")
|
||||
(version (git-version "0.0.0" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/AdaCore/langkit.git")
|
||||
(commit commit)))
|
||||
(sha256
|
||||
(base32
|
||||
"1abqgw2p8pb1pm54my5kkbbixfhc6l0bwajdv1xlzyrh31xki3wx"))
|
||||
(file-name (string-append name "-" version "-checkout"))))
|
||||
(build-system python-build-system)
|
||||
(propagated-inputs
|
||||
`(("python2-docutils" ,python2-docutils)
|
||||
("python2-enum34" ,python2-enum34)
|
||||
("python2-funcy" ,python2-funcy)
|
||||
("python2-mako" ,python2-mako)))
|
||||
(arguments
|
||||
`(#:python ,python-2
|
||||
#:tests? #f)) ; Tests would requite gprbuild (Ada).
|
||||
(synopsis "Semantic analysis tool generator in Python")
|
||||
(description "@code{Langkit} is a tool whose purpose is to make it easy
|
||||
to create syntactic and semantic analysis engines. Write a language
|
||||
specification in our Python DSL and Langkit will generate for you an
|
||||
Ada library with bindings for the C and Python programming languages.")
|
||||
(home-page "https://github.com/AdaCore/langkit/")
|
||||
(license license:gpl3+)))) ; and gcc runtime library exception
|
||||
|
||||
(define-public python2-libadalang
|
||||
(let ((commit "9b205e9bacdd50a68117727332e16fbef5f6ac49")
|
||||
(revision "0"))
|
||||
(package
|
||||
(name "python2-libadalang")
|
||||
(version (git-version "0.0.0" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/AdaCore/libadalang.git")
|
||||
(commit commit)))
|
||||
(sha256
|
||||
(base32
|
||||
"06hsnzj2syqpq2yhg1bb0zil7ydbyqkdmkjbf8j9b5sdgkyh5xrp"))
|
||||
(file-name (string-append name "-" version "-checkout"))))
|
||||
(build-system python-build-system)
|
||||
(native-inputs
|
||||
`(("python2-langkit" ,python2-langkit)
|
||||
("python2-quex" ,python2-quex-0.67.3)))
|
||||
(arguments
|
||||
`(#:python ,python-2
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'build
|
||||
(lambda _
|
||||
(invoke "python2" "ada/manage.py" "generate")
|
||||
(invoke "python2" "ada/manage.py" "build")))
|
||||
(replace 'check
|
||||
(lambda _
|
||||
(invoke "python2" "ada/manage.py" "test")))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out")))
|
||||
(invoke "python2" "ada/manage.py" "install" out)))))))
|
||||
(synopsis "Semantic Analysis for Ada in Python")
|
||||
(description "@code{libadalang} provides a high-performance semantic
|
||||
engine for the Ada programming language.")
|
||||
(home-page "https://github.com/AdaCore/libadalang")
|
||||
(license license:gpl3)))) ; and gcc runtime gcc lib exception
|
||||
+525
-1205
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015, 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -59,7 +59,7 @@ scripts.")
|
||||
(define-public c-ares
|
||||
(package
|
||||
(name "c-ares")
|
||||
(version "1.14.0")
|
||||
(version "1.13.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -67,7 +67,7 @@ scripts.")
|
||||
".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0vnwmbvymw677k780kpb6sb8i3szdp89rzy8mz1fwg1657yw3ls5"))))
|
||||
"19qxhv9aiw903fr808y77r6l9js0fq9m3gcaqckan9jan7qhixq3"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)))
|
||||
@@ -79,4 +79,4 @@ asynchronously. It is intended for applications which need to perform DNS
|
||||
queries without blocking, or need to perform multiple DNS queries in parallel.
|
||||
The primary examples of such applications are servers which communicate with
|
||||
multiple clients and programs with graphical user interfaces.")
|
||||
(license (x11-style "https://c-ares.haxx.se/license.html"))))
|
||||
(license (x11-style "http://c-ares.haxx.se/license.html"))))
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018 Alex ter Weele <alex.ter.weele@gmail.com>
|
||||
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
|
||||
;;;
|
||||
;;; 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 agda)
|
||||
#:use-module (gnu packages haskell)
|
||||
#:use-module (gnu packages haskell-check)
|
||||
#:use-module (gnu packages haskell-web)
|
||||
#:use-module (guix build-system emacs)
|
||||
#:use-module (guix build-system haskell)
|
||||
#:use-module (guix build-system trivial)
|
||||
#:use-module (guix download)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages))
|
||||
|
||||
(define-public agda
|
||||
(package
|
||||
(name "agda")
|
||||
(version "2.5.4.1")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://hackage.haskell.org/package/Agda/Agda-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0bxpibsk98n9xp42d92ma5vj2fam8rsnl61fbhr3askfjdvalnbp"))))
|
||||
(build-system haskell-build-system)
|
||||
(inputs
|
||||
`(("cpphs" ,cpphs)
|
||||
("ghc-alex" ,ghc-alex)
|
||||
("ghc-async" ,ghc-async)
|
||||
("ghc-blaze-html" ,ghc-blaze-html)
|
||||
("ghc-boxes" ,ghc-boxes)
|
||||
("ghc-data-hash" ,ghc-data-hash)
|
||||
("ghc-edisoncore" ,ghc-edisoncore)
|
||||
("ghc-edit-distance" ,ghc-edit-distance)
|
||||
("ghc-equivalence" ,ghc-equivalence)
|
||||
("ghc-filemanip" ,ghc-filemanip)
|
||||
("ghc-geniplate-mirror" ,ghc-geniplate-mirror)
|
||||
("ghc-gitrev" ,ghc-gitrev)
|
||||
("ghc-happy" ,ghc-happy)
|
||||
("ghc-hashable" ,ghc-hashable)
|
||||
("ghc-hashtables" ,ghc-hashtables)
|
||||
("ghc-ieee754" ,ghc-ieee754)
|
||||
("ghc-murmur-hash" ,ghc-murmur-hash)
|
||||
("ghc-uri-encode" ,ghc-uri-encode)
|
||||
("ghc-parallel" ,ghc-parallel)
|
||||
("ghc-regex-tdfa" ,ghc-regex-tdfa)
|
||||
("ghc-stm" ,ghc-stm)
|
||||
("ghc-strict" ,ghc-strict)
|
||||
("ghc-text" ,ghc-text)
|
||||
("ghc-unordered-containers" ,ghc-unordered-containers)
|
||||
("ghc-zlib" ,ghc-zlib)))
|
||||
(arguments
|
||||
`(#:modules ((guix build haskell-build-system)
|
||||
(guix build utils)
|
||||
(srfi srfi-26)
|
||||
(ice-9 match))
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
;; FIXME: This is a copy of the standard configure phase with a tiny
|
||||
;; difference: this package needs the -package-db flag to be passed
|
||||
;; to "runhaskell" in addition to the "configure" action, because
|
||||
;; Setup.hs depends on filemanip. Without this option the Setup.hs
|
||||
;; file cannot be evaluated. The haskell-build-system should be
|
||||
;; changed to pass "-package-db" to "runhaskell" in any case.
|
||||
(replace 'configure
|
||||
(lambda* (#:key outputs inputs tests? (configure-flags '())
|
||||
#:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(name-version (strip-store-file-name out))
|
||||
(input-dirs (match inputs
|
||||
(((_ . dir) ...)
|
||||
dir)
|
||||
(_ '())))
|
||||
(ghc-path (getenv "GHC_PACKAGE_PATH"))
|
||||
(params (append `(,(string-append "--prefix=" out))
|
||||
`(,(string-append "--libdir=" out "/lib"))
|
||||
`(,(string-append "--bindir=" out "/bin"))
|
||||
`(,(string-append
|
||||
"--docdir=" out
|
||||
"/share/doc/" name-version))
|
||||
'("--libsubdir=$compiler/$pkg-$version")
|
||||
'("--package-db=../package.conf.d")
|
||||
'("--global")
|
||||
`(,@(map
|
||||
(cut string-append "--extra-include-dirs=" <>)
|
||||
(search-path-as-list '("include") input-dirs)))
|
||||
`(,@(map
|
||||
(cut string-append "--extra-lib-dirs=" <>)
|
||||
(search-path-as-list '("lib") input-dirs)))
|
||||
(if tests?
|
||||
'("--enable-tests")
|
||||
'())
|
||||
configure-flags)))
|
||||
(unsetenv "GHC_PACKAGE_PATH")
|
||||
(apply invoke "runhaskell" "-package-db=../package.conf.d"
|
||||
"Setup.hs" "configure" params)
|
||||
(setenv "GHC_PACKAGE_PATH" ghc-path)
|
||||
#t)))
|
||||
(add-after 'compile 'agda-compile
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(agda-compiler (string-append out "/bin/agda")))
|
||||
(for-each (cut invoke agda-compiler <>)
|
||||
(find-files (string-append out "/share") "\\.agda$"))
|
||||
#t))))))
|
||||
(home-page "http://wiki.portal.chalmers.se/agda/")
|
||||
(synopsis
|
||||
"Dependently typed functional programming language and proof assistant")
|
||||
(description
|
||||
"Agda is a dependently typed functional programming language: it has
|
||||
inductive families, which are similar to Haskell's GADTs, but they can be
|
||||
indexed by values and not just types. It also has parameterised modules,
|
||||
mixfix operators, Unicode characters, and an interactive Emacs interface (the
|
||||
type checker can assist in the development of your code). Agda is also a
|
||||
proof assistant: it is an interactive system for writing and checking proofs.
|
||||
Agda is based on intuitionistic type theory, a foundational system for
|
||||
constructive mathematics developed by the Swedish logician Per Martin-Löf. It
|
||||
has many similarities with other proof assistants based on dependent types,
|
||||
such as Coq, Epigram and NuPRL.")
|
||||
;; Agda is distributed under the MIT license, and a couple of
|
||||
;; source files are BSD-3. See LICENSE for details.
|
||||
(license (list license:expat license:bsd-3))))
|
||||
|
||||
(define-public emacs-agda2-mode
|
||||
(package
|
||||
(inherit agda)
|
||||
(name "emacs-agda2-mode")
|
||||
(build-system emacs-build-system)
|
||||
(inputs '())
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-elisp-dir
|
||||
(lambda _ (chdir "src/data/emacs-mode") #t)))))
|
||||
(home-page "https://agda.readthedocs.io/en/latest/tools/emacs-mode.html")
|
||||
(synopsis "Emacs mode for Agda")
|
||||
(description "This Emacs mode enables interactive development with
|
||||
Agda. It also aids the input of Unicode characters.")))
|
||||
+3
-27
@@ -1,8 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014 John Darringon <jmd@gnu.org>
|
||||
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -52,15 +50,15 @@ formats.")
|
||||
(define-public qrencode
|
||||
(package
|
||||
(name "qrencode")
|
||||
(version "4.0.2")
|
||||
(version "3.4.4")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://fukuchi.org/works/qrencode/qrencode-" version
|
||||
".tar.bz2"))
|
||||
".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1d2q5d3v8g3hsi3h5jq4n177bjhf3kawms09immw7p187f6jgjy9"))))
|
||||
"0wiagx7i8p9zal53smf5abrnh9lr31mv0p36wg017401jrmf5577"))))
|
||||
(build-system gnu-build-system)
|
||||
(inputs `(("libpng" ,libpng)))
|
||||
(native-inputs `(("pkg-config" ,pkg-config)))
|
||||
@@ -71,25 +69,3 @@ a mobile phone with CCD. The capacity of QR Code is up to 7000 digits or 4000
|
||||
characters, and is highly robust.")
|
||||
(license license:lgpl2.1+)
|
||||
(home-page "https://fukuchi.org/works/qrencode")))
|
||||
|
||||
(define-public libdmtx
|
||||
(package
|
||||
(name "libdmtx")
|
||||
(version "0.7.4")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"mirror://sourceforge/libdmtx/" name "/" version "/"
|
||||
name "-" version ".tar.bz2"))
|
||||
(sha256
|
||||
(base32 "0xnxx075ycy58n92yfda2z9zgd41h3d4ik5d9l197lzsqim5hb5n"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)))
|
||||
(home-page "http://libdmtx.sourceforge.net/")
|
||||
(synopsis "Library for reading and writing Data Matrix 2D barcodes")
|
||||
(description "libdmtx is software for reading and writing Data Matrix 2D
|
||||
barcodes on Linux and Unix. At its core libdmtx is a shared library, allowing
|
||||
C/C++ programs to use its capabilities without restrictions or overhead.")
|
||||
(license license:bsd-3)))
|
||||
|
||||
+118
-332
@@ -1,13 +1,11 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Andreas Enge <andreas@enge.fr>
|
||||
;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016, 2017, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Andreas Enge <andreas@enge.fr>
|
||||
;;; Copyright © 2013, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016, 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
|
||||
;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -27,9 +25,7 @@
|
||||
(define-module (gnu packages algebra)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages autotools)
|
||||
#:use-module (gnu packages check)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages cpp)
|
||||
#:use-module (gnu packages documentation)
|
||||
#:use-module (gnu packages ed)
|
||||
#:use-module (gnu packages flex)
|
||||
@@ -37,7 +33,6 @@
|
||||
#:use-module (gnu packages gl)
|
||||
#:use-module (gnu packages graphviz)
|
||||
#:use-module (gnu packages image)
|
||||
#:use-module (gnu packages java)
|
||||
#:use-module (gnu packages maths)
|
||||
#:use-module (gnu packages mpi)
|
||||
#:use-module (gnu packages multiprecision)
|
||||
@@ -49,11 +44,9 @@
|
||||
#:use-module (gnu packages texinfo)
|
||||
#:use-module (gnu packages xiph)
|
||||
#:use-module (gnu packages xorg)
|
||||
#:use-module (guix build-system ant)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system cmake)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix utils))
|
||||
@@ -62,15 +55,15 @@
|
||||
(define-public mpfrcx
|
||||
(package
|
||||
(name "mpfrcx")
|
||||
(version "0.5")
|
||||
(version "0.4.2")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"http://www.multiprecision.org/downloads/mpfrcx-"
|
||||
"http://www.multiprecision.org/mpfrcx/download/mpfrcx-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs"))))
|
||||
"0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy"))))
|
||||
(build-system gnu-build-system)
|
||||
(propagated-inputs
|
||||
`(("gmp" ,gmp)
|
||||
@@ -84,7 +77,7 @@ on the rounding. For the time being, only the few functions needed to
|
||||
implement the floating point approach to complex multiplication are
|
||||
implemented. On the other hand, these comprise asymptotically fast
|
||||
multiplication routines such as Toom–Cook and the FFT.")
|
||||
(license license:lgpl3+)
|
||||
(license license:lgpl2.1+)
|
||||
(home-page "http://mpfrcx.multiprecision.org/")))
|
||||
|
||||
(define-public cm
|
||||
@@ -139,15 +132,15 @@ solve the shortest vector problem.")
|
||||
(define-public pari-gp
|
||||
(package
|
||||
(name "pari-gp")
|
||||
(version "2.11.0")
|
||||
(version "2.9.2")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
|
||||
"http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"18f9yj8ffn3dxignbxj1x36771zbxy4js0r18mv6831ymb6cld9q"))))
|
||||
"0zi08qz9nk17wwdna4xb2vp3i3mh5sgv1y8wqbf0j2sfryxlr8ls"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs `(("texlive" ,texlive-tiny)))
|
||||
(inputs `(("gmp" ,gmp)
|
||||
@@ -174,20 +167,20 @@ polynomials, power series, algebraic numbers, etc., and a lot of
|
||||
transcendental functions.
|
||||
PARI is also available as a C library to allow for faster computations.")
|
||||
(license license:gpl2+)
|
||||
(home-page "https://pari.math.u-bordeaux.fr/")))
|
||||
(home-page "http://pari.math.u-bordeaux.fr/")))
|
||||
|
||||
(define-public gp2c
|
||||
(package
|
||||
(name "gp2c")
|
||||
(version "0.0.11pl1")
|
||||
(version "0.0.10")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
|
||||
"http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1c6f6vmncw032kfzrfyr8bynw6yd3faxpy2285r009fmr0zxfs5s"))))
|
||||
"1xhpz5p81iw261ay1kip283ggr0ir8ydz8qx3v24z8jfms1r3y70"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs `(("perl" ,perl)))
|
||||
(inputs `(("pari-gp" ,pari-gp)))
|
||||
@@ -208,42 +201,12 @@ PARI is also available as a C library to allow for faster computations.
|
||||
|
||||
GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
|
||||
(license license:gpl2)
|
||||
(home-page "https://pari.math.u-bordeaux.fr/")))
|
||||
|
||||
(define-public cmh
|
||||
(package
|
||||
(name "cmh")
|
||||
(version "1.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://gforge.inria.fr/frs/download.php/33497/cmh-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p"))))
|
||||
(build-system gnu-build-system)
|
||||
(inputs
|
||||
`(("gmp" ,gmp)
|
||||
("mpfr" ,mpfr)
|
||||
("mpc" ,mpc)
|
||||
("mpfrcx" ,mpfrcx)
|
||||
("fplll" ,fplll)
|
||||
("pari-gp" ,pari-gp)))
|
||||
(synopsis "Igusa class polynomial computations")
|
||||
(description
|
||||
"The CMH software computes Igusa (genus 2) class polynomials, which
|
||||
parameterize the CM points in the moduli space of 2-dimensional abelian
|
||||
varieties, i.e. Jacobians of hyperelliptic curves.
|
||||
It can also be used to compute theta constants at arbitrary
|
||||
precision.")
|
||||
(license license:gpl3+)
|
||||
(home-page "http://cmh.gforge.inria.fr/")))
|
||||
(home-page "http://pari.math.u-bordeaux.fr/")))
|
||||
|
||||
(define-public giac-xcas
|
||||
(package
|
||||
(name "giac-xcas")
|
||||
(version "1.5.0-19")
|
||||
(version "1.2.3-51")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
;; "~parisse/giac" is not used because the maintainer regularly
|
||||
@@ -255,48 +218,23 @@ precision.")
|
||||
"source/giac_" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0ds1zh712sr20qh0fih8jnm4nlv90andllp8n263qs7rlhblz551"))))
|
||||
"1w7d4sdjbvqiibnfkhrqy9np3smsysilfba9pry3q1qn5g5y6nrp"))))
|
||||
(build-system gnu-build-system)
|
||||
(outputs '("out" "doc")) ;77MiB of documentation
|
||||
(arguments
|
||||
`(#:modules ((ice-9 ftw)
|
||||
(guix build utils)
|
||||
(guix build gnu-build-system))
|
||||
#:phases
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-bin-cp
|
||||
;; Some Makefiles contain hard-coded "/bin/cp".
|
||||
(lambda _
|
||||
;; Some Makefiles contain hard-coded "/bin/cp".
|
||||
(substitute* (find-files "doc" "^Makefile")
|
||||
(("/bin/cp") (which "cp")))
|
||||
#t))
|
||||
(add-after 'unpack 'disable-failing-test
|
||||
;; FIXME: Test failing. Not sure why.
|
||||
(add-after 'unpack 'disable-broken-test
|
||||
(lambda _
|
||||
;; Disable failing test. Actually, the results are correct but
|
||||
;; a sorting discrepancy prevents the test from being validated.
|
||||
(substitute* "check/Makefile.in"
|
||||
(("chk_fhan11") ""))
|
||||
#t))
|
||||
(add-after 'install 'install-doc
|
||||
;; Setting --docdir to "doc" output isn't sufficient as
|
||||
;; documentation and examples are scattered throughout the source.
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(doc (assoc-ref outputs "doc"))
|
||||
(docdir (string-append doc
|
||||
"/share/doc/"
|
||||
(string-append ,name "-" ,version))))
|
||||
;; For some reason, the install process moves
|
||||
;; "share/giac/examples" instead of "share/giac/doc" to
|
||||
;; "$(docdir)". Clean up the mess and start over.
|
||||
(delete-file-recursively (string-append doc "/share"))
|
||||
(mkdir-p docdir)
|
||||
(with-directory-excursion out
|
||||
(for-each (lambda (f)
|
||||
(unless (member f '("." ".."))
|
||||
(copy-recursively (string-append "share/giac/" f)
|
||||
(string-append docdir "/" f))))
|
||||
(scandir "share/giac"))
|
||||
(delete-file-recursively "share/giac")))
|
||||
(("chk_fhan16") ""))
|
||||
#t)))))
|
||||
(inputs
|
||||
`(("fltk" ,fltk)
|
||||
@@ -376,47 +314,49 @@ fast arithmetic.")
|
||||
|
||||
(define-public arb
|
||||
(package
|
||||
(name "arb")
|
||||
(version "2.14.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/fredrik-johansson/arb.git")
|
||||
(commit version)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1ndxg7h4xvccjgp5l9z2f8b66dsff6fhf86bn5n7f75a1ksd7554"))))
|
||||
(build-system gnu-build-system)
|
||||
(propagated-inputs
|
||||
`(("flint" ,flint))) ; flint.h is included by arf.h
|
||||
(inputs
|
||||
`(("gmp" ,gmp)
|
||||
("mpfr" ,mpfr)))
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'configure
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out"))
|
||||
(flint (assoc-ref inputs "flint"))
|
||||
(gmp (assoc-ref inputs "gmp"))
|
||||
(mpfr (assoc-ref inputs "mpfr")))
|
||||
;; do not pass "--enable-fast-install", which makes the
|
||||
;; homebrew configure process fail
|
||||
(invoke "./configure"
|
||||
(string-append "--prefix=" out)
|
||||
(string-append "--with-flint=" flint)
|
||||
(string-append "--with-gmp=" gmp)
|
||||
(string-append "--with-mpfr=" mpfr))))))))
|
||||
(synopsis "Arbitrary precision floating-point ball arithmetic")
|
||||
(description
|
||||
"Arb is a C library for arbitrary-precision floating-point ball
|
||||
(name "arb")
|
||||
(version "2.10.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://github.com/fredrik-johansson/arb/archive/"
|
||||
version ".tar.gz"))
|
||||
(file-name (string-append name "-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0jwcv9ssvi8axb1y7m2h4ykgyl015cl6g28gfl92l4dgnag585ak"))))
|
||||
(build-system gnu-build-system)
|
||||
(propagated-inputs
|
||||
`(("flint" ,flint))) ; flint.h is included by arf.h
|
||||
(inputs
|
||||
`(("gmp" ,gmp)
|
||||
("mpfr" ,mpfr)))
|
||||
(arguments
|
||||
`(#:phases
|
||||
(alist-replace
|
||||
'configure
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out"))
|
||||
(flint (assoc-ref inputs "flint"))
|
||||
(gmp (assoc-ref inputs "gmp"))
|
||||
(mpfr (assoc-ref inputs "mpfr")))
|
||||
;; do not pass "--enable-fast-install", which makes the
|
||||
;; homebrew configure process fail
|
||||
(zero? (system*
|
||||
"./configure"
|
||||
(string-append "--prefix=" out)
|
||||
(string-append "--with-flint=" flint)
|
||||
(string-append "--with-gmp=" gmp)
|
||||
(string-append "--with-mpfr=" mpfr)))))
|
||||
%standard-phases)))
|
||||
(synopsis "Arbitrary precision floating-point ball arithmetic")
|
||||
(description
|
||||
"Arb is a C library for arbitrary-precision floating-point ball
|
||||
arithmetic. It supports efficient high-precision computation with
|
||||
polynomials, power series, matrices and special functions over the
|
||||
real and complex numbers, with automatic, rigorous error control.")
|
||||
(license license:lgpl2.1+)
|
||||
(home-page "http://fredrikj.net/arb/")))
|
||||
(license license:gpl2+)
|
||||
(home-page "http://fredrikj.net/arb/")))
|
||||
|
||||
(define-public ntl
|
||||
(package
|
||||
@@ -461,21 +401,15 @@ matrices, and polynomials over the integers and over finite fields.")
|
||||
(define-public singular
|
||||
(package
|
||||
(name "singular")
|
||||
(version "4.1.1p3")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri
|
||||
(string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/"
|
||||
"Singular/SOURCES/"
|
||||
(string-join
|
||||
(string-split
|
||||
(string-trim-right version #\p
|
||||
0 (1- (string-length version)))
|
||||
#\.) "-")
|
||||
"/singular-" version ".tar.gz"))
|
||||
(sha256 (base32
|
||||
"1qqj9bm9pkzm0iyycpvm8x6s79wws3nq60lz25h8x1q61h3426sm"))))
|
||||
(version "4.0.3")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://www.mathematik.uni-kl.de/ftp/pub/"
|
||||
"Math/Singular/SOURCES/"
|
||||
(string-join (string-split version #\.) "-")
|
||||
"/singular-" version ".tar.gz"))
|
||||
(sha256 (base32
|
||||
"0viidy2fz62rln9p0s9qfs7fnm55c6fw1agydd1py26gxylp1ksc"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs
|
||||
`(("doxygen" ,doxygen)
|
||||
@@ -507,14 +441,14 @@ geometry and singularity theory.")
|
||||
(define-public gmp-ecm
|
||||
(package
|
||||
(name "gmp-ecm")
|
||||
(version "7.0.4")
|
||||
(version "7.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
;; Use the ‘Latest version’ link for a stable URI across releases.
|
||||
(uri (string-append "https://gforge.inria.fr/frs/download.php/"
|
||||
"latestfile/160/ecm-" version ".tar.gz"))
|
||||
(sha256 (base32
|
||||
"0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://gforge.inria.fr/frs/download.php/"
|
||||
"file/35642/ecm-"
|
||||
version ".tar.gz"))
|
||||
(sha256 (base32
|
||||
"00jzzwqp49m01vwsr9z1w7bvm8lb69l3f62x7qr8sfz0xiczxnpm"))))
|
||||
(build-system gnu-build-system)
|
||||
(inputs
|
||||
`(("gmp" ,gmp)))
|
||||
@@ -545,6 +479,7 @@ binary.")
|
||||
(base32
|
||||
"0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
|
||||
(build-system gnu-build-system)
|
||||
(inputs `(("readline" ,readline)))
|
||||
(native-inputs
|
||||
`(("ed" ,ed)
|
||||
("flex" ,flex)
|
||||
@@ -568,14 +503,13 @@ syntax is similar to that of C, so basic usage is familiar. It also includes
|
||||
(name "kiss-fft-for-extempore")
|
||||
(version "1.3.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/extemporelang/kiss_fft.git")
|
||||
(commit version)))
|
||||
(file-name (git-file-name name version))
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://github.com/extemporelang/kiss_fft/archive/"
|
||||
version ".tar.gz"))
|
||||
(file-name (string-append name "-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
|
||||
"0hkp9l6l4c92fb1l2sh6a6zv1hynpvb2s4d03vd8vxyvybc0l4pv"))))
|
||||
(build-system cmake-build-system)
|
||||
(arguments `(#:tests? #f)) ; no tests included
|
||||
;; Extempore refuses to build on architectures other than x86_64
|
||||
@@ -591,38 +525,28 @@ a C program.")
|
||||
(define-public fftw
|
||||
(package
|
||||
(name "fftw")
|
||||
(version "3.3.8")
|
||||
(version "3.3.5")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
|
||||
version".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
|
||||
"1kwbx92ps0r7s2mqy7lxbxanslxdzj7dp7r7gmdkzv1j8yqf3kwf"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:configure-flags
|
||||
'("--enable-shared" "--enable-openmp" "--enable-threads"
|
||||
,@(let ((system (or (%current-target-system) (%current-system))))
|
||||
;; Enable SIMD extensions for codelets. See details at:
|
||||
;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
|
||||
(cond
|
||||
((string-prefix? "x86_64" system)
|
||||
'("--enable-sse2" "--enable-avx" "--enable-avx2"
|
||||
"--enable-avx512" "--enable-avx-128-fma"))
|
||||
((string-prefix? "i686" system)
|
||||
'("--enable-sse2"))
|
||||
((string-prefix? "aarch64" system)
|
||||
;; Note that fftw supports NEON on 32-bit ARM only when
|
||||
;; compiled for single-precision.
|
||||
'("--enable-neon"))
|
||||
(else
|
||||
'())))
|
||||
;; By default '-mtune=native' is used. However, that may cause the
|
||||
;; use of ISA extensions (e.g. AVX) that are not necessarily
|
||||
;; available on the user's machine when that package is built on a
|
||||
;; different machine.
|
||||
"ax_cv_c_flags__mtune_native=no")))
|
||||
'(#:configure-flags
|
||||
'("--enable-shared" "--enable-openmp" "--enable-threads")
|
||||
#:phases (alist-cons-before
|
||||
'build 'no-native
|
||||
(lambda _
|
||||
;; By default '-mtune=native' is used. However, that may
|
||||
;; cause the use of ISA extensions (SSE2, etc.) that are
|
||||
;; not necessarily available on the user's machine when
|
||||
;; that package is built on a different machine.
|
||||
(substitute* (find-files "." "Makefile$")
|
||||
(("-mtune=native") "")))
|
||||
%standard-phases)))
|
||||
(native-inputs `(("perl" ,perl)))
|
||||
(home-page "http://fftw.org")
|
||||
(synopsis "Computing the discrete Fourier transform")
|
||||
@@ -638,15 +562,8 @@ cosine/ sine transforms or DCT/DST).")
|
||||
(name "fftwf")
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments fftw)
|
||||
((#:configure-flags fftw-configure-flags)
|
||||
`(cons* "--enable-single"
|
||||
,@(if (string-prefix? "arm" (or (%current-target-system)
|
||||
(%current-system)))
|
||||
;; fftw supports NEON on 32-bit ARM only when compiled
|
||||
;; for single-precision, so add it here.
|
||||
'("--enable-neon")
|
||||
'())
|
||||
,fftw-configure-flags))))
|
||||
((#:configure-flags cf)
|
||||
`(cons "--enable-float" ,cf))))
|
||||
(description
|
||||
(string-append (package-description fftw)
|
||||
" Single-precision version."))))
|
||||
@@ -665,126 +582,30 @@ cosine/ sine transforms or DCT/DST).")
|
||||
(string-append (package-description fftw)
|
||||
" With OpenMPI parallelism support."))))
|
||||
|
||||
(define-public java-la4j
|
||||
(package
|
||||
(name "java-la4j")
|
||||
(version "0.6.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/vkostyukov/la4j.git")
|
||||
(commit version)))
|
||||
(file-name (string-append name "-" version "-checkout"))
|
||||
(sha256
|
||||
(base32
|
||||
"1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
|
||||
(build-system ant-build-system)
|
||||
(arguments
|
||||
`(#:jar-name "la4j.jar"
|
||||
#:jdk ,icedtea-8
|
||||
#:test-exclude (list "**/Abstract*.java"
|
||||
"**/MatrixTest.java"
|
||||
"**/DenseMatrixTest.java"
|
||||
"**/SparseMatrixTest.java"
|
||||
"**/VectorTest.java"
|
||||
"**/SparseVectorTest.java"
|
||||
"**/DenseVectorTest.java")))
|
||||
(native-inputs
|
||||
`(("java-junit" ,java-junit)
|
||||
("java-hamcrest-core" ,java-hamcrest-core)))
|
||||
(home-page "http://la4j.org/")
|
||||
(synopsis "Java library that provides Linear Algebra primitives and algorithms")
|
||||
(description "The la4j library is a Java library that provides Linear
|
||||
Algebra primitives (matrices and vectors) and algorithms. The key features of
|
||||
the la4j library are:
|
||||
|
||||
@itemize
|
||||
@item No dependencies and tiny size
|
||||
@item Fluent object-oriented/functional API
|
||||
@item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
|
||||
@item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
|
||||
@item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
|
||||
@item MatrixMarket/CSV IO formats support for matrices and vectors
|
||||
@end itemize\n")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public java-jlargearrays
|
||||
(package
|
||||
(name "java-jlargearrays")
|
||||
(version "1.6")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://search.maven.org/remotecontent?"
|
||||
"filepath=pl/edu/icm/JLargeArrays/"
|
||||
version "/JLargeArrays-" version
|
||||
"-sources.jar"))
|
||||
(file-name (string-append name "-" version ".jar"))
|
||||
(sha256
|
||||
(base32
|
||||
"0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
|
||||
(build-system ant-build-system)
|
||||
(arguments
|
||||
`(#:jar-name "jlargearrays.jar"
|
||||
#:tests? #f ; tests are not included in the release archive
|
||||
#:jdk ,icedtea-8))
|
||||
(propagated-inputs
|
||||
`(("java-commons-math3" ,java-commons-math3)))
|
||||
(home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
|
||||
(synopsis "Library of one-dimensional arrays that can store up to 263 elements")
|
||||
(description "JLargeArrays is a Java library of one-dimensional arrays
|
||||
that can store up to 263 elements.")
|
||||
(license license:bsd-2)))
|
||||
|
||||
(define-public java-jtransforms
|
||||
(package
|
||||
(name "java-jtransforms")
|
||||
(version "3.1")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://search.maven.org/remotecontent?"
|
||||
"filepath=com/github/wendykierp/JTransforms/"
|
||||
version "/JTransforms-" version "-sources.jar"))
|
||||
(sha256
|
||||
(base32
|
||||
"1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
|
||||
(build-system ant-build-system)
|
||||
(arguments
|
||||
`(#:jar-name "jtransforms.jar"
|
||||
#:tests? #f ; tests are not included in the release archive
|
||||
#:jdk ,icedtea-8))
|
||||
(propagated-inputs
|
||||
`(("java-commons-math3" ,java-commons-math3)
|
||||
("java-jlargearrays" ,java-jlargearrays)))
|
||||
(home-page "https://github.com/wendykierp/JTransforms")
|
||||
(synopsis "Multithreaded FFT library written in pure Java")
|
||||
(description "JTransforms is a multithreaded FFT library written in pure
|
||||
Java. Currently, four types of transforms are available: @dfn{Discrete
|
||||
Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
|
||||
Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
|
||||
(license license:bsd-2)))
|
||||
|
||||
(define-public eigen
|
||||
(package
|
||||
(name "eigen")
|
||||
(version "3.3.5")
|
||||
(version "3.2.9")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://bitbucket.org/eigen/eigen/get/"
|
||||
version ".tar.bz2"))
|
||||
(sha256
|
||||
(base32
|
||||
"1qh3yrwn78ms5yhwbpl5wvblk4gbz02cacdygxylr7i9xbrvylkk"))
|
||||
"1zs5b210mq7nyanky07li6456rrd0xv2nxf6sl2lhkzdq5p067jd"))
|
||||
(file-name (string-append name "-" version ".tar.bz2"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet
|
||||
;; There are 3 test failures in the "unsupported" directory,
|
||||
;; but maintainers say it's a known issue and it's unsupported
|
||||
;; anyway, so just skip them.
|
||||
'(begin
|
||||
(substitute* "unsupported/CMakeLists.txt"
|
||||
(("add_subdirectory\\(test.*")
|
||||
"# Do not build the tests for unsupported features.\n"))
|
||||
#t))))
|
||||
'(substitute* "CMakeLists.txt"
|
||||
(("add_subdirectory\\(unsupported\\)")
|
||||
"# Do not build the tests for unsupported features.\n")
|
||||
;; Work around
|
||||
;; <http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1114>.
|
||||
(("\"include/eigen3\"")
|
||||
"\"${CMAKE_INSTALL_PREFIX}/include/eigen3\"")))))
|
||||
(build-system cmake-build-system)
|
||||
(arguments
|
||||
'(;; Turn off debugging symbols to save space.
|
||||
@@ -795,15 +616,14 @@ Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
|
||||
(lambda _
|
||||
(let* ((cores (parallel-job-count))
|
||||
(dash-j (format #f "-j~a" cores)))
|
||||
(setenv "EIGEN_SEED" "1") ;for reproducibility
|
||||
;; First build the tests, in parallel. See
|
||||
;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
|
||||
(invoke "make" "buildtests" dash-j)
|
||||
(and (zero? (system* "make" "buildtests" dash-j))
|
||||
|
||||
;; Then run 'CTest' with -V so we get more
|
||||
;; details upon failure.
|
||||
(invoke "ctest" "-V" dash-j)))))))
|
||||
(home-page "https://eigen.tuxfamily.org")
|
||||
;; Then run 'CTest' with -V so we get more
|
||||
;; details upon failure.
|
||||
(zero? (system* "ctest" "-V" dash-j)))))))))
|
||||
(home-page "http://eigen.tuxfamily.org")
|
||||
(synopsis "C++ template library for linear algebra")
|
||||
(description
|
||||
"Eigen is a C++ template library for linear algebra: matrices, vectors,
|
||||
@@ -815,37 +635,3 @@ features, and more.")
|
||||
;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
|
||||
;; See 'COPYING.README' for details.
|
||||
(license license:mpl2.0)))
|
||||
|
||||
(define-public xtensor
|
||||
(package
|
||||
(name "xtensor")
|
||||
(version "0.17.1")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/QuantStack/xtensor.git")
|
||||
(commit version)))
|
||||
(sha256
|
||||
(base32
|
||||
"0w40v5lp0hp8ihf8nnvak373sb5xx0768pxgiqh3nzn57wf8px4r"))
|
||||
(file-name (git-file-name name version))))
|
||||
(build-system cmake-build-system)
|
||||
(native-inputs
|
||||
`(("googletest" ,googletest)
|
||||
("xtl" ,xtl)))
|
||||
(arguments
|
||||
`(#:configure-flags
|
||||
'("-DBUILD_TESTS=ON")
|
||||
#:test-target "xtest"))
|
||||
(home-page "http://quantstack.net/xtensor")
|
||||
(synopsis "C++ tensors with broadcasting and lazy computing")
|
||||
(description "xtensor is a C++ library meant for numerical analysis with
|
||||
multi-dimensional array expressions.
|
||||
|
||||
xtensor provides:
|
||||
@itemize
|
||||
@item an extensible expression system enabling lazy broadcasting.
|
||||
@item an API following the idioms of the C++ standard library.
|
||||
@item tools to manipulate array expressions and build upon xtensor.
|
||||
@end itemize")
|
||||
(license license:bsd-3)))
|
||||
|
||||
+155
-674
@@ -4,9 +4,6 @@
|
||||
;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
|
||||
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
|
||||
;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
||||
;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -25,81 +22,16 @@
|
||||
|
||||
(define-module (gnu packages android)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system android-ndk)
|
||||
#:use-module (guix build-system python)
|
||||
#:use-module (guix build-system trivial)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages check)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages docker)
|
||||
#:use-module (gnu packages gnupg)
|
||||
#:use-module (gnu packages pcre)
|
||||
#:use-module (gnu packages python)
|
||||
#:use-module (gnu packages python-crypto)
|
||||
#:use-module (gnu packages python-web)
|
||||
#:use-module (gnu packages selinux)
|
||||
#:use-module (gnu packages serialization)
|
||||
#:use-module (gnu packages ssh)
|
||||
#:use-module (gnu packages tls)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages virtualization)
|
||||
#:use-module (gnu packages xdisorg)
|
||||
#:use-module (gnu packages linux))
|
||||
|
||||
(define-public android-make-stub
|
||||
(package
|
||||
(name "android-make-stub")
|
||||
(version "0.6.0")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/daym/android-make-stub.git")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (string-append "android-make-stub-"
|
||||
version "-checkout"))
|
||||
(sha256
|
||||
(base32
|
||||
"0y1b2x96d37n6f1bp6dcx08bn08zac0cylmbfsx6mf2nahc02fhc"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f ; None exist.
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(delete 'configure)
|
||||
(delete 'build)
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out")))
|
||||
(invoke "make" (string-append "prefix=" out) "install")
|
||||
#t))))))
|
||||
(home-page "https://github.com/daym/android-make-stub")
|
||||
(synopsis "Stubs for the @command{make} system of the Android platform")
|
||||
(description "@code{android-make-stub} provides stubs for the
|
||||
@command{make} system of the Android platform. This allows us to
|
||||
use their packages mostly unmodified in our Android NDK build system.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-googletest
|
||||
(package (inherit googletest)
|
||||
(name "android-googletest")
|
||||
(arguments
|
||||
`(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'install 'install-host-libraries
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib")))
|
||||
(symlink "libgtest.so"
|
||||
(string-append lib "/libgtest_host.so"))
|
||||
(symlink "libgmock.so"
|
||||
(string-append lib "/libgmock_host.so"))
|
||||
#t))))))))
|
||||
#:use-module (gnu packages tls))
|
||||
|
||||
;; The Makefiles that we add are largely based on the Debian
|
||||
;; packages. They are licensed under GPL-2 and have copyright:
|
||||
@@ -108,7 +40,7 @@ use their packages mostly unmodified in our Android NDK build system.")
|
||||
;; Big thanks to them for laying the groundwork.
|
||||
|
||||
;; The version tag is consistent between all repositories.
|
||||
(define (android-platform-version) "7.1.2_r36")
|
||||
(define (android-platform-version) "7.1.2_r6")
|
||||
|
||||
(define (android-platform-system-core version)
|
||||
(origin
|
||||
@@ -120,69 +52,52 @@ use their packages mostly unmodified in our Android NDK build system.")
|
||||
version "-checkout"))
|
||||
(sha256
|
||||
(base32
|
||||
"1krnc2b9zfkzpdgs1dcbji59nszlx2qr723pg89m52622czc06hg"))
|
||||
(patches
|
||||
(search-patches "libbase-use-own-logging.patch"
|
||||
"libbase-fix-includes.patch"
|
||||
"libutils-remove-damaging-includes.patch"
|
||||
"libutils-add-includes.patch"
|
||||
"adb-add-libraries.patch"
|
||||
"libziparchive-add-includes.patch"))))
|
||||
"0xc2n7jxrf1iw9cc278pijdfjix2fkiig5ws27f6rwp40zg5mrgg"))))
|
||||
|
||||
(define (android-platform-system-extras version)
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://android.googlesource.com/platform/system/extras")
|
||||
(commit (string-append "android-" version))))
|
||||
(file-name (string-append "android-platform-system-extras-"
|
||||
version "-checkout"))
|
||||
(sha256
|
||||
(base32
|
||||
"18130c23ybqcpgjc5v6f8kdbv2xn39hyiaj17dzldjb9rlwzcyy9"))))
|
||||
|
||||
(define (android-platform-bionic version)
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://android.googlesource.com/platform/bionic")
|
||||
(commit (string-append "android-" version))))
|
||||
(file-name (string-append "android-platform-bionic-"
|
||||
version "-checkout"))
|
||||
(sha256
|
||||
(base32
|
||||
"15r4s20d7vw022f8vrc3jbghmqwdcqzprl7i2bfvdkz8z76wc1ps"))))
|
||||
|
||||
(define (android-platform-external version subdirectory checksum)
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url
|
||||
(string-append "https://android.googlesource.com/platform/external/"
|
||||
subdirectory))
|
||||
(commit (string-append "android-" version))))
|
||||
(file-name (string-append "android-platform-system-external-" subdirectory "-"
|
||||
version "-checkout"))
|
||||
(sha256
|
||||
(base32
|
||||
checksum))))
|
||||
|
||||
(define android-liblog
|
||||
(define liblog
|
||||
(package
|
||||
(name "android-liblog")
|
||||
(name "liblog")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system android-ndk-build-system)
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:make-flags '("LDLIBS=-lpthread")
|
||||
`(#:tests? #f ; TODO.
|
||||
#:make-flags '("CC=gcc")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "liblog") #t))
|
||||
(add-after 'install 'ldconfig
|
||||
(add-after 'enter-source 'create-Makefile
|
||||
(lambda _
|
||||
;; No useful makefile is shipped, so we create one.
|
||||
(with-output-to-file "Makefile"
|
||||
(lambda _
|
||||
(display
|
||||
(string-append
|
||||
"NAME = liblog\n"
|
||||
"SOURCES = log_event_list.c log_event_write.c"
|
||||
" logger_write.c config_write.c logger_name.c"
|
||||
" logger_lock.c fake_log_device.c fake_writer.c"
|
||||
" event_tag_map.c\n"
|
||||
|
||||
"CFLAGS += -fvisibility=hidden -fPIC\n"
|
||||
"CPPFLAGS += -I../include -DFAKE_LOG_DEVICE=1"
|
||||
;; Keep these two in sync with "liblog/Android.bp".
|
||||
" -DLIBLOG_LOG_TAG=1005"
|
||||
" -DSNET_EVENT_LOG_TAG=1397638484\n"
|
||||
"LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread\n"
|
||||
|
||||
"build: $(SOURCES)\n"
|
||||
" $(CC) $^ -o $(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)\n"))
|
||||
#t))))
|
||||
(delete 'configure)
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(symlink "liblog.so.0" (string-append out "/lib/liblog.so"))
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib")))
|
||||
(install-file "liblog.so.0" lib)
|
||||
(with-directory-excursion lib
|
||||
(symlink "liblog.so.0" "liblog.so"))
|
||||
#t))))))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Logging library from the Android platform.")
|
||||
@@ -192,29 +107,62 @@ interfaces for either writing or reading logs. The log buffers are divided up
|
||||
in Main, System, Radio and Events sub-logs.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define android-libbase
|
||||
(define libbase
|
||||
(package
|
||||
(name "android-libbase")
|
||||
(name "libbase")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system android-ndk-build-system)
|
||||
(source (origin
|
||||
(inherit (android-platform-system-core version))
|
||||
(patches
|
||||
(search-patches "libbase-use-own-logging.patch"
|
||||
"libbase-fix-includes.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f ; Test failure: logging.UNIMPLEMENTED
|
||||
#:make-flags '("CXXFLAGS=-std=gnu++11")
|
||||
`(#:tests? #f ; TODO.
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "base") #t)))))
|
||||
(inputs `(("android-liblog" ,android-liblog)))
|
||||
(lambda _ (chdir "base") #t))
|
||||
(add-after 'enter-source 'create-Makefile
|
||||
(lambda _
|
||||
;; No useful makefile is shipped, so we create one.
|
||||
(with-output-to-file "Makefile"
|
||||
(lambda _
|
||||
(display
|
||||
(string-append
|
||||
"NAME = libbase\n"
|
||||
"SOURCES = file.cpp logging.cpp parsenetaddress.cpp"
|
||||
" stringprintf.cpp strings.cpp errors_unix.cpp\n"
|
||||
|
||||
"CXXFLAGS += -std=gnu++11 -fPIC\n"
|
||||
"CPPFLAGS += -Iinclude -I../include\n"
|
||||
"LDFLAGS += -shared -Wl,-soname,$(NAME).so.0"
|
||||
" -L.. -llog\n"
|
||||
|
||||
"build: $(SOURCES)\n"
|
||||
" $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS)"
|
||||
" $(LDFLAGS)\n"))
|
||||
#t))))
|
||||
(delete 'configure)
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib")))
|
||||
(install-file "libbase.so.0" lib)
|
||||
(with-directory-excursion lib
|
||||
(symlink "libbase.so.0" "libbase.so"))
|
||||
(copy-recursively "include" out)
|
||||
#t))))))
|
||||
(inputs `(("liblog" ,liblog)))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android platform base library")
|
||||
(description "@code{libbase} is a library in common use by the
|
||||
various Android core host applications.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define android-libcutils
|
||||
(define libcutils
|
||||
(package
|
||||
(name "android-libcutils")
|
||||
(name "libcutils")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system gnu-build-system)
|
||||
@@ -252,13 +200,10 @@ various Android core host applications.")
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib"))
|
||||
(include (string-append out "/include")))
|
||||
(lib (string-append out "/lib")))
|
||||
(install-file "libcutils.so.0" lib)
|
||||
(with-directory-excursion lib
|
||||
(symlink "libcutils.so.0" "libcutils.so"))
|
||||
(copy-recursively "../include/cutils"
|
||||
(string-append include "/cutils"))
|
||||
#t))))))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android platform c utils library")
|
||||
@@ -266,99 +211,90 @@ various Android core host applications.")
|
||||
various Android core host applications.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-libsparse
|
||||
(package
|
||||
(name "android-libsparse")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:make-flags '("CFLAGS=-Wno-error"
|
||||
"CXXFLAGS=-fpermissive -Wno-error")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "libsparse") #t)))))
|
||||
(inputs
|
||||
`(("zlib" ,zlib)))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android platform sparse library")
|
||||
(description "@code{android-libsparse} is a library in common use by the
|
||||
various Android core host applications.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-libziparchive
|
||||
(package
|
||||
(name "android-libziparchive")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:make-flags '("CFLAGS=-Wno-error"
|
||||
"CXXFLAGS=-fpermissive -Wno-error -std=gnu++11")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "libziparchive") #t))
|
||||
(add-before 'check 'setenv
|
||||
(lambda _
|
||||
(setenv "ziparchive_tests_host_PARAMS" "--test_data_dir=testdata")
|
||||
#t))
|
||||
(add-after 'install 'install-headers
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(copy-recursively "../include/ziparchive"
|
||||
(string-append out "/include/ziparchive"))
|
||||
#t))))))
|
||||
(inputs
|
||||
`(("zlib" ,zlib)))
|
||||
(native-inputs
|
||||
`(("android-libbase" ,android-libbase)
|
||||
("android-libutils" ,android-libutils)
|
||||
("android-liblog" ,android-liblog)))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android platform ZIP library")
|
||||
(description "@code{android-libziparchive} is a library in common use by the
|
||||
various Android core host applications.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public adb
|
||||
(package
|
||||
(name "adb")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system android-ndk-build-system)
|
||||
(source (origin
|
||||
(inherit (android-platform-system-core version))
|
||||
(patches
|
||||
(search-patches "libbase-use-own-logging.patch"
|
||||
"libbase-fix-includes.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f ; Test failure: sysdeps_poll.fd_count
|
||||
#:make-flags
|
||||
(list "CFLAGS=-Wno-error"
|
||||
"CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ."
|
||||
(string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib "
|
||||
"-Wl,-rpath=" (assoc-ref %build-inputs "openssl") "/lib -L ."))
|
||||
#:phases
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "adb") #t))
|
||||
(add-after 'enter-source 'glibc-compat
|
||||
(add-before 'build 'fix-clang
|
||||
(lambda _
|
||||
;; Include sysmacros.h for "major" and "minor" in Glibc 2.28.
|
||||
(substitute* "usb_linux.cpp"
|
||||
(("#include <sys/types.h>" all)
|
||||
(string-append all "\n#include <sys/sysmacros.h>\n")))
|
||||
;; adb_client.h contains _Nonnull and _Nullable attributes, that
|
||||
;; are not understood by gcc.
|
||||
(substitute* "adb_client.h"
|
||||
(("_Nonnull") "")
|
||||
(("_Nullable") ""))
|
||||
#t))
|
||||
(add-after 'enter-source 'make-libs-available
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(substitute* "Android.mk"
|
||||
(("libcrypto_static") "libcrypto"))
|
||||
(add-before 'build 'fix-main
|
||||
(lambda _
|
||||
;; main.cpp used to be adb_main.cpp in the current directory
|
||||
;; rather than in its own subdirectory, but it was not fixed.
|
||||
;; This leads to some header files not being found anymore.
|
||||
(copy-file "client/main.cpp" "adb_main.cpp")
|
||||
#t))
|
||||
(add-after 'install 'install-headers
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include"))
|
||||
#t)))))
|
||||
(add-after 'enter-source 'create-Makefile
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
;; No useful makefile is shipped, so we create one.
|
||||
(with-output-to-file "Makefile"
|
||||
(lambda _
|
||||
(display
|
||||
(string-append
|
||||
;; Common for all components.
|
||||
"CXXFLAGS += -std=gnu++14 -fpermissive\n"
|
||||
"CPPFLAGS += -I../include -I../base/include -I. -DADB_HOST=1 "
|
||||
"-DADB_REVISION='\"" ,version "\"' -fPIC\n"
|
||||
"LDFLAGS += -lcrypto -lpthread -lbase -lcutils -L. -ladb\n"
|
||||
|
||||
;; Libadb specifics.
|
||||
"LIBADB_SOURCES = adb.cpp adb_auth.cpp adb_io.cpp "
|
||||
"adb_listeners.cpp adb_trace.cpp adb_utils.cpp fdevent.cpp "
|
||||
"sockets.cpp transport.cpp transport_local.cpp transport_usb.cpp "
|
||||
"get_my_path_linux.cpp sysdeps_unix.cpp usb_linux.cpp "
|
||||
"adb_auth_host.cpp diagnose_usb.cpp services.cpp "
|
||||
"shell_service_protocol.cpp bugreport.cpp line_printer.cpp\n"
|
||||
|
||||
"LIBADB_LDFLAGS += -shared -Wl,-soname,libadb.so.0 "
|
||||
"-lcrypto -lpthread -lbase\n"
|
||||
|
||||
;; Adb specifics.
|
||||
"ADB_SOURCES = adb_main.cpp console.cpp commandline.cpp "
|
||||
"adb_client.cpp file_sync_client.cpp\n"
|
||||
"ADB_LDFLAGS += -Wl,-rpath=" (assoc-ref outputs "out") "/lib\n"
|
||||
|
||||
"build: libadb $(ADB_SOURCES)\n"
|
||||
" $(CXX) $(ADB_SOURCES) -o adb $(CXXFLAGS) $(CPPFLAGS) "
|
||||
"$(ADB_LDFLAGS) $(LDFLAGS)\n"
|
||||
|
||||
"libadb: $(LIBADB_SOURCES)\n"
|
||||
" $(CXX) $^ -o libadb.so.0 $(CXXFLAGS) $(CPPFLAGS) "
|
||||
"$(LIBADB_LDFLAGS)\n"
|
||||
" ln -sv libadb.so.0 libadb.so\n"))
|
||||
#t))))
|
||||
(delete 'configure)
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib"))
|
||||
(bin (string-append out "/bin")))
|
||||
(install-file "libadb.so.0" lib)
|
||||
(install-file "adb" bin)
|
||||
(with-directory-excursion lib
|
||||
(symlink "libadb.so.0" "libadb.so"))
|
||||
#t))))
|
||||
;; Test suite must be run with attached devices
|
||||
#:tests? #f))
|
||||
(inputs
|
||||
`(("android-libbase" ,android-libbase)
|
||||
("android-libcutils" ,android-libcutils)
|
||||
("android-liblog" ,android-liblog)
|
||||
`(("libbase" ,libbase)
|
||||
("libcutils" ,libcutils)
|
||||
("openssl" ,openssl)))
|
||||
(home-page "https://developer.android.com/studio/command-line/adb.html")
|
||||
(synopsis "Android Debug Bridge")
|
||||
@@ -369,329 +305,6 @@ of device actions, such as installing and debugging apps, and it provides access
|
||||
to a Unix shell that can run commands on the connected device or emulator.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public mkbootimg
|
||||
(package
|
||||
(name "mkbootimg")
|
||||
(version (android-platform-version))
|
||||
(source (origin
|
||||
(inherit (android-platform-system-core version))))
|
||||
(build-system python-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "mkbootimg") #t))
|
||||
(delete 'configure)
|
||||
(delete 'build)
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(bin (string-append out "/bin"))
|
||||
(include (string-append out "/include")))
|
||||
(install-file "mkbootimg" bin)
|
||||
(install-file "bootimg.h" include)
|
||||
#t))))))
|
||||
(home-page "https://developer.android.com/studio/command-line/adb.html")
|
||||
(synopsis "Tool to create Android boot images")
|
||||
(description "This package provides a tool to create Android Boot
|
||||
Images.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-safe-iop
|
||||
(package
|
||||
(name "android-safe-iop")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-external version "safe-iop"
|
||||
"1nyyrs463advjhlq8xx1lm37m4g5afv7gy0csxrj7biwwl0v13qw"))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:make-flags '("CXXFLAGS=-fpermissive -Wno-error")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-before 'build 'patch-host
|
||||
(lambda _
|
||||
;; TODO: Cross-compile.
|
||||
(substitute* "Android.mk"
|
||||
(("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY"))
|
||||
#t)))))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Safe integers in C")
|
||||
(description "@code{android-safe-iop} provides a set of functions for
|
||||
performing and checking safe integer operations. Ensure that integer
|
||||
operations do not result in silent overflow.")
|
||||
(license license:bsd-2)))
|
||||
|
||||
(define-public android-bionic-uapi
|
||||
(package
|
||||
(name "android-bionic-uapi")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-bionic version))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "libc") #t))
|
||||
(replace 'check
|
||||
(const #t))
|
||||
(replace 'build
|
||||
(const #t))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(out-sys (string-append out "/include/sys")))
|
||||
(mkdir-p out-sys)
|
||||
(install-file "include/sys/system_properties.h" out-sys)
|
||||
(install-file "include/sys/_system_properties.h" out-sys)
|
||||
(copy-recursively "kernel/uapi" (string-append out "/include"))
|
||||
#t))))))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android Linux API that is safe for user space")
|
||||
(description "@code{android-bionic-uapi} provides the part of the Linux API
|
||||
that is safe to use for user space. It also includes
|
||||
@code{system_properties.h} and @code{_system_properties.h}.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-libselinux
|
||||
(package
|
||||
(name "android-libselinux")
|
||||
(version (android-platform-version))
|
||||
(source
|
||||
(android-platform-external version "libselinux"
|
||||
"13m2q32gzdcs5d0zj1nwasjy1j8vsxsgbjg7m5sa9lfcjaj7nkm7"))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
;; See logd/Android.mk for the *_LOG_TAG values.
|
||||
`(#:make-flags (list (string-append "CFLAGS=-Wno-error "
|
||||
"-I core/include "
|
||||
"-I core/libpackagelistparser/include "
|
||||
"-DAUDITD_LOG_TAG=1003 "
|
||||
"-DLOGD_LOG_TAG=1004 -D_GNU_SOURCE")
|
||||
"LDFLAGS=-L . -lpcre")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack-core 'patch-HOST
|
||||
(lambda _
|
||||
;; gettid duplicates otherwise.
|
||||
(substitute* "src/procattr.c"
|
||||
(("#ifdef HOST") "#ifdef XXX"))
|
||||
#t)))))
|
||||
(inputs
|
||||
`(("openssl" ,openssl)))
|
||||
(native-inputs
|
||||
`(("android-bionic-uapi" ,android-bionic-uapi)
|
||||
;; pcre is inlined by our package.
|
||||
("pcre" ,pcre)))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis (package-synopsis libselinux))
|
||||
(description (package-description libselinux))
|
||||
(license (package-license libselinux))))
|
||||
|
||||
(define-public android-ext4-utils
|
||||
(package
|
||||
(name "android-ext4-utils")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-extras version))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:make-flags
|
||||
(list (string-append "CPPFLAGS="
|
||||
;"-Wno-error "
|
||||
"-I "
|
||||
(assoc-ref %build-inputs "android-libselinux")
|
||||
"/include "
|
||||
"-I " (assoc-ref %build-inputs "android-libsparse")
|
||||
"/include "
|
||||
"-I " (assoc-ref %build-inputs "android-libcutils")
|
||||
"/include "
|
||||
"-I " (assoc-ref %build-inputs "android-liblog") "/include "
|
||||
"-I ../core/include")
|
||||
"CFLAGS=-Wno-error"
|
||||
"install-libext4_utils_host.a"
|
||||
(string-append "prefix=" (assoc-ref %outputs "out")))
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'unpack-core
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(mkdir-p "core")
|
||||
(with-directory-excursion "core"
|
||||
(invoke "tar" "axf" (assoc-ref inputs "android-core")
|
||||
"--strip-components=1"))
|
||||
#t))
|
||||
(add-after 'unpack-core 'enter-source
|
||||
(lambda _ (chdir "ext4_utils") #t))
|
||||
(replace 'install
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(copy-recursively "." (string-append out "/include")))
|
||||
#t)))))
|
||||
(inputs
|
||||
`(("android-libcutils" ,android-libcutils)
|
||||
("android-liblog" ,android-liblog)
|
||||
("android-libselinux" ,android-libselinux)
|
||||
("android-libsparse" ,android-libsparse)
|
||||
("zlib" ,zlib)))
|
||||
(native-inputs
|
||||
`(("android-core" ,(android-platform-system-core version))))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android ext4 filesystem utils")
|
||||
(description "@code{android-ext4-utils} is a library in common use by the
|
||||
Android core.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-f2fs-utils
|
||||
(package
|
||||
(name "android-f2fs-utils")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-extras version))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "f2fs_utils") #t))
|
||||
(add-after 'install 'install-headers
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(copy-recursively "." (string-append (assoc-ref outputs "out")
|
||||
"/include"))
|
||||
#t))
|
||||
(add-after 'install 'install-shell-scripts
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(bin (string-append out "/bin")))
|
||||
(patch-shebang "mkf2fsuserimg.sh")
|
||||
(substitute* "mkf2fsuserimg.sh"
|
||||
(("make_f2fs") (string-append bin "/make_f2fs")))
|
||||
(install-file "mkf2fsuserimg.sh" bin)
|
||||
#t))))))
|
||||
(inputs
|
||||
`(("f2fs-tools" ,f2fs-tools-1.7)
|
||||
("android-libselinux" ,android-libselinux)
|
||||
("android-libsparse" ,android-libsparse)
|
||||
("android-libcutils" ,android-libcutils)
|
||||
("zlib" ,zlib)))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android f2fs utils")
|
||||
(description "@code{android-f2fs-utils} is a library in common use by the
|
||||
Android core. It allows the user to create images for the @code{f2fs} Flash
|
||||
file system.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-libutils
|
||||
(package
|
||||
(name "android-libutils")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f ; TODO
|
||||
#:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _ (chdir "libutils") #t))
|
||||
|
||||
(add-after 'install 'install-headers
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(copy-recursively "../include/utils" (string-append (assoc-ref outputs "out") "/include/utils")))))))
|
||||
(inputs
|
||||
`(("android-safe-iop" ,android-safe-iop)
|
||||
("android-libcutils" ,android-libcutils)))
|
||||
(native-inputs
|
||||
`(("android-bionic-uapi" ,android-bionic-uapi)
|
||||
("android-liblog" ,android-liblog)))
|
||||
(home-page "https://developer.android.com/")
|
||||
(synopsis "Android utility library")
|
||||
(description "@code{android-libutils} provides utilities for Android NDK developers.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public fastboot
|
||||
(package
|
||||
(name "fastboot")
|
||||
(version (android-platform-version))
|
||||
(source (android-platform-system-core version))
|
||||
(build-system android-ndk-build-system)
|
||||
(arguments
|
||||
`(#:make-flags (list "CXXFLAGS=-std=gnu++11")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'enter-source
|
||||
(lambda _
|
||||
(chdir "fastboot")
|
||||
#t))
|
||||
(add-after 'enter-source 'patch-source
|
||||
(lambda _
|
||||
(substitute* "Android.mk"
|
||||
(("libext4_utils_host") "libext4_utils_host libselinux libpcre"))
|
||||
#t))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib"))
|
||||
(bin (string-append out "/bin")))
|
||||
(install-file "fastboot" bin)
|
||||
#t))))))
|
||||
(inputs
|
||||
`(("adb" ,adb)
|
||||
("android-safe-iop" ,android-safe-iop)
|
||||
("android-ext4-utils" ,android-ext4-utils)
|
||||
("android-f2fs-utils" ,android-f2fs-utils)
|
||||
("android-libbase" ,android-libbase)
|
||||
("android-libcutils" ,android-libcutils)
|
||||
("android-liblog" ,android-liblog)
|
||||
("android-libutils" ,android-libutils)
|
||||
("android-libsparse" ,android-libsparse)
|
||||
("android-libziparchive" ,android-libziparchive)
|
||||
("android-libselinux" ,android-libselinux)
|
||||
("pcre" ,pcre)
|
||||
("mkbootimg" ,mkbootimg)
|
||||
("zlib" ,zlib)))
|
||||
(native-inputs
|
||||
`(("xz" ,xz)))
|
||||
(home-page "https://developer.android.com/studio/command-line/")
|
||||
(synopsis "Android image flasher")
|
||||
(description
|
||||
"This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public android-udev-rules
|
||||
(package
|
||||
(name "android-udev-rules")
|
||||
(version "20180112")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/M0Rf30/android-udev-rules")
|
||||
(commit version)))
|
||||
(file-name (string-append name "-" version "-checkout"))
|
||||
(sha256
|
||||
(base32 "13gj79nnd04szqlrrzzkdr6wi1fky08pi7x8xfbg0jj3d3v0giah"))))
|
||||
(build-system trivial-build-system)
|
||||
(native-inputs `(("source" ,source)))
|
||||
(arguments
|
||||
'(#:modules ((guix build utils))
|
||||
#:builder
|
||||
(begin
|
||||
(use-modules (guix build utils))
|
||||
(let ((source (assoc-ref %build-inputs "source")))
|
||||
(install-file (string-append source "/51-android.rules")
|
||||
(string-append %output "/lib/udev/rules.d"))
|
||||
#t))))
|
||||
(home-page "https://github.com/M0Rf30/android-udev-rules")
|
||||
(synopsis "udev rules for Android devices")
|
||||
(description "Provides a set of udev rules to allow using Android devices
|
||||
with tools such as @command{adb} and @command{fastboot} without root
|
||||
privileges. This package is intended to be added as a rule to the
|
||||
@code{udev-service-type} in your @code{operating-system} configuration.
|
||||
Additionally, an @code{adbusers} group must be defined and your user added to
|
||||
it.
|
||||
|
||||
@emph{Simply installing this package will not have any effect.} It is meant
|
||||
to be passed to the @code{udev} service.")
|
||||
(license license:gpl3+)))
|
||||
|
||||
(define-public git-repo
|
||||
(package
|
||||
(name "git-repo")
|
||||
@@ -775,7 +388,7 @@ def _FindRepo():
|
||||
;; TODO: Add git-remote-persistent-https once it is available in guix
|
||||
`(("git" ,git)
|
||||
("gnupg" ,gnupg)
|
||||
("ssh" ,openssh)))
|
||||
("ssh", openssh)))
|
||||
(native-inputs
|
||||
`(("nose" ,python2-nose)))
|
||||
(home-page "https://code.google.com/p/git-repo/")
|
||||
@@ -786,135 +399,3 @@ parts of the development workflow. Repo is not meant to replace Git, only to
|
||||
make it easier to work with Git. The repo command is an executable Python
|
||||
script that you can put anywhere in your path.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public abootimg
|
||||
(package
|
||||
(name "abootimg")
|
||||
(version "0.6")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://http.debian.net/debian/pool/main/a/abootimg/"
|
||||
"abootimg_" version ".orig.tar.gz"))
|
||||
(sha256
|
||||
(base32 "0sfc2k011l1ymv97821w89391gnqdh8pp0haz4sdcm5hx0axv2ba"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'configure
|
||||
(lambda _
|
||||
(setenv "CC" "gcc")
|
||||
#t))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(bin (string-append out "/bin")))
|
||||
(install-file "abootimg" bin)
|
||||
#t))))))
|
||||
(inputs
|
||||
`(("libblkid" ,util-linux)))
|
||||
(home-page "https://ac100.grandou.net/abootimg")
|
||||
(synopsis "Tool for manipulating Android Boot Images")
|
||||
(description "This package provides a tool for manipulating old Android
|
||||
Boot Images. @code{abootimg} can work directly on block devices, or, the
|
||||
safest way, on a file image.")
|
||||
(license license:gpl2+)))
|
||||
|
||||
(define-public python-androguard
|
||||
(package
|
||||
(name "python-androguard")
|
||||
(version "3.2.1")
|
||||
(source
|
||||
(origin
|
||||
;; The pypi release doesn't have the tests, but the tests use
|
||||
;; packaged binaries, so we skip them.
|
||||
(method url-fetch)
|
||||
(uri (pypi-uri "androguard" version))
|
||||
(sha256
|
||||
(base32
|
||||
"0ndsw00pkyda4i2s3wi5ap8gbk6a9d23xhhxpdbk02padv8sxkfv"))))
|
||||
(build-system python-build-system)
|
||||
(arguments
|
||||
'(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'check
|
||||
;; Adapted from .travis.yml
|
||||
(lambda _
|
||||
(invoke "nosetests" "--with-coverage" "--with-timer"
|
||||
"--timer-top-n" "50"))))))
|
||||
(native-inputs
|
||||
`(("python-codecov" ,python-codecov)
|
||||
("python-coverage" ,python-coverage)
|
||||
("python-mock" ,python-mock)
|
||||
("python-nose" ,python-nose)
|
||||
("python-nose-timer" ,python-nose-timer)))
|
||||
(propagated-inputs
|
||||
`(("python-asn1crypto" ,python-asn1crypto)
|
||||
("python-colorama" ,python-colorama)
|
||||
("python-future" ,python-future)
|
||||
("python-ipython" ,python-ipython)
|
||||
("python-lxml" ,python-lxml)
|
||||
("python-matplotlib" ,python-matplotlib)
|
||||
("python-networkx" ,python-networkx)
|
||||
("python-pygments" ,python-pygments)
|
||||
("python-pyperclip" ,python-pyperclip)))
|
||||
(home-page "https://github.com/androguard/androguard")
|
||||
(synopsis "Python tool to play with Android files")
|
||||
(description
|
||||
"Androguard is a full Python tool to manipulate Android files. It is
|
||||
useful for reverse engineering, analysis of Android applications and more.")
|
||||
(license license:asl2.0)))
|
||||
|
||||
(define-public fdroidserver
|
||||
(package
|
||||
(name "fdroidserver")
|
||||
(version "1.0.10")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (pypi-uri "fdroidserver" version))
|
||||
(sha256
|
||||
(base32
|
||||
"0n6kkby65qzqdx1jn72grfffvr1w1j1rby5pwm9z8rymmsh8s0pm"))))
|
||||
(build-system python-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'fix-versioning
|
||||
(lambda _
|
||||
(substitute* "setup.py"
|
||||
(("0.2.1") ,(package-version python-pyasn1-modules)))
|
||||
#t)))))
|
||||
(propagated-inputs
|
||||
`(("python-androguard" ,python-androguard)
|
||||
("python-apache-libcloud" ,python-apache-libcloud)
|
||||
("python-clint" ,python-clint)
|
||||
("python-docker-py" ,python-docker-py)
|
||||
("python-gitpython" ,python-gitpython)
|
||||
("python-mwclient" ,python-mwclient)
|
||||
("python-paramiko" ,python-paramiko)
|
||||
("python-pillow" ,python-pillow)
|
||||
("python-pyasn1" ,python-pyasn1)
|
||||
("python-pyasn1-modules" ,python-pyasn1-modules)
|
||||
("python-pyyaml" ,python-pyyaml)
|
||||
("python-qrcode" ,python-qrcode)
|
||||
("python-ruamel.yaml" ,python-ruamel.yaml)
|
||||
("python-requests" ,python-requests)
|
||||
("python-vagrant" ,python-vagrant)))
|
||||
(native-inputs
|
||||
`(("python-babel" ,python-babel)
|
||||
("python-bcrypt" ,python-bcrypt)
|
||||
("python-docker-pycreds" ,python-docker-pycreds)
|
||||
("python-pynacl" ,python-pynacl)
|
||||
("python-websocket-client" ,python-websocket-client)))
|
||||
(home-page "https://f-droid.org")
|
||||
(synopsis "F-Droid server tools")
|
||||
(description
|
||||
"The F-Droid server tools provide various scripts and tools that are used
|
||||
to maintain F-Droid, the repository of free Android applications. You can use
|
||||
these same tools to create your own additional or alternative repository for
|
||||
publishing, or to assist in creating, testing and submitting metadata to the
|
||||
main repository.")
|
||||
(license license:agpl3+)))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -20,7 +19,6 @@
|
||||
(define-module (gnu packages animation)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (guix utils)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix build-system gnu)
|
||||
@@ -36,8 +34,6 @@
|
||||
#:use-module (gnu packages image)
|
||||
#:use-module (gnu packages imagemagick)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (gnu packages pulseaudio)
|
||||
#:use-module (gnu packages qt)
|
||||
#:use-module (gnu packages video))
|
||||
|
||||
(define-public etl
|
||||
@@ -53,7 +49,7 @@
|
||||
(base32
|
||||
"0ii73nsd3xzkhz6w1rnxwphl637j9w82xiy6apa9vin2isdynnmc"))))
|
||||
(build-system gnu-build-system)
|
||||
(home-page "https://www.synfig.org")
|
||||
(home-page "http://www.synfig.org")
|
||||
(synopsis "Extended C++ template library")
|
||||
(description
|
||||
"ETL is a class and template library designed to add new datatypes and
|
||||
@@ -82,16 +78,6 @@ C++ @dfn{Standard Template Library} (STL).")
|
||||
"/lib"))
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'fix-boost-build-error
|
||||
;; A chain of Boost headers leads to this error: "make_array" is
|
||||
;; not a member of "boost::serialization". This can be avoided by
|
||||
;; loading the "array_wrapper" header first.
|
||||
(lambda _
|
||||
(substitute* "src/synfig/valuenodes/valuenode_dynamic.cpp"
|
||||
(("#include <boost/numeric/odeint/integrate/integrate.hpp>" match)
|
||||
(string-append
|
||||
"#include <boost/serialization/array_wrapper.hpp>\n" match)))
|
||||
#t))
|
||||
(add-after 'unpack 'adapt-to-libxml++-changes
|
||||
(lambda _
|
||||
(substitute* "configure"
|
||||
@@ -131,7 +117,7 @@ C++ @dfn{Standard Template Library} (STL).")
|
||||
("pango" ,pango)))
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)))
|
||||
(home-page "https://www.synfig.org")
|
||||
(home-page "http://www.synfig.org")
|
||||
(synopsis "Vector-based 2D animation renderer")
|
||||
(description
|
||||
"Synfig is a vector-based 2D animation package. It is designed to be
|
||||
@@ -181,7 +167,7 @@ for tweening, preventing the need to hand-draw each frame.")
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)
|
||||
("intltool" ,intltool)))
|
||||
(home-page "https://www.synfig.org")
|
||||
(home-page "http://www.synfig.org")
|
||||
(synopsis "Vector-based 2D animation package (GUI)")
|
||||
(description
|
||||
"Synfig is a vector-based 2D animation package. It is designed to
|
||||
@@ -189,72 +175,3 @@ be capable of producing feature-film quality animation. It eliminates the
|
||||
need for tweening, preventing the need to hand-draw each frame. This package
|
||||
contains the graphical user interface for synfig.")
|
||||
(license license:gpl3+)))
|
||||
|
||||
(define-public papagayo
|
||||
(let ((commit "e143684b30e59fe4a554f965cb655d23cbe93ee7")
|
||||
(revision "1"))
|
||||
(package
|
||||
(name "papagayo")
|
||||
(version (string-append "2.0b1-" revision "." (string-take commit 9)))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/LostMoho/Papagayo.git")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1p9gffjhbph34jhrvgpg93yha75bf88vkvlnk06x1r9601ph5321"))
|
||||
(modules '((guix build utils)))
|
||||
;; Delete bundled libsndfile sources.
|
||||
(snippet
|
||||
'(begin
|
||||
(delete-file-recursively "libsndfile_1.0.19")
|
||||
(delete-file-recursively "libsndfile_1.0.25")
|
||||
#t))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'configure
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let ((libsndfile (assoc-ref inputs "libsndfile")))
|
||||
;; Do not use bundled libsndfile sources
|
||||
(substitute* "Papagayo.pro"
|
||||
(("else \\{")
|
||||
(string-append "\nINCLUDEPATH += " libsndfile
|
||||
"/include"
|
||||
"\nLIBS +=" libsndfile
|
||||
"/lib/libsndfile.so\n"
|
||||
"win32 {"))))
|
||||
(invoke "qmake"
|
||||
(string-append "DESTDIR="
|
||||
(assoc-ref outputs "out")
|
||||
"/bin"))))
|
||||
;; Ensure that all required Qt plugins are found at runtime.
|
||||
(add-after 'install 'wrap-executable
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(qt '("qt" "qtmultimedia")))
|
||||
(wrap-program (string-append out "/bin/Papagayo")
|
||||
`("QT_PLUGIN_PATH" ":" prefix
|
||||
,(map (lambda (label)
|
||||
(string-append (assoc-ref inputs label)
|
||||
"/lib/qt5/plugins/"))
|
||||
qt)))
|
||||
#t))))))
|
||||
(inputs
|
||||
`(("qt" ,qtbase)
|
||||
("qtmultimedia" ,qtmultimedia)
|
||||
("libsndfile" ,libsndfile)))
|
||||
(native-inputs
|
||||
`(("qttools" ,qttools)))
|
||||
(home-page "https://www.lostmarble.com/papagayo/")
|
||||
(synopsis "Lip-syncing for animations")
|
||||
(description
|
||||
"Papagayo is a lip-syncing program designed to help you line up
|
||||
phonemes with the actual recorded sound of actors speaking. Papagayo makes it
|
||||
easy to lip sync animated characters by making the process very simple – just
|
||||
type in the words being spoken, then drag the words on top of the sound’s
|
||||
waveform until they line up with the proper sounds.")
|
||||
(license license:gpl3+))))
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org>
|
||||
;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
|
||||
;;;
|
||||
;;; 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 antivirus)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages autotools)
|
||||
#:use-module (gnu packages bison)
|
||||
#:use-module (gnu packages check)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages curl)
|
||||
#:use-module (gnu packages cyrus-sasl)
|
||||
#:use-module (gnu packages flex)
|
||||
#:use-module (gnu packages llvm)
|
||||
#:use-module (gnu packages multiprecision)
|
||||
#:use-module (gnu packages ncurses)
|
||||
#:use-module (gnu packages pcre)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (gnu packages tls)
|
||||
#:use-module (gnu packages web)
|
||||
#:use-module (gnu packages xml))
|
||||
|
||||
(define-public clamav
|
||||
(package
|
||||
(name "clamav")
|
||||
(version "0.100.2")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://www.clamav.net/downloads/production/"
|
||||
"clamav-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1mkd41sxbjkfjinpx5b9kb85q529gj2s3d0klysssqhysh64ybja"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet
|
||||
'(begin
|
||||
(for-each delete-file-recursively
|
||||
'("win32" ;unnecessary
|
||||
"libclamav/c++/llvm" ;use system llvm
|
||||
"libclamunrar")))) ;non-free license
|
||||
(patches
|
||||
(search-patches "clamav-system-tomsfastmath.patch"
|
||||
"clamav-config-llvm-libs.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs
|
||||
`(("bison" ,bison)
|
||||
("check" ,check) ;for tests
|
||||
("flex" ,flex)
|
||||
("pkg-config" ,pkg-config)
|
||||
;; The tomsfastmath patch touches configure.ac and Makefile.am
|
||||
("autoconf" ,autoconf)
|
||||
("automake" ,automake)
|
||||
("libtool" ,libtool)))
|
||||
(inputs
|
||||
`(("bzip2" ,bzip2)
|
||||
("libcurl" ,curl)
|
||||
("libjson" ,json-c)
|
||||
("libltdl" ,libltdl)
|
||||
("libmspack" ,libmspack)
|
||||
("llvm" ,llvm-3.6) ;requires <3.7, for JIT/verifier
|
||||
("ncurses" ,ncurses)
|
||||
("openssl" ,libressl)
|
||||
("pcre" ,pcre "bin") ;for pcre-config
|
||||
("sasl" ,cyrus-sasl) ;for linking curl with libtool
|
||||
("tomsfastmath" ,tomsfastmath)
|
||||
("xml" ,libxml2)
|
||||
("zlib" ,zlib)))
|
||||
(arguments
|
||||
`(#:configure-flags
|
||||
(let-syntax ((with (syntax-rules ()
|
||||
((_ name)
|
||||
(string-append "--with-" name "="
|
||||
(assoc-ref %build-inputs name))))))
|
||||
(list "--disable-unrar"
|
||||
"--enable-llvm"
|
||||
"--with-system-llvm"
|
||||
"--with-system-libmspack"
|
||||
"--without-included-ltdl"
|
||||
(with "xml")
|
||||
(with "openssl")
|
||||
(with "libjson")
|
||||
(with "pcre")
|
||||
(with "zlib")
|
||||
(with "libcurl")
|
||||
;; For sanity, specifying --enable-* flags turns
|
||||
;; "support unavailable" warnings into errors.
|
||||
"--enable-bzip2"
|
||||
"--enable-check"
|
||||
"--sysconfdir=/etc/clamav"
|
||||
;; Default database directory needs to be writeable
|
||||
"--with-dbdir=/var/db/clamav"))
|
||||
;; install sample .conf files to %output/etc rather than /etc/clamav
|
||||
#:make-flags (list (string-append "sysconfdir=" %output "/etc"))
|
||||
#:phases (modify-phases %standard-phases
|
||||
(add-after 'unpack 'reconf
|
||||
(lambda _ (zero? (system* "autoreconf" "-vfi"))))
|
||||
(add-before 'configure 'patch-llvm-config
|
||||
(lambda _
|
||||
(substitute* '("libclamav/c++/detect.cpp"
|
||||
"libclamav/c++/ClamBCRTChecks.cpp"
|
||||
"libclamav/c++/bytecode2llvm.cpp")
|
||||
(("llvm/Config/config.h") "llvm/Config/llvm-config.h"))
|
||||
;; `llvm-config --libfiles` inappropriately lists lib*.a
|
||||
;; libraries, rather than the lib*.so's that our llvm
|
||||
;; contains. They're used only for listing extra build
|
||||
;; dependencies, so ignore them until that's fixed.
|
||||
(substitute* "libclamav/c++/Makefile.in"
|
||||
(("@LLVMCONFIG_LIBFILES@") ""))
|
||||
#t))
|
||||
(add-before 'check 'skip-clamd-tests
|
||||
;; XXX: The check?_clamd tests fail inside the build
|
||||
;; chroot, but pass outside.
|
||||
(lambda _
|
||||
(substitute* "unit_tests/Makefile"
|
||||
(("check2_clamd.sh.*check4_clamd.sh") ""))
|
||||
#t)))))
|
||||
(home-page "https://www.clamav.net")
|
||||
(synopsis "Antivirus engine")
|
||||
(description
|
||||
"Clam AntiVirus is an anti-virus toolkit, designed especially for e-mail
|
||||
scanning on mail gateways. It provides a number of utilities including a
|
||||
flexible and scalable multi-threaded daemon, a command line scanner, and
|
||||
advanced tool for automatic database updates. The core of the package is an
|
||||
anti-virus engine available in the form of a shared library.")
|
||||
(license (list license:gpl2+ ;ClamAV itself
|
||||
license:lgpl2.1 ;libclamav/mspack.[ch]
|
||||
license:public-domain ;libclamav/7z/*, libclamav/rijndael.[ch], etc...
|
||||
(package-license bzip2) ;modified bzip2 source in libclamav/nsis
|
||||
license:bsd-2 ;several files in libclamav
|
||||
license:bsd-3 ;libclamav/{regex,qsort.c,swf.[ch]
|
||||
license:ncsa ;libclamav/c++/PointerTracking.cpp
|
||||
license:zlib ;libclamav/inf*.h
|
||||
license:x11 ;libclamav/lzw
|
||||
(license:non-copyleft "libclamav/strlcat.c") ;"OpenBSD" license
|
||||
license:asl2.0 ;libclamav/yara*
|
||||
license:expat)))) ;shared/getopt.[ch]
|
||||
+18
-16
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
|
||||
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -30,14 +30,14 @@
|
||||
(define-public apr
|
||||
(package
|
||||
(name "apr")
|
||||
(version "1.6.3")
|
||||
(version "1.5.2")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "mirror://apache/apr/apr-"
|
||||
version ".tar.bz2"))
|
||||
(sha256
|
||||
(base32
|
||||
"0wiik6amxn6lkc55fv9yz5i3kbxnqbp36alrzabx1avsdp8hc7qk"))
|
||||
"0ypn51xblix5ys9xy7da3ngdydip0qqh9rdq8nz54w9aq8lys0vx"))
|
||||
(patches
|
||||
(search-patches "apr-skip-getservbyname-test.patch"))
|
||||
(patch-flags '("-p0"))))
|
||||
@@ -65,14 +65,14 @@ around or take advantage of platform-specific deficiencies or features.")
|
||||
(define-public apr-util
|
||||
(package
|
||||
(name "apr-util")
|
||||
(version "1.6.1")
|
||||
(version "1.5.4")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "mirror://apache/apr/apr-util-"
|
||||
version ".tar.bz2"))
|
||||
(sha256
|
||||
(base32
|
||||
"0nq3s1yn13vplgl6qfm09f7n0wm08malff9s59bqf9nid9xjzqfk"))))
|
||||
"0bn81pfscy9yjvbmyx442svf43s6dhrdfcsnkpxz43fai5qk5kx6"))))
|
||||
(build-system gnu-build-system)
|
||||
(inputs
|
||||
`(("apr" ,apr)))
|
||||
@@ -80,17 +80,19 @@ around or take advantage of platform-specific deficiencies or features.")
|
||||
`(("expat" ,expat)))
|
||||
(arguments
|
||||
'(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'configure
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out"))
|
||||
(apr (assoc-ref inputs "apr"))
|
||||
(expat (assoc-ref inputs "expat")))
|
||||
(setenv "CONFIG_SHELL" (which "bash"))
|
||||
(invoke "./configure"
|
||||
(string-append "--prefix=" out)
|
||||
(string-append "--with-apr=" apr)
|
||||
(string-append "--with-expat=" expat))))))
|
||||
(alist-replace
|
||||
'configure
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out"))
|
||||
(apr (assoc-ref inputs "apr"))
|
||||
(expat (assoc-ref inputs "expat")))
|
||||
(setenv "CONFIG_SHELL" (which "bash"))
|
||||
(zero?
|
||||
(system* "./configure"
|
||||
(string-append "--prefix=" out)
|
||||
(string-append "--with-apr=" apr)
|
||||
(string-append "--with-expat=" expat)))))
|
||||
%standard-phases)
|
||||
|
||||
;; There are race conditions during 'make check'. Typically, the
|
||||
;; 'testall' executable is not built yet by the time 'make check' tries
|
||||
|
||||
+37
-174
@@ -1,11 +1,10 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
|
||||
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
|
||||
;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2016 Christopher Andersson <christopher@8bits.nu>
|
||||
;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org>
|
||||
;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -27,11 +26,9 @@
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix licenses)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages base)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages perl))
|
||||
#:use-module (gnu packages perl)
|
||||
#:use-module (gnu packages base))
|
||||
|
||||
(define-public aspell
|
||||
(package
|
||||
@@ -50,27 +47,13 @@
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-before 'build 'set-filter-path
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
;; Change the default value of 'filter-path' so that filters such
|
||||
;; as 'tex-filter.so' can be found. By default none of the
|
||||
;; filters would be found.
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(libdir (string-append out "/lib/aspell-"
|
||||
,(version-major+minor version))))
|
||||
(substitute* "common/config.cpp"
|
||||
(("\"filter-path(.*)DICT_DIR" _ middle)
|
||||
(string-append "\"filter-path" middle
|
||||
"\"" libdir "\"")))
|
||||
#t)))
|
||||
(add-after 'install 'wrap-aspell
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let ((bin/aspell (string-append (assoc-ref outputs "out")
|
||||
"/bin/aspell")))
|
||||
(wrap-program bin/aspell
|
||||
'("ASPELL_CONF" "" =
|
||||
("${ASPELL_CONF:-\"dict-dir ${GUIX_PROFILE:-$HOME/.guix-profile}/lib/aspell\"}")))
|
||||
#t))))))
|
||||
("${ASPELL_CONF:-\"dict-dir ${GUIX_PROFILE:-$HOME/.guix-profile}/lib/aspell\"}")))))))))
|
||||
(inputs `(("perl" ,perl)))
|
||||
|
||||
(native-search-paths
|
||||
@@ -116,7 +99,7 @@ dictionaries, including personal ones.")
|
||||
(replace 'configure
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(invoke "./configure")))))
|
||||
(zero? (system* "./configure"))))))
|
||||
#:make-flags
|
||||
(let ((out (assoc-ref %outputs "out")))
|
||||
(list (string-append "dictdir=" out "/lib/aspell")
|
||||
@@ -131,13 +114,6 @@ dictionaries, including personal ones.")
|
||||
(home-page "http://aspell.net/")))
|
||||
|
||||
|
||||
(define-public aspell-dict-ca
|
||||
(aspell-dictionary "ca" "Catalan"
|
||||
#:version "2.1.5-1"
|
||||
#:sha256
|
||||
(base32
|
||||
"1fb5y5kgvk25nlsfvc8cai978hg66x3pbp9py56pldc7vxzf9npb")))
|
||||
|
||||
(define-public aspell-dict-de
|
||||
(aspell-dictionary "de" "German"
|
||||
#:version "20030222-1"
|
||||
@@ -145,20 +121,12 @@ dictionaries, including personal ones.")
|
||||
(base32
|
||||
"01p92qj66cqb346gk7hjfynaap5sbcn85xz07kjfdq623ghr8v5s")))
|
||||
|
||||
(define-public aspell-dict-el
|
||||
(aspell-dictionary "el" "Greek"
|
||||
#:version "0.08-0"
|
||||
#:prefix "aspell6-"
|
||||
#:sha256
|
||||
(base32
|
||||
"1ljcc30zg2v2h3w5h5jr5im41mw8jbsgvvhdd2cii2yzi8d0zxja")))
|
||||
|
||||
(define-public aspell-dict-en
|
||||
(aspell-dictionary "en" "English"
|
||||
#:version "2018.04.16-0"
|
||||
#:version "2016.11.20-0"
|
||||
#:sha256
|
||||
(base32
|
||||
"0bxxdzkk9g27plg22y9qzsx9cfjw3aa29w5bmzs561qc9gkp247i")))
|
||||
"1496jnhh2jvhkzcj0p4vy89bcs4g5wz6a76m33vw4dhchn5xm9jw")))
|
||||
|
||||
(define-public aspell-dict-eo
|
||||
(aspell-dictionary "eo" "Esperanto"
|
||||
@@ -182,19 +150,12 @@ dictionaries, including personal ones.")
|
||||
(base32
|
||||
"14ffy9mn5jqqpp437kannc3559bfdrpk7r36ljkzjalxa53i0hpr")))
|
||||
|
||||
(define-public aspell-dict-grc
|
||||
(aspell-dictionary "grc" "Ancient Greek"
|
||||
#:version "0.02-0"
|
||||
(define-public aspell-dict-ru
|
||||
(aspell-dictionary "ru" "Russian"
|
||||
#:version "0.99f7-1"
|
||||
#:sha256
|
||||
(base32
|
||||
"1zxr8958v37v260fkqd4pg37ns5h5kyqm54hn1hg70wq5cz8h512")))
|
||||
|
||||
(define-public aspell-dict-he
|
||||
(aspell-dictionary "he" "Hebrew"
|
||||
#:version "1.0-0"
|
||||
#:sha256
|
||||
(base32
|
||||
"13bhbghx5b8g0119g3wxd4n8mlf707y41vlf59irxjj0kynankfn")))
|
||||
"0ip6nq43hcr7vvzbv4lwwmlwgfa60hrhsldh9xy3zg2prv6bcaaw")))
|
||||
|
||||
(define-public aspell-dict-it
|
||||
(aspell-dictionary "it" "Italian"
|
||||
@@ -211,20 +172,12 @@ dictionaries, including personal ones.")
|
||||
(base32
|
||||
"0ffb87yjsh211hllpc4b9khqqrblial4pzi1h9r3v465z1yhn3j4")))
|
||||
|
||||
(define-public aspell-dict-pt-br
|
||||
(aspell-dictionary "pt-br" "Brazilian Portuguese"
|
||||
#:version "20090702-0"
|
||||
#:prefix "aspell6-"
|
||||
(define-public aspell-dict-he
|
||||
(aspell-dictionary "he" "Hebrew"
|
||||
#:version "1.0-0"
|
||||
#:sha256
|
||||
(base32
|
||||
"1y09lx9zf2rnp55r16b2vgj953l3538z1vaqgflg9mdvm555bz3p")))
|
||||
|
||||
(define-public aspell-dict-ru
|
||||
(aspell-dictionary "ru" "Russian"
|
||||
#:version "0.99f7-1"
|
||||
#:sha256
|
||||
(base32
|
||||
"0ip6nq43hcr7vvzbv4lwwmlwgfa60hrhsldh9xy3zg2prv6bcaaw")))
|
||||
"13bhbghx5b8g0119g3wxd4n8mlf707y41vlf59irxjj0kynankfn")))
|
||||
|
||||
(define-public aspell-dict-sv
|
||||
(aspell-dictionary "sv" "Swedish"
|
||||
@@ -234,115 +187,25 @@ dictionaries, including personal ones.")
|
||||
(base32
|
||||
"02jwkjhr32kvyibnyzgx3smbnm576jwdzg3avdf6zxwckhy5fw4v")))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Hunspell packages made from the Aspell word lists.
|
||||
;;;
|
||||
(define-public aspell-dict-el
|
||||
(aspell-dictionary "el" "Greek"
|
||||
#:version "0.08-0"
|
||||
#:prefix "aspell6-"
|
||||
#:sha256
|
||||
(base32
|
||||
"1ljcc30zg2v2h3w5h5jr5im41mw8jbsgvvhdd2cii2yzi8d0zxja")))
|
||||
|
||||
(define* (aspell-word-list language synopsis
|
||||
#:optional
|
||||
(nick (string-map (lambda (chr)
|
||||
(if (char=? #\_ chr)
|
||||
#\-
|
||||
chr))
|
||||
(string-downcase language))))
|
||||
(package
|
||||
(name (string-append "hunspell-dict-" nick))
|
||||
(version "2017.08.24")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"http://downloads.sourceforge.net/wordlist/scowl-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1kdhydzg5z5x20ad2j1x5hbdhvy08ljkfdi2v3gbyvghbagxm15s"))))
|
||||
(native-inputs
|
||||
`(("tar" ,tar)
|
||||
("gzip" ,gzip)
|
||||
("perl" ,perl)
|
||||
("aspell" ,aspell)))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(delete 'configure)
|
||||
(delete 'check)
|
||||
(replace 'build
|
||||
(lambda _
|
||||
(substitute* "speller/make-hunspell-dict"
|
||||
(("zip -9 .*$")
|
||||
"return\n"))
|
||||
(mkdir "speller/hunspell")
|
||||
(define-public aspell-dict-grc
|
||||
(aspell-dictionary "grc" "Ancient Greek"
|
||||
#:version "0.02-0"
|
||||
#:sha256
|
||||
(base32
|
||||
"1zxr8958v37v260fkqd4pg37ns5h5kyqm54hn1hg70wq5cz8h512")))
|
||||
|
||||
;; XXX: This actually builds all the dictionary variants.
|
||||
(zero? (system* "make" "-C" "speller" "hunspell"))))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref %outputs "out"))
|
||||
(hunspell (string-append out "/share/hunspell"))
|
||||
(myspell (string-append out "/share/myspell"))
|
||||
(doc (string-append out "/share/doc/"
|
||||
,name))
|
||||
(dot-dic ,(string-append "speller/" language ".dic")))
|
||||
(mkdir-p myspell)
|
||||
|
||||
;; Usually there's only a 'LANGUAGE.dic' file, but for the "en"
|
||||
;; dictionary, there no 'en.dic'. Instead, there's a set of
|
||||
;; 'en*.dic' files, hence the 'find-files' call below.
|
||||
(if (file-exists? dot-dic)
|
||||
(install-file dot-dic hunspell)
|
||||
(for-each (lambda (dic)
|
||||
(install-file dic hunspell))
|
||||
(find-files "speller"
|
||||
,(string-append language ".*\\.dic$"))))
|
||||
|
||||
(install-file ,(string-append "speller/" language ".aff")
|
||||
hunspell)
|
||||
(symlink hunspell (string-append myspell "/dicts"))
|
||||
(for-each (lambda (file)
|
||||
(install-file file doc))
|
||||
(find-files "."
|
||||
"^(Copyright|.*\\.(txt|org|md))$"))
|
||||
#t))))))
|
||||
(synopsis synopsis)
|
||||
(description
|
||||
"This package provides a dictionary for the Hunspell spell-checking
|
||||
library.")
|
||||
(home-page "http://wordlist.aspell.net/")
|
||||
(license (non-copyleft "file://Copyright"
|
||||
"Word lists come from several sources, all
|
||||
under permissive licensing terms. See the 'Copyright' file."))))
|
||||
|
||||
(define-syntax define-word-list-dictionary
|
||||
(syntax-rules (synopsis)
|
||||
((_ name language (synopsis text))
|
||||
(define-public name
|
||||
(aspell-word-list language text)))
|
||||
((_ name language nick (synopsis text))
|
||||
(define-public name
|
||||
(aspell-word-list language text nick)))))
|
||||
|
||||
(define-word-list-dictionary hunspell-dict-en
|
||||
"en"
|
||||
(synopsis "Hunspell dictionary for English"))
|
||||
|
||||
(define-word-list-dictionary hunspell-dict-en-au
|
||||
"en_AU"
|
||||
(synopsis "Hunspell dictionary for Australian English"))
|
||||
|
||||
(define-word-list-dictionary hunspell-dict-en-ca
|
||||
"en_CA"
|
||||
(synopsis "Hunspell dictionary for Canadian English"))
|
||||
|
||||
(define-word-list-dictionary hunspell-dict-en-gb
|
||||
"en_GB-ise" "en-gb"
|
||||
(synopsis "Hunspell dictionary for British English, with -ise endings"))
|
||||
|
||||
(define-word-list-dictionary hunspell-dict-en-gb-ize
|
||||
"en_GB-ize"
|
||||
(synopsis "Hunspell dictionary for British English, with -ize endings"))
|
||||
|
||||
(define-word-list-dictionary hunspell-dict-en-us
|
||||
"en_US"
|
||||
(synopsis "Hunspell dictionary for United States English"))
|
||||
(define-public aspell-dict-pt-br
|
||||
(aspell-dictionary "pt-br" "Brazilian Portuguese"
|
||||
#:version "20090702-0"
|
||||
#:prefix "aspell6-"
|
||||
#:sha256
|
||||
(base32
|
||||
"1y09lx9zf2rnp55r16b2vgj953l3538z1vaqgflg9mdvm555bz3p")))
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
|
||||
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -35,14 +34,14 @@
|
||||
(define-public nasm
|
||||
(package
|
||||
(name "nasm")
|
||||
(version "2.13.03")
|
||||
(version "2.13.01")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
|
||||
version "/" name "-" version ".tar.xz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0wr58pb2wnyihcl6635hlx98fnscx5yirxm8m84x8nxwvjqcybl1"))))
|
||||
"0plsvcwxc7q3llr3bz10prwq1gn4ll38aqmv0yzfqcq4iw0160ma"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs `(("perl" ,perl) ;for doc and test target
|
||||
("texinfo" ,texinfo)))
|
||||
@@ -60,7 +59,7 @@
|
||||
#t))
|
||||
(add-after 'install 'install-info
|
||||
(lambda _
|
||||
(invoke "make" "install_doc"))))))
|
||||
(zero? (system* "make" "install_doc")))))))
|
||||
(home-page "http://www.nasm.us/")
|
||||
(synopsis "80x86 and x86-64 assembler")
|
||||
(description
|
||||
@@ -104,14 +103,14 @@ debugging information in STABS, DWARF 2, and CodeView 8 formats.")
|
||||
(define-public lightning
|
||||
(package
|
||||
(name "lightning")
|
||||
(version "2.1.2")
|
||||
(version "2.1.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "mirror://gnu/lightning/lightning-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0sbs2lm8b9in2m8d52zf0x9gpp40x6r7sl6sha92yq3pr78rwa4v"))))
|
||||
"19j9nwl88k660045s40cbz5zrl1wpd2mcxnnc8qqnnaj311a58qz"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs `(("zlib" ,zlib)))
|
||||
(synopsis "Library for generating assembly code at runtime")
|
||||
|
||||
+45
-52
@@ -1,6 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -21,7 +20,6 @@
|
||||
#:use-module (guix packages)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (gnu packages image)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages gettext)
|
||||
@@ -35,18 +33,16 @@
|
||||
(define-public cfitsio
|
||||
(package
|
||||
(name "cfitsio")
|
||||
(version "3.450")
|
||||
(version "3390")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/"
|
||||
name (string-replace-substring version "." "") ".tar.gz"))
|
||||
"http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/" name version
|
||||
".tar.gz"))
|
||||
(sha256
|
||||
(base32 "0bmrkw6w65zb0k3mszaaqy1f4zjm2hl7njww74nb5v38wvdi4q5z"))))
|
||||
(base32 "02gllydm63irwbqqisa3mrskw1fphm5rlplglz3mq9whi3rxilv2"))))
|
||||
(build-system gnu-build-system)
|
||||
;; XXX Building with curl currently breaks wcslib. It doesn't use
|
||||
;; pkg-config and hence won't link with -lcurl.
|
||||
(arguments
|
||||
`(#:tests? #f ; no tests
|
||||
#:phases
|
||||
@@ -55,10 +51,10 @@
|
||||
(lambda _
|
||||
(substitute* "Makefile.in" (("/bin/") ""))
|
||||
#t)))))
|
||||
(home-page "https://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
|
||||
(home-page "http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html")
|
||||
(synopsis "Library for reading and writing FITS files")
|
||||
(description "CFITSIO provides simple high-level routines for reading and
|
||||
writing @dfn{FITS} (Flexible Image Transport System) files that insulate the
|
||||
writing FITS (Flexible Image Transport System) files that insulate the
|
||||
programmer from the internal complexities of the FITS format. CFITSIO also
|
||||
provides many advanced features for manipulating and filtering the information
|
||||
in FITS files.")
|
||||
@@ -68,7 +64,7 @@ in FITS files.")
|
||||
(define-public wcslib
|
||||
(package
|
||||
(name "wcslib")
|
||||
(version "5.20")
|
||||
(version "5.16")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
@@ -76,33 +72,28 @@ in FITS files.")
|
||||
"ftp://ftp.atnf.csiro.au/pub/software/wcslib/" name "-" version
|
||||
".tar.bz2"))
|
||||
(sha256
|
||||
(base32 "1c8g9kv4dxrnawnqi4spi2p10s2xs7x75pdfxhbqxgcc97dkgh0b"))))
|
||||
(base32 "1vwrzkznpig2q40m11j12hsfqvsjz8z44l66pz5fkh6fy461w0zd"))))
|
||||
(inputs
|
||||
`(("cfitsio" ,cfitsio)))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-before 'configure 'patch-/bin/sh
|
||||
(lambda _
|
||||
(substitute* "makedefs.in"
|
||||
(("/bin/sh") "sh"))
|
||||
#t))
|
||||
(delete 'install-license-files)) ; installed by ‘make install’
|
||||
;; Parallel execution of the test suite is not supported.
|
||||
#:parallel-tests? #f))
|
||||
(home-page "https://www.atnf.csiro.au/people/mcalabre/WCS")
|
||||
`(#:phases (modify-phases %standard-phases
|
||||
(add-before 'configure 'patch-/bin/sh
|
||||
(lambda _
|
||||
(substitute* "makedefs.in"
|
||||
(("/bin/sh") "sh"))
|
||||
#t)))))
|
||||
(home-page "http://www.atnf.csiro.au/people/mcalabre/WCS")
|
||||
(synopsis "Library which implements the FITS WCS standard")
|
||||
(description "The FITS \"World Coordinate System\" (@dfn{WCS}) standard
|
||||
defines keywords and usage that provide for the description of astronomical
|
||||
coordinate systems in a @dfn{FITS} (Flexible Image Transport System) image
|
||||
header.")
|
||||
(description "The FITS \"World Coordinate System\" (WCS) standard defines
|
||||
keywords and usage that provide for the description of astronomical coordinate
|
||||
systems in a FITS image header.")
|
||||
(license license:lgpl3+)))
|
||||
|
||||
(define-public gnuastro
|
||||
(package
|
||||
(name "gnuastro")
|
||||
(version "0.7")
|
||||
(version "0.3")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
@@ -110,15 +101,17 @@ header.")
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1h4hpj5dd1nz8hx0dkf43as0hl1grcaijg0k3zcd5djg7wgna46y"))))
|
||||
"109xjwbs36gbkx5sd5yzf6ailfcldc5d28vl1n19z0ylfzww4nwa"))))
|
||||
(inputs
|
||||
`(("cfitsio" ,cfitsio)
|
||||
("gsl" ,gsl)
|
||||
("libjpeg" ,libjpeg)
|
||||
("libtiff" ,libtiff)
|
||||
("wcslib" ,wcslib)
|
||||
("zlib" ,zlib)))
|
||||
("libjpeg" ,libjpeg-8)
|
||||
("wcslib" ,wcslib)))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
;; Reduce the number of required type conversions by enabling arithmetic
|
||||
;; with all the supported types.
|
||||
`(#:configure-flags '("--enable-bin-op-alltypes")))
|
||||
(home-page "https://www.gnu.org/software/gnuastro/")
|
||||
(synopsis "Astronomy utilities")
|
||||
(description "The GNU Astronomy Utilities (Gnuastro) is a suite of
|
||||
@@ -128,15 +121,15 @@ programs for the manipulation and analysis of astronomical data.")
|
||||
(define-public stellarium
|
||||
(package
|
||||
(name "stellarium")
|
||||
(version "0.18.1")
|
||||
(version "0.16.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://github.com/Stellarium/" name
|
||||
"/releases/download/v" version
|
||||
"/" name "-" version ".tar.gz"))
|
||||
(uri (string-append "mirror://sourceforge/stellarium/"
|
||||
"Stellarium-sources/"
|
||||
version "/stellarium-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0vjkwrjy22b4wdjkafm63pmb0fck14ffnylpq8xr91ywycw4blrq"))))
|
||||
"1krxj51lix096xbz64lys166a8zdwhill5vvs7dlxdn14amc8d98"))))
|
||||
(build-system cmake-build-system)
|
||||
(inputs
|
||||
`(("qtbase" ,qtbase)
|
||||
@@ -151,20 +144,20 @@ programs for the manipulation and analysis of astronomical data.")
|
||||
("qtbase" ,qtbase) ; Qt MOC is needed at compile time
|
||||
("qttools" ,qttools)))
|
||||
(arguments
|
||||
`(#:test-target "test"
|
||||
#:configure-flags (list "-DENABLE_TESTING=1"
|
||||
(string-append
|
||||
"-DCMAKE_CXX_FLAGS=-isystem "
|
||||
(assoc-ref %build-inputs "qtserialport")
|
||||
"/include/qt5"))
|
||||
#:phases (modify-phases %standard-phases
|
||||
(add-before 'check 'set-offscreen-display
|
||||
(lambda _
|
||||
;; make Qt render "offscreen", required for tests
|
||||
(setenv "QT_QPA_PLATFORM" "offscreen")
|
||||
(setenv "HOME" "/tmp")
|
||||
#t)))))
|
||||
(home-page "https://stellarium.org/")
|
||||
`(#:test-target "tests"
|
||||
#:phases (modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-tests
|
||||
(lambda _
|
||||
(substitute* "src/tests/testStelSphereGeometry.cpp"
|
||||
(("Vec3d v[(]0[)]") "Vec3d v(0.0)"))
|
||||
#t))
|
||||
(add-before 'check 'set-offscreen-display
|
||||
(lambda _
|
||||
;; make Qt render "offscreen", required for tests
|
||||
(setenv "QT_QPA_PLATFORM" "offscreen")
|
||||
(setenv "HOME" "/tmp")
|
||||
#t)))))
|
||||
(home-page "http://www.stellarium.org/")
|
||||
(synopsis "3D sky viewer")
|
||||
(description "Stellarium is a planetarium. It shows a realistic sky in
|
||||
3D, just like what you see with the naked eye, binoculars, or a telescope. It
|
||||
|
||||
+9
-14
@@ -1,7 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
|
||||
;;; Copyright © 2012, 2013, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -43,14 +42,13 @@
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'configure 'patch-makefile-SHELL
|
||||
(lambda _
|
||||
(patch-makefile-SHELL "include/buildmacros")
|
||||
#t))
|
||||
(patch-makefile-SHELL "include/buildmacros")))
|
||||
(replace 'install
|
||||
(lambda _
|
||||
(invoke "make"
|
||||
"install"
|
||||
"install-lib"
|
||||
"install-dev")))
|
||||
(zero? (system* "make"
|
||||
"install"
|
||||
"install-lib"
|
||||
"install-dev"))))
|
||||
(replace 'check
|
||||
(lambda* (#:key target #:allow-other-keys)
|
||||
;; Use the right shell.
|
||||
@@ -59,14 +57,11 @@
|
||||
(which "sh")))
|
||||
|
||||
;; When building natively, run the tests.
|
||||
;;
|
||||
;; Note that we use system* and unconditionally return #t here
|
||||
;; to ignore the test result, because the tests will fail when
|
||||
;; the build is performed on a file system without support for
|
||||
;; extended attributes, and we wish to allow Guix to be built
|
||||
;; on such systems.
|
||||
(unless target
|
||||
(system* "make" "tests" "-C" "test"))
|
||||
|
||||
;; XXX: Ignore the test result since this is
|
||||
;; dependent on the underlying file system.
|
||||
#t)))))
|
||||
(inputs
|
||||
;; Perl is needed to run tests; remove it from cross builds.
|
||||
@@ -76,7 +71,7 @@
|
||||
(native-inputs
|
||||
`(("gettext" ,gettext-minimal)))
|
||||
|
||||
(home-page "https://savannah.nongnu.org/projects/attr/")
|
||||
(home-page "http://savannah.nongnu.org/projects/attr/")
|
||||
(synopsis "Library and tools for manipulating extended attributes")
|
||||
(description
|
||||
"Portable library and tools for manipulating extended attributes.")
|
||||
|
||||
+390
-1158
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
|
||||
;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -32,14 +30,14 @@
|
||||
(define-public augeas
|
||||
(package
|
||||
(name "augeas")
|
||||
(version "1.11.0")
|
||||
(version "1.8.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://download.augeas.net/augeas-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1c507qj6dfn2dnsl27w94zs9r45xrgm07y8bqba9ry2s0psfhg1r"))))
|
||||
"1iac5lwi1q10r343ii9v5p2fdplvh06yv9svsi8zz6cd2c2fjp2i"))))
|
||||
(build-system gnu-build-system)
|
||||
;; Marked as "required" in augeas.pc
|
||||
(propagated-inputs
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;;
|
||||
;;; 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 authentication)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix download)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages))
|
||||
|
||||
(define-public oath-toolkit
|
||||
;; If gcc@7 breaks this package before its next release, try patching it:
|
||||
;; <https://gitlab.com/oath-toolkit/oath-toolkit/issues/2#note_52958748>.
|
||||
(package
|
||||
(name "oath-toolkit")
|
||||
(version "2.6.2")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://download.savannah.nongnu.org/releases/"
|
||||
name "/" name "-" version ".tar.gz"))
|
||||
(patches (search-patches "oath-toolkit-glibc-compat.patch"))
|
||||
(sha256
|
||||
(base32 "182ah8vfbg0yhv6mh1b6ap944d0na6x7lpfkwkmzb6jl9gx4cd5h"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
;; TODO ‘--enable-pskc’ causes xmlsec-related test suite failures.
|
||||
`(#:configure-flags
|
||||
(list "--enable-pam")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'install 'delete-static-libraries
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib (string-append out "/lib")))
|
||||
(for-each delete-file (find-files lib "\\.a$"))
|
||||
#t))))))
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)))
|
||||
(inputs
|
||||
`(("linux-pam" ,linux-pam))) ; for --enable-pam
|
||||
(home-page "https://www.nongnu.org/oath-toolkit/")
|
||||
(synopsis "One-time password (OTP) components")
|
||||
;; TODO Add the following items after they've been enabled.
|
||||
;; @item @command{pskctool}, a command-line tool for manipulating secret key
|
||||
;; files in the Portable Symmetric Key Container (@dfn{PSKC}) format
|
||||
;; described in RFC6030.
|
||||
;; @item @code{libpskc}, a shared and static C library for PSKC handling.
|
||||
(description
|
||||
"The @dfn{OATH} (Open AuTHentication) Toolkit provides various components
|
||||
for building one-time password (@dfn{OTP}) authentication systems:
|
||||
|
||||
@itemize
|
||||
@item @command{oathtool}, a command-line tool for generating & validating OTPs.
|
||||
@item @code{liboath}, a C library for OATH handling.
|
||||
@item @code{pam_oath}, a PAM module for pluggable login authentication.
|
||||
@end itemize
|
||||
|
||||
Supported technologies include the event-based @dfn{HOTP} algorithm (RFC4226)
|
||||
and the time-based @dfn{TOTP} algorithm (RFC6238).")
|
||||
(license (list license:lgpl2.1+ ; the libraries (liboath/ & libpskc/)
|
||||
license:gpl3+)))) ; the tools (everything else)
|
||||
@@ -1,7 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014 Eric Bavier <bavier@member.fsf.org>
|
||||
;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -32,7 +31,7 @@
|
||||
(define-public autogen
|
||||
(package
|
||||
(name "autogen")
|
||||
(version "5.18.14")
|
||||
(version "5.18.12")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
@@ -40,12 +39,12 @@
|
||||
"/autogen-" version ".tar.xz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1r06gam7sicb9ssn02mhv6r0g5vr4k0l0c67shpqa5i172cspizz"))))
|
||||
"1n5zq4872sakvz9c7ncsdcfp0z8rsybsxvbmhkpbd19ii0pacfxy"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs `(("pkg-config" ,pkg-config)
|
||||
("which" ,which)))
|
||||
(inputs `(("guile" ,guile-2.0)
|
||||
("perl" ,perl))) ; for doc generator mdoc
|
||||
(native-inputs `(("perl" ,perl) ;for doc generator mdoc
|
||||
("pkg-config" ,pkg-config)))
|
||||
(inputs `(("which" ,which)
|
||||
("guile" ,guile-2.0)))
|
||||
(arguments
|
||||
'(#:phases
|
||||
(modify-phases %standard-phases
|
||||
@@ -55,7 +54,8 @@
|
||||
(substitute*
|
||||
(append (find-files "agen5/test" "\\.test$")
|
||||
(find-files "autoopts/test" "\\.(test|in)$"))
|
||||
(("/bin/sh") sh))
|
||||
(("/bin/sh") sh)
|
||||
(("/usr/bin/tr") "tr"))
|
||||
#t))))))
|
||||
(home-page "https://www.gnu.org/software/autogen/")
|
||||
(synopsis "Automated program generator")
|
||||
|
||||
+61
-107
@@ -1,14 +1,11 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
|
||||
;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
|
||||
;;; Copyright © 2015, 2017, 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2015, 2017 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2016 David Thompson <davet@gnu.org>
|
||||
;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
|
||||
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2017 ng0 <ng0@libertad.pw>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -29,7 +26,6 @@
|
||||
#:use-module (guix licenses)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages perl)
|
||||
#:use-module (gnu packages python)
|
||||
#:use-module (gnu packages m4)
|
||||
#:use-module (gnu packages man)
|
||||
#:use-module (gnu packages bash)
|
||||
@@ -121,13 +117,13 @@ know anything about Autoconf or M4.")
|
||||
(out (assoc-ref outputs "out")))
|
||||
(setenv "CONFIG_SHELL" bash)
|
||||
(setenv "SHELL" bash)
|
||||
(invoke bash "./configure"
|
||||
(string-append "--prefix=" out)
|
||||
(string-append "--build=" build))))))))))
|
||||
(zero? (system* bash "./configure"
|
||||
(string-append "--prefix=" out)
|
||||
(string-append "--build=" build)))))))))))
|
||||
|
||||
|
||||
(define (make-autoconf-wrapper autoconf)
|
||||
"Return a wrapper around AUTOCONF that generates `configure' scripts that
|
||||
(define* (autoconf-wrapper #:optional (autoconf autoconf))
|
||||
"Return an wrapper around AUTOCONF that generates `configure' scripts that
|
||||
use our own Bash instead of /bin/sh in shebangs. For that reason, it should
|
||||
only be used internally---users should not end up distributing `configure'
|
||||
files with a system-specific shebang."
|
||||
@@ -193,19 +189,12 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
|
||||
(patch-shebang "configure"))
|
||||
(exit (status:exit-val result))))
|
||||
port)))
|
||||
(chmod (string-append bin "/autoconf") #o555)
|
||||
#t))))
|
||||
|
||||
;; Do not show it in the UI since it's meant for internal use.
|
||||
(properties '((hidden? . #t)))))
|
||||
|
||||
(define-public autoconf-wrapper
|
||||
(make-autoconf-wrapper autoconf))
|
||||
(chmod (string-append bin "/autoconf") #o555)))))))
|
||||
|
||||
(define-public autoconf-archive
|
||||
(package
|
||||
(name "autoconf-archive")
|
||||
(version "2018.03.13")
|
||||
(version "2017.03.21")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
@@ -213,7 +202,7 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
|
||||
version ".tar.xz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0ng1lvpijf3kv7w7nb1shqs23vp0398yicyvkf9lsk56kw6zjxb1"))))
|
||||
"0rfpapadka2023qhy8294ca5awxpb8d4904js6kv7piby5ax8siq"))))
|
||||
(build-system gnu-build-system)
|
||||
(home-page "https://www.gnu.org/software/autoconf-archive/")
|
||||
(synopsis "Collection of freely reusable Autoconf macros")
|
||||
@@ -250,19 +239,21 @@ output is indexed in many ways to simplify browsing.")
|
||||
(define-public automake
|
||||
(package
|
||||
(name "automake")
|
||||
(version "1.16.1")
|
||||
(version "1.15")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "mirror://gnu/automake/automake-"
|
||||
version ".tar.xz"))
|
||||
(sha256
|
||||
(base32
|
||||
"08g979ficj18i1w6w5219bgmns7czr03iadf20mk3lrzl8wbn1ax"))
|
||||
"0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r"))
|
||||
(patches
|
||||
(search-patches "automake-skip-amhello-tests.patch"))))
|
||||
(search-patches "automake-regexp-syntax.patch"
|
||||
"automake-skip-amhello-tests.patch"
|
||||
"automake-test-gzip-warning.patch"))))
|
||||
(build-system gnu-build-system)
|
||||
(native-inputs
|
||||
`(("autoconf" ,autoconf-wrapper)
|
||||
`(("autoconf" ,(autoconf-wrapper))
|
||||
("perl" ,perl)))
|
||||
(native-search-paths
|
||||
(list (search-path-specification
|
||||
@@ -274,48 +265,47 @@ output is indexed in many ways to simplify browsing.")
|
||||
(srfi srfi-1)
|
||||
(srfi srfi-26)
|
||||
(rnrs io ports))
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-before 'patch-source-shebangs 'patch-tests-shebangs
|
||||
(lambda _
|
||||
(let ((sh (which "sh")))
|
||||
(substitute* (find-files "t" "\\.(sh|tap)$")
|
||||
(("#![[:blank:]]?/bin/sh")
|
||||
(string-append "#!" sh)))
|
||||
#:phases (alist-cons-before
|
||||
'patch-source-shebangs 'patch-tests-shebangs
|
||||
(lambda _
|
||||
(let ((sh (which "sh")))
|
||||
(substitute* (find-files "t" "\\.(sh|tap)$")
|
||||
(("#![[:blank:]]?/bin/sh")
|
||||
(string-append "#!" sh)))
|
||||
|
||||
;; Set these variables for all the `configure' runs
|
||||
;; that occur during the test suite.
|
||||
(setenv "SHELL" sh)
|
||||
(setenv "CONFIG_SHELL" sh)
|
||||
#t)))
|
||||
;; Set these variables for all the `configure' runs
|
||||
;; that occur during the test suite.
|
||||
(setenv "SHELL" sh)
|
||||
(setenv "CONFIG_SHELL" sh)))
|
||||
|
||||
;; Files like `install-sh', `mdate.sh', etc. must use
|
||||
;; #!/bin/sh, otherwise users could leak erroneous shebangs
|
||||
;; in the wild. See <http://bugs.gnu.org/14201> for an
|
||||
;; example.
|
||||
(add-after 'install 'unpatch-shebangs
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(dir (string-append out "/share")))
|
||||
(define (starts-with-shebang? file)
|
||||
(equal? (call-with-input-file file
|
||||
(lambda (p)
|
||||
(list (get-u8 p) (get-u8 p))))
|
||||
(map char->integer '(#\# #\!))))
|
||||
;; Files like `install-sh', `mdate.sh', etc. must use
|
||||
;; #!/bin/sh, otherwise users could leak erroneous shebangs
|
||||
;; in the wild. See <http://bugs.gnu.org/14201> for an
|
||||
;; example.
|
||||
(alist-cons-after
|
||||
'install 'unpatch-shebangs
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(dir (string-append out "/share")))
|
||||
(define (starts-with-shebang? file)
|
||||
(equal? (call-with-input-file file
|
||||
(lambda (p)
|
||||
(list (get-u8 p) (get-u8 p))))
|
||||
(map char->integer '(#\# #\!))))
|
||||
|
||||
(for-each (lambda (file)
|
||||
(when (and (starts-with-shebang? file)
|
||||
(executable-file? file))
|
||||
(format #t "restoring shebang on `~a'~%"
|
||||
file)
|
||||
(substitute* file
|
||||
(("^#!.*/bin/sh")
|
||||
"#!/bin/sh")
|
||||
(("^#!.*/bin/env(.*)$" _ args)
|
||||
(string-append "#!/usr/bin/env"
|
||||
args)))))
|
||||
(find-files dir ".*"))
|
||||
#t))))))
|
||||
(for-each (lambda (file)
|
||||
(when (and (starts-with-shebang? file)
|
||||
(executable-file? file))
|
||||
(format #t "restoring shebang on `~a'~%"
|
||||
file)
|
||||
(substitute* file
|
||||
(("^#!.*/bin/sh")
|
||||
"#!/bin/sh")
|
||||
(("^#!.*/bin/env(.*)$" _ args)
|
||||
(string-append "#!/usr/bin/env"
|
||||
args)))))
|
||||
(find-files dir ".*"))))
|
||||
%standard-phases))))
|
||||
(home-page "https://www.gnu.org/software/automake/")
|
||||
(synopsis "Making GNU standards-compliant Makefiles")
|
||||
(description
|
||||
@@ -341,12 +331,9 @@ Makefile, simplifying the entire process for the developer.")
|
||||
(propagated-inputs `(("m4" ,m4)))
|
||||
(native-inputs `(("m4" ,m4)
|
||||
("perl" ,perl)
|
||||
;; XXX: this shouldn't be necessary, but without it test
|
||||
;; 102 fails because it cannot find ltdl/libltdl.la.
|
||||
("libltdl" ,libltdl)
|
||||
("help2man" ,help2man) ;because we modify ltmain.sh
|
||||
("automake" ,automake) ;some tests rely on 'aclocal'
|
||||
("autoconf" ,autoconf-wrapper))) ;others on 'autom4te'
|
||||
("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
|
||||
|
||||
(arguments
|
||||
`(;; Libltdl is provided as a separate package, so don't install it here.
|
||||
@@ -405,46 +392,13 @@ complexity of working with shared libraries across platforms.")
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
'(#:configure-flags '("--enable-ltdl-install") ;really install it
|
||||
#:phases (modify-phases %standard-phases
|
||||
(add-before 'configure 'change-directory
|
||||
(lambda _ (chdir "libltdl") #t)))))
|
||||
#:phases (alist-cons-before
|
||||
'configure 'change-directory
|
||||
(lambda _
|
||||
(chdir "libltdl"))
|
||||
%standard-phases)))
|
||||
|
||||
(synopsis "System-independent dlopen wrapper of GNU libtool")
|
||||
(description (package-description libtool))
|
||||
(home-page (package-home-page libtool))
|
||||
(license lgpl2.1+)))
|
||||
|
||||
(define-public pyconfigure
|
||||
(package
|
||||
(name "pyconfigure")
|
||||
(version "0.2.3")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "mirror://gnu/pyconfigure/pyconfigure-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0kxi9bg7l6ric39vbz9ykz4a21xlihhh2zcc3297db8amvhqwhrp"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-before 'configure 'patch-python
|
||||
(lambda _
|
||||
(substitute* "pyconf.in"
|
||||
(("/usr/bin/env python") (which "python3")))
|
||||
#t)))))
|
||||
(inputs
|
||||
`(("python" ,python-3)))
|
||||
(synopsis "@command{configure} interface for Python-based packages")
|
||||
(description
|
||||
"GNU pyconfigure provides template files for easily implementing
|
||||
standards-compliant configure scripts and Makefiles for Python-based packages.
|
||||
It is designed to work alongside existing Python setup scripts, making it easy
|
||||
to integrate into existing projects. Powerful and flexible Autoconf macros
|
||||
are available, allowing you to easily make adjustments to the installation
|
||||
procedure based on the capabilities of the target computer.")
|
||||
(home-page "https://www.gnu.org/software/pyconfigure/manual/")
|
||||
(license
|
||||
(fsf-free
|
||||
"https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html"))))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
;;; guix-emacs.el --- Emacs packages installed with Guix
|
||||
|
||||
;; Copyright © 2014, 2015, 2016, 2017 Alex Kost <alezost@gmail.com>
|
||||
;; Copyright © 2017 Kyle Meyer <kyle@kyleam.com>
|
||||
|
||||
;; This file is part of GNU Guix.
|
||||
|
||||
@@ -88,11 +87,9 @@ profiles.
|
||||
(interactive (list (if (fboundp 'guix-read-package-profile)
|
||||
(funcall 'guix-read-package-profile)
|
||||
guix-user-profile)))
|
||||
(let* ((env (getenv "GUIX_ENVIRONMENT"))
|
||||
(profiles (or profiles
|
||||
(append (list "/run/current-system/profile"
|
||||
guix-user-profile)
|
||||
(and env (list env))))))
|
||||
(let ((profiles (or profiles
|
||||
(list "/run/current-system/profile"
|
||||
guix-user-profile))))
|
||||
(dolist (profile profiles)
|
||||
(let ((dirs (guix-emacs-directories profile)))
|
||||
(when dirs
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user