diff options
| author | Mark H Weaver <mhw@netris.org> | 2015-06-10 17:50:27 -0400 |
|---|---|---|
| committer | Mark H Weaver <mhw@netris.org> | 2015-06-10 17:50:27 -0400 |
| commit | 14928016556300a6763334d4279c3d117902caaf (patch) | |
| tree | d0dc262b14164b82f97dd6e896ca9e93a1fabeea | |
| parent | 1511e0235525358abb52cf62abeb9457605b5093 (diff) | |
| parent | 57cd353d87d6e9e6e882327be70b4d7b5ce863ba (diff) | |
Merge branch 'master' into core-updates
246 files changed, 13195 insertions, 3935 deletions
diff --git a/.dir-locals.el b/.dir-locals.el index 7aef8536255..cbcb120edff 100644 --- a/.dir-locals.el +++ b/.dir-locals.el | |||
| @@ -13,7 +13,9 @@ | |||
| 13 | . | 13 | . |
| 14 | ((indent-tabs-mode . nil) | 14 | ((indent-tabs-mode . nil) |
| 15 | (eval . (put 'eval-when 'scheme-indent-function 1)) | 15 | (eval . (put 'eval-when 'scheme-indent-function 1)) |
| 16 | (eval . (put 'call-with-prompt 'scheme-indent-function 1)) | ||
| 16 | (eval . (put 'test-assert 'scheme-indent-function 1)) | 17 | (eval . (put 'test-assert 'scheme-indent-function 1)) |
| 18 | (eval . (put 'test-assertm 'scheme-indent-function 1)) | ||
| 17 | (eval . (put 'test-equal 'scheme-indent-function 1)) | 19 | (eval . (put 'test-equal 'scheme-indent-function 1)) |
| 18 | (eval . (put 'test-eq 'scheme-indent-function 1)) | 20 | (eval . (put 'test-eq 'scheme-indent-function 1)) |
| 19 | (eval . (put 'call-with-input-string 'scheme-indent-function 1)) | 21 | (eval . (put 'call-with-input-string 'scheme-indent-function 1)) |
| @@ -44,7 +46,7 @@ | |||
| 44 | (eval . (put 'emacs-substitute-sexps 'scheme-indent-function 1)) | 46 | (eval . (put 'emacs-substitute-sexps 'scheme-indent-function 1)) |
| 45 | (eval . (put 'emacs-substitute-variables 'scheme-indent-function 1)) | 47 | (eval . (put 'emacs-substitute-variables 'scheme-indent-function 1)) |
| 46 | (eval . (put 'with-derivation-narinfo 'scheme-indent-function 1)) | 48 | (eval . (put 'with-derivation-narinfo 'scheme-indent-function 1)) |
| 47 | (eval . (put 'with-derivation-substitute 'scheme-indent-function 1)) | 49 | (eval . (put 'with-derivation-substitute 'scheme-indent-function 2)) |
| 48 | 50 | ||
| 49 | (eval . (put 'syntax-parameterize 'scheme-indent-function 1)) | 51 | (eval . (put 'syntax-parameterize 'scheme-indent-function 1)) |
| 50 | (eval . (put 'with-monad 'scheme-indent-function 1)) | 52 | (eval . (put 'with-monad 'scheme-indent-function 1)) |
diff --git a/.gitignore b/.gitignore index eaa7dbd51a2..a0f19d76123 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -62,6 +62,7 @@ config.cache | |||
| 62 | /pre-inst-env | 62 | /pre-inst-env |
| 63 | /doc/.dirstamp | 63 | /doc/.dirstamp |
| 64 | /doc/guix.info | 64 | /doc/guix.info |
| 65 | /doc/guix.info-[0-9] | ||
| 65 | /doc/guix.pdf | 66 | /doc/guix.pdf |
| 66 | /doc/stamp-vti | 67 | /doc/stamp-vti |
| 67 | /doc/version.texi | 68 | /doc/version.texi |
| @@ -112,3 +113,6 @@ GTAGS | |||
| 112 | /emacs/guix-helper.scm | 113 | /emacs/guix-helper.scm |
| 113 | /emacs/guix-init.el | 114 | /emacs/guix-init.el |
| 114 | /emacs/guix-profiles.el | 115 | /emacs/guix-profiles.el |
| 116 | /doc/os-config-bare-bones.texi | ||
| 117 | /doc/os-config-desktop.texi | ||
| 118 | /doc/*.1 | ||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | #+TITLE: Hacking GNU Guix and Its Incredible Distro | 3 | #+TITLE: Hacking GNU Guix and Its Incredible Distro |
| 4 | 4 | ||
| 5 | Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 5 | Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 6 | Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> | 6 | Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> |
| 7 | Copyright © 2014 Pierre-Antoine Rault <par@rigelk.eu> | 7 | Copyright © 2014 Pierre-Antoine Rault <par@rigelk.eu> |
| 8 | 8 | ||
| @@ -20,6 +20,7 @@ addition to those mentioned in the installation instructions: | |||
| 20 | - [[http://www.gnu.org/software/automake/][GNU Automake]] | 20 | - [[http://www.gnu.org/software/automake/][GNU Automake]] |
| 21 | - [[http://www.gnu.org/software/gettext/][GNU Gettext]] | 21 | - [[http://www.gnu.org/software/gettext/][GNU Gettext]] |
| 22 | - [[http://www.graphviz.org/][Graphviz]] | 22 | - [[http://www.graphviz.org/][Graphviz]] |
| 23 | - [[http://www.gnu.org/software/help2man/][GNU Help2man]] (optional) | ||
| 23 | 24 | ||
| 24 | Run ‘./bootstrap’ to download the Nix daemon source code and to generate the | 25 | Run ‘./bootstrap’ to download the Nix daemon source code and to generate the |
| 25 | build system infrastructure using autoconf. It reports an error if an | 26 | build system infrastructure using autoconf. It reports an error if an |
| @@ -46,17 +47,7 @@ take a look at “info '(guix) Installation'” or send a message to | |||
| 46 | 47 | ||
| 47 | * Running Guix before it is installed | 48 | * Running Guix before it is installed |
| 48 | 49 | ||
| 49 | Command-line tools can be used even if you have not run "make install". | 50 | See the same-named section in the manual. |
| 50 | To do that, prefix each command with ‘./pre-inst-env’, as in: | ||
| 51 | |||
| 52 | ./pre-inst-env guix build --help | ||
| 53 | |||
| 54 | Similarly, for a Guile session using the Guix modules: | ||
| 55 | |||
| 56 | ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' | ||
| 57 | |||
| 58 | The ‘pre-inst-env’ script sets up all the environment variables | ||
| 59 | necessary to support this. | ||
| 60 | 51 | ||
| 61 | * The Perfect Setup | 52 | * The Perfect Setup |
| 62 | 53 | ||
diff --git a/Makefile.am b/Makefile.am index aa412bda2ba..2b84467b0cc 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -79,6 +79,7 @@ MODULES = \ | |||
| 79 | guix/build/store-copy.scm \ | 79 | guix/build/store-copy.scm \ |
| 80 | guix/build/utils.scm \ | 80 | guix/build/utils.scm \ |
| 81 | guix/build/union.scm \ | 81 | guix/build/union.scm \ |
| 82 | guix/build/profiles.scm \ | ||
| 82 | guix/build/pull.scm \ | 83 | guix/build/pull.scm \ |
| 83 | guix/build/rpath.scm \ | 84 | guix/build/rpath.scm \ |
| 84 | guix/build/cvs.scm \ | 85 | guix/build/cvs.scm \ |
| @@ -87,10 +88,13 @@ MODULES = \ | |||
| 87 | guix/build/gremlin.scm \ | 88 | guix/build/gremlin.scm \ |
| 88 | guix/build/emacs-utils.scm \ | 89 | guix/build/emacs-utils.scm \ |
| 89 | guix/build/graft.scm \ | 90 | guix/build/graft.scm \ |
| 91 | guix/search-paths.scm \ | ||
| 90 | guix/packages.scm \ | 92 | guix/packages.scm \ |
| 91 | guix/import/utils.scm \ | 93 | guix/import/utils.scm \ |
| 92 | guix/import/gnu.scm \ | 94 | guix/import/gnu.scm \ |
| 93 | guix/import/snix.scm \ | 95 | guix/import/snix.scm \ |
| 96 | guix/import/cabal.scm \ | ||
| 97 | guix/import/hackage.scm \ | ||
| 94 | guix/scripts/download.scm \ | 98 | guix/scripts/download.scm \ |
| 95 | guix/scripts/build.scm \ | 99 | guix/scripts/build.scm \ |
| 96 | guix/scripts/archive.scm \ | 100 | guix/scripts/archive.scm \ |
| @@ -106,6 +110,7 @@ MODULES = \ | |||
| 106 | guix/scripts/lint.scm \ | 110 | guix/scripts/lint.scm \ |
| 107 | guix/scripts/import/gnu.scm \ | 111 | guix/scripts/import/gnu.scm \ |
| 108 | guix/scripts/import/nix.scm \ | 112 | guix/scripts/import/nix.scm \ |
| 113 | guix/scripts/import/hackage.scm \ | ||
| 109 | guix/scripts/environment.scm \ | 114 | guix/scripts/environment.scm \ |
| 110 | guix/scripts/publish.scm \ | 115 | guix/scripts/publish.scm \ |
| 111 | guix.scm \ | 116 | guix.scm \ |
| @@ -133,7 +138,8 @@ KCONFIGS = \ | |||
| 133 | 138 | ||
| 134 | # Templates, examples. | 139 | # Templates, examples. |
| 135 | EXAMPLES = \ | 140 | EXAMPLES = \ |
| 136 | gnu/system/os-config.tmpl | 141 | gnu/system/examples/bare-bones.tmpl \ |
| 142 | gnu/system/examples/desktop.tmpl | ||
| 137 | 143 | ||
| 138 | GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go | 144 | GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go |
| 139 | 145 | ||
| @@ -175,6 +181,7 @@ SCM_TESTS = \ | |||
| 175 | tests/build-utils.scm \ | 181 | tests/build-utils.scm \ |
| 176 | tests/packages.scm \ | 182 | tests/packages.scm \ |
| 177 | tests/snix.scm \ | 183 | tests/snix.scm \ |
| 184 | tests/hackage.scm \ | ||
| 178 | tests/store.scm \ | 185 | tests/store.scm \ |
| 179 | tests/monads.scm \ | 186 | tests/monads.scm \ |
| 180 | tests/gexp.scm \ | 187 | tests/gexp.scm \ |
| @@ -10,6 +10,378 @@ Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | |||
| 10 | 10 | ||
| 11 | Please send Guix bug reports to bug-guix@gnu.org. | 11 | Please send Guix bug reports to bug-guix@gnu.org. |
| 12 | 12 | ||
| 13 | * Changes in 0.8.2 (since 0.8.1) | ||
| 14 | |||
| 15 | ** Package management | ||
| 16 | |||
| 17 | *** New “binary tarball” installation method is available | ||
| 18 | |||
| 19 | See “Binary Installation” in the manual. | ||
| 20 | |||
| 21 | *** New ‘guix publish’ command, to publish one’s store | ||
| 22 | |||
| 23 | See “Invoking guix publish” in the manual. | ||
| 24 | |||
| 25 | *** ‘guix package’ runs “profile creation hooks” as needed | ||
| 26 | |||
| 27 | It creates X.509 certificate bundles in the profile’s etc/ssl directory, if | ||
| 28 | needed, generates a package database cache for GHC if the profile includes GHC | ||
| 29 | (the Haskell compiler), and generates an Info ‘dir’ file (this part was | ||
| 30 | already done before.) | ||
| 31 | |||
| 32 | *** ‘guix package’ creates an ‘etc/profile’ file in the profile | ||
| 33 | |||
| 34 | See “Invoking guix package” in the manual. | ||
| 35 | |||
| 36 | *** Commands understand version prefixes, such as ‘gcc-5’ for ‘gcc-5.1.0’ | ||
| 37 | |||
| 38 | *** ‘guix package --search’ now sorts packages by name and version | ||
| 39 | |||
| 40 | *** Substitute information is now fetched using HTTP pipelining | ||
| 41 | |||
| 42 | Before that the “substituter” used threads. Using HTTP pipelining means that | ||
| 43 | resource consumption is reduced on both the client and server sides. As a | ||
| 44 | side effect, a progress report is displayed as substitute info is downloaded. | ||
| 45 | |||
| 46 | *** ‘guix package’ warns when a $GUIX_PACKAGE_PATH module cannot be loaded | ||
| 47 | |||
| 48 | *** New ‘--sources’ option to ‘guix build’ | ||
| 49 | |||
| 50 | *** New Bash completion file, installed in $sysconfdir/bash_completion.d | ||
| 51 | |||
| 52 | *** New ‘guix import hackage’ command | ||
| 53 | |||
| 54 | See “Invoking guix import” in the manual. | ||
| 55 | |||
| 56 | *** ‘guix lint’ supports FTP for the ‘source’ and ‘home-page’ checkers | ||
| 57 | |||
| 58 | *** ‘guix lint’ has a new ‘derivation’ checker | ||
| 59 | |||
| 60 | *** ‘guix import cpan’ better handles dependencies and licenses | ||
| 61 | |||
| 62 | *** Packages are now build in an environment with a UTF-8 locale | ||
| 63 | |||
| 64 | ** Distribution | ||
| 65 | |||
| 66 | *** C library's name service switch (NSS) is now fully configurable | ||
| 67 | |||
| 68 | See “Name Service Switch” in the manual. | ||
| 69 | |||
| 70 | *** New services: wicd, lirc, colord, upower, console-keymap, postgresql | ||
| 71 | |||
| 72 | *** Xorg service supports new drivers, such as Nouveau | ||
| 73 | |||
| 74 | *** lsh service has new options, initializes its seed by default | ||
| 75 | |||
| 76 | *** /etc/ssl symlink is created, for X.509 certificates | ||
| 77 | |||
| 78 | See “X.509 Certificates” in the manual. | ||
| 79 | |||
| 80 | *** ‘guix system’ reports duplicate service identifiers | ||
| 81 | |||
| 82 | *** New /etc/bashrc file that loads Bash completion when available | ||
| 83 | |||
| 84 | *** SLiM service uses sessions from /run/current-system/profile/share/xsessions | ||
| 85 | |||
| 86 | See “X Window” in the manual. | ||
| 87 | |||
| 88 | *** The Linux “YAMA” restricting policy on PTRACE_ATTACH is now disabled | ||
| 89 | |||
| 90 | *** /etc/shells now lists all the user accounts’ shells | ||
| 91 | |||
| 92 | *** /gnu/store is now remounted read-only, to avoid accidental modification | ||
| 93 | |||
| 94 | *** /etc/profile is sources each profile’s ‘etc/profile’ file | ||
| 95 | |||
| 96 | *** 718 new packages | ||
| 97 | |||
| 98 | aalib, aarddict, acpid, agg, aisleriot, alsa-modular-synth, ant, ardour, | ||
| 99 | ardour, argtable, arpack-ng, aspell-dict-ru, aubio, audacity, avidemux, | ||
| 100 | avidemux, azr3, bamtools, bash-completion, bedops, bind-utils, bluez, bool, | ||
| 101 | brdf-explorer, bwa, calf, calibre, catch, ccl, chibi-scheme, chmlib, | ||
| 102 | clalsadrv, clipper, clisp, clustal-omega, colord, colordiff, cpufrequtils, | ||
| 103 | crossmap, csound, ctl, cunit, cutadapt, desktop-file-utils, djvulibre, | ||
| 104 | dnsmasq, dosfstools, double-conversion, dovecot, ecl, efl, elementary, | ||
| 105 | elogind, emacs-no-x, emotion-generic-players, enca, enlightenment, | ||
| 106 | evas-generic-loaders, exim, express, extremetuxracer, faad2, fastx-toolkit, | ||
| 107 | fcitx, fdupes, flexbar, fluidsynth, font-adobe-source-han-sans, | ||
| 108 | font-wqy-zenhei, freepats, gambit-c, ganv, geda-gaf, geoclue, geocode-glib, | ||
| 109 | ghc, ghc-case-insensitive, ghc-containers, ghc-fgl, ghc-hashable, ghc-http, | ||
| 110 | ghc-hunit, ghc-mtl, ghc-network, ghc-network-uri, ghc-parallel, ghc-parsec, | ||
| 111 | ghc-paths, ghc-primitive, ghc-quickcheck, ghc-random, ghc-split, ghc-stm, | ||
| 112 | ghc-syb, ghc-text, ghc-tf-random, ghc-unordered-containers, ghc-vector, | ||
| 113 | ghc-zlib, girara, gitolite, glib-networking, glibc-locales, | ||
| 114 | glibc-utf8-locales, glibc-utf8-locales, glm, gnome-mines, | ||
| 115 | gnome-settings-daemon, gnome-terminal, gnucash, gnugo, grit, gst-libav, | ||
| 116 | guile-minikanren, guile-reader, hdparm, hisat, htseq, htsjdk, hunspell, | ||
| 117 | hyphen, i2c-tools, ibus, icecast, icedtea6, icedtea7, ilmbase, ir, isync, | ||
| 118 | ixion, jack2, jalv, jansson, jemalloc, julia, key-mon, ladspa, lash, | ||
| 119 | leptonica, liba52, libabw, libaio, libass, libavc1394, libbluray, libbs2b, | ||
| 120 | libcaca, libcap-ng, libcdio-paranoia, libcdr, libdca, libdv, libdvdcss, | ||
| 121 | libe-book, libedit, libepoxy, libetonyek, libexttextcat, libffcall, | ||
| 122 | libfreehand, libgnomecanvasmm, libgtextutils, libgweather, libical, | ||
| 123 | libiec61883, libinput, liblo, libmodplug, libmspack, libmspub, libmtp, | ||
| 124 | libmwaw, libodfgen, libpagemaker, libqtxdg, libquvi, libquvi-scripts, | ||
| 125 | libraw1394, librecad, librep, librevenge, libsbsms, libsecret, libshout, | ||
| 126 | libsoup, libsrtp, libtocc, libungif, libva, libvisio, libwacom, libwebp, | ||
| 127 | libwpd, libwpg, libwps, libxklavier, libxmp, libyaml, lilv, lilypond, lirc, | ||
| 128 | livestreamer, ltrace, lv2, lv2-mda-epiano, lv2-mda-piano, lvtk, macs, mariadb, | ||
| 129 | markdown, mdadm, mdds, mesa-headers, mesa-utils, miredo, miso, moreutils, | ||
| 130 | mpd-mpc, mpdscribble, mplayer2, mpv, muparser, mythes, ncbi-vdb, ngircd, | ||
| 131 | ngs-java, ngs-sdk, npth, nss-certs, openblas, openexr, openlibm, openntpd, | ||
| 132 | openspecfun, openvpn, orc, orcus, p11-kit, patchage, pbtranscript-tofu, pcb, | ||
| 133 | perl-algorithm-c3, perl-algorithm-diff, perl-aliased, | ||
| 134 | perl-apache-logformat-compiler, perl-appconfig, perl-b-hooks-endofscope, | ||
| 135 | perl-base, perl-bit-vector, perl-boolean, perl-cache-cache, | ||
| 136 | perl-cache-fastmmap, perl-capture-tiny, perl-carp-assert, | ||
| 137 | perl-carp-assert-more, perl-carp-clan, perl-catalyst-action-renderview, | ||
| 138 | perl-catalyst-action-rest, perl-catalyst-component-instancepercontext, | ||
| 139 | perl-catalyst-devel, perl-catalyst-dispatchtype-regex, | ||
| 140 | perl-catalyst-model-dbic-schema, perl-catalyst-plugin-accesslog, | ||
| 141 | perl-catalyst-plugin-authentication, perl-catalyst-plugin-captcha, | ||
| 142 | perl-catalyst-plugin-configloader, perl-catalyst-plugin-session, | ||
| 143 | perl-catalyst-plugin-session-state-cookie, | ||
| 144 | perl-catalyst-plugin-session-store-fastmmap, perl-catalyst-plugin-stacktrace, | ||
| 145 | perl-catalyst-plugin-static-simple, perl-catalyst-runtime, | ||
| 146 | perl-catalyst-traitfor-request-proxybase, perl-catalyst-view-download, | ||
| 147 | perl-catalyst-view-json, perl-catalyst-view-tt, | ||
| 148 | perl-catalystx-component-traits, perl-catalystx-roleapplicator, | ||
| 149 | perl-catalystx-script-server-starman, perl-cgi-simple, perl-cgi-struct, | ||
| 150 | perl-class-accessor, perl-class-accessor-chained, perl-class-accessor-grouped, | ||
| 151 | perl-class-c3, perl-class-c3-adopt-next, perl-class-c3-componentised, | ||
| 152 | perl-class-data-inheritable, perl-class-date, perl-class-factory-util, | ||
| 153 | perl-class-inspector, perl-class-load, perl-class-load-xs, | ||
| 154 | perl-class-method-modifiers, perl-class-methodmaker, perl-class-singleton, | ||
| 155 | perl-class-tiny, perl-class-unload, perl-class-xsaccessor, perl-common-sense, | ||
| 156 | perl-compress-raw-bzip2, perl-compress-raw-zlib, perl-config-any, | ||
| 157 | perl-config-autoconf, perl-config-general, perl-context-preserve, | ||
| 158 | perl-cpan-meta, perl-cpan-meta-check, perl-cpan-meta-requirements, | ||
| 159 | perl-cpan-meta-yaml, perl-cpanel-json-xs, perl-crypt-randpasswd, | ||
| 160 | perl-data-dump, perl-data-dumper-concise, perl-data-optlist, perl-data-page, | ||
| 161 | perl-data-stream-bulk, perl-data-tumbler, perl-data-visitor, perl-date-calc, | ||
| 162 | perl-date-calc-xs, perl-datetime, perl-datetime-event-ical, | ||
| 163 | perl-datetime-event-recurrence, perl-datetime-format-builder, | ||
| 164 | perl-datetime-format-flexible, perl-datetime-format-http, | ||
| 165 | perl-datetime-format-ical, perl-datetime-format-natural, | ||
| 166 | perl-datetime-format-strptime, perl-datetime-locale, perl-datetime-set, | ||
| 167 | perl-datetime-timezone, perl-datetimex-easy, perl-dbd-pg, perl-dbix-class, | ||
| 168 | perl-dbix-class-cursor-cached, perl-dbix-class-introspectablem2m, | ||
| 169 | perl-dbix-class-schema-loader, perl-devel-caller, perl-devel-checkbin, | ||
| 170 | perl-devel-globaldestruction, perl-devel-lexalias, perl-devel-overloadinfo, | ||
| 171 | perl-devel-partialdump, perl-devel-stacktrace, perl-devel-stacktrace-ashtml, | ||
| 172 | perl-devel-symdump, perl-digest-hmac, perl-digest-md5-file, | ||
| 173 | perl-dist-checkconflicts, perl-email-abstract, perl-email-address, | ||
| 174 | perl-email-date-format, perl-email-messageid, perl-email-mime, | ||
| 175 | perl-email-mime-contenttype, perl-email-mime-encodings, perl-email-sender, | ||
| 176 | perl-email-simple, perl-error, perl-eval-closure, perl-exception-class, | ||
| 177 | perl-exporter-tiny, perl-extutils-config, perl-extutils-helpers, | ||
| 178 | perl-extutils-installpaths, perl-file-changenotify, perl-file-copy-recursive, | ||
| 179 | perl-file-find-rule, perl-file-find-rule-perl, perl-file-homedir, | ||
| 180 | perl-file-remove, perl-file-sharedir, perl-file-sharedir-install, | ||
| 181 | perl-file-slurp, perl-file-temp, perl-gd, perl-gd-securityimage, | ||
| 182 | perl-getopt-long-descriptive, perl-hash-merge, perl-hash-multivalue, | ||
| 183 | perl-html-form, perl-html-lint, perl-html-tree, perl-http-body, | ||
| 184 | perl-http-cookiejar, perl-http-parser, perl-http-parser-xs, | ||
| 185 | perl-http-request-ascgi, perl-http-server-simple, perl-http-tiny, | ||
| 186 | perl-image-magick, perl-import-into, perl-inc-latest, perl-io-compress, | ||
| 187 | perl-io-interactive, perl-io-socket-ip, perl-io-stringy, perl-ipc-run, | ||
| 188 | perl-ipc-sharelite, perl-json, perl-json-any, perl-json-maybexs, perl-json-xs, | ||
| 189 | perl-lingua-en-findnumber, perl-lingua-en-inflect, | ||
| 190 | perl-lingua-en-inflect-number, perl-lingua-en-inflect-phrase, | ||
| 191 | perl-lingua-en-number-isordinal, perl-lingua-en-tagger, | ||
| 192 | perl-lingua-en-words2nums, perl-lingua-pt-stemmer, perl-lingua-stem, | ||
| 193 | perl-lingua-stem-fr, perl-lingua-stem-it, perl-lingua-stem-ru, | ||
| 194 | perl-lingua-stem-snowball-da, perl-list-allutils, perl-list-moreutils, | ||
| 195 | perl-lwp-protocol-https, perl-lwp-useragent-determined, | ||
| 196 | perl-memoize-expirelru, perl-mime-types, perl-module-build, | ||
| 197 | perl-module-build-tiny, perl-module-find, perl-module-implementation, | ||
| 198 | perl-module-install, perl-module-runtime, perl-module-runtime-conflicts, | ||
| 199 | perl-module-scandeps, perl-module-util, perl-moo, perl-moose, | ||
| 200 | perl-moosex-emulate-class-accessor-fast, perl-moosex-getopt, | ||
| 201 | perl-moosex-markasmethods, perl-moosex-methodattributes, perl-moosex-nonmoose, | ||
| 202 | perl-moosex-params-validate, perl-moosex-relatedclassroles, | ||
| 203 | perl-moosex-role-parameterized, perl-moosex-role-withoverloading, | ||
| 204 | perl-moosex-semiaffordanceaccessor, perl-moosex-strictconstructor, | ||
| 205 | perl-moosex-traits-pluggable, perl-moosex-types, perl-moosex-types-datetime, | ||
| 206 | perl-moosex-types-datetime-morecoercions, perl-moosex-types-loadableclass, | ||
| 207 | perl-moox-types-mooselike, perl-mro-compat, perl-namespace-autoclean, | ||
| 208 | perl-namespace-clean, perl-net-amazon-s3, perl-net-server, | ||
| 209 | perl-number-compare, perl-object-signature, perl-package-anon, | ||
| 210 | perl-package-deprecationmanager, perl-package-stash, perl-package-stash-xs, | ||
| 211 | perl-padwalker, perl-par-dist, perl-params-util, perl-params-validate, | ||
| 212 | perl-parent, perl-parse-cpan-meta, perl-path-class, perl-plack, | ||
| 213 | perl-plack-middleware-fixmissingbodyinredirect, | ||
| 214 | perl-plack-middleware-methodoverride, | ||
| 215 | perl-plack-middleware-removeredundantbody, perl-plack-middleware-reverseproxy, | ||
| 216 | perl-plack-test-externalserver, perl-pod-coverage, | ||
| 217 | perl-posix-strftime-compiler, perl-readonly, perl-role-tiny, perl-safe-isa, | ||
| 218 | perl-scalar-list-utils, perl-scope-guard, perl-set-infinite, perl-set-scalar, | ||
| 219 | perl-snowball-norwegian, perl-snowball-swedish, perl-spiffy, | ||
| 220 | perl-sql-abstract, perl-sql-splitstatement, perl-sql-tokenizer, | ||
| 221 | perl-stream-buffered, perl-strictures, perl-string-camelcase, | ||
| 222 | perl-string-rewriteprefix, perl-string-toidentifier-en, perl-sub-exporter, | ||
| 223 | perl-sub-exporter-progressive, perl-sub-identify, perl-sub-install, | ||
| 224 | perl-sub-name, perl-sub-uplevel, perl-svg, perl-sys-hostname-long, | ||
| 225 | perl-task-weaken, perl-template-timer, perl-template-toolkit, | ||
| 226 | perl-term-encoding, perl-term-progressbar, perl-term-progressbar-quiet, | ||
| 227 | perl-term-progressbar-simple, perl-term-readkey, perl-test-base, | ||
| 228 | perl-test-cleannamespaces, perl-test-differences, perl-test-directory, | ||
| 229 | perl-test-exception, perl-test-fatal, perl-test-harness, perl-test-leaktrace, | ||
| 230 | perl-test-longstring, perl-test-mockobject, perl-test-mocktime, | ||
| 231 | perl-test-most, perl-test-output, perl-test-pod, perl-test-pod-coverage, | ||
| 232 | perl-test-requires, perl-test-sharedfork, perl-test-tcp, perl-test-trap, | ||
| 233 | perl-test-utf8, perl-test-warn, perl-test-warnings, perl-test-without-module, | ||
| 234 | perl-test-writevariants, perl-test-www-mechanize, | ||
| 235 | perl-test-www-mechanize-catalyst, perl-test-www-mechanize-psgi, | ||
| 236 | perl-test-yaml, perl-text-aligner, perl-text-balanced, perl-text-csv, | ||
| 237 | perl-text-diff, perl-text-german, perl-text-glob, perl-text-simpletable, | ||
| 238 | perl-text-table, perl-text-unidecode, perl-throwable, perl-tie-ixhash, | ||
| 239 | perl-tie-toobject, perl-time-duration, perl-time-duration-parse, | ||
| 240 | perl-time-local, perl-time-mock, perl-timedate, perl-tree-simple, | ||
| 241 | perl-tree-simple-visitorfactory, perl-try-tiny, perl-types-serialiser, | ||
| 242 | perl-universal-can, perl-universal-isa, perl-uri-find, perl-uri-ws, | ||
| 243 | perl-variable-magic, perl-www-mechanize, perl-xml-libxml, | ||
| 244 | perl-xml-namespacesupport, perl-xml-sax, perl-xml-sax-base, perl-yaml, | ||
| 245 | perl-yaml-tiny, ploticus, polipo, portaudio, pumpa, python-apsw, | ||
| 246 | python-biopython, python-cssselect, python-dbus, python-decorator, | ||
| 247 | python-drmaa, python-h5py, python-lxml, python-netifaces, python-networkx, | ||
| 248 | python-pyxdg, python-pyyaml, python-requests, python-scikit-learn, | ||
| 249 | python-singledispatch, python-sphinx-rtd-theme, python-sympy, python-testlib, | ||
| 250 | python-tornado, python-urwid, python-waf, python2-apsw, | ||
| 251 | python2-backport-ssl-match-hostname, python2-biopython, python2-bx-python, | ||
| 252 | python2-cssselect, python2-cssutils, python2-dbus, python2-decorator, | ||
| 253 | python2-drmaa, python2-h5py, python2-lxml, python2-netifaces, | ||
| 254 | python2-networkx, python2-pbcore, python2-pil, python2-pybedtools, | ||
| 255 | python2-pycairo, python2-pyxdg, python2-pyyaml, python2-rdflib, python2-rsvg, | ||
| 256 | python2-scikit-learn, python2-singledispatch, python2-six, | ||
| 257 | python2-sphinx-rtd-theme, python2-sympy, python2-testlib, python2-tornado, | ||
| 258 | python2-urwid, python2-waf, python2-xlib, quvi, r, rdesktop, recode, rep-gtk, | ||
| 259 | rseqc, rsound, rubberband, ruby-hoe, rxvt-unicode, s2tc, sawfish, sbcl, seqan, | ||
| 260 | serd, serf, sfml, shogun, sloccount, smartmontools, snakemake, soil, solfege, | ||
| 261 | sord, soundtouch, soxr, sra-tools, sratom, srt2vtt, star, starman, stow, | ||
| 262 | subread, suil, suitesparse, swt, sysfsutils, sysfsutils, taskwarrior, tbb, | ||
| 263 | terminology, tesseract-ocr, texlive-bin, texlive-texmf, the-silver-searcher, | ||
| 264 | tidy, tig, timidity++, tocc, totem-pl-parser, tree, tuxguitar, tvtime, | ||
| 265 | twolame, txt2man, unqlite, upower, utf8proc, vamp, vapoursynth, vcftools, | ||
| 266 | vigra, wavpack, webkitgtk, webkitgtk, weex, wicd, wpa-supplicant-light, | ||
| 267 | wxwidgets, wxwidgets, xbindkeys, xcape, xdg-utils, xf86-input-libinput, | ||
| 268 | xf86-input-wacom, xf86-video-nouveau, xfce, xmp, xosd, xournal, xvid, zathura, | ||
| 269 | zathura-cb, zathura-djvu, zathura-pdf-poppler, zathura-ps, zeromq, | ||
| 270 | zita-alsa-pcmi, zita-convolver | ||
| 271 | |||
| 272 | *** 189 package updates | ||
| 273 | |||
| 274 | acpica-20150410, apl-1.5, apr-1.5.2, arb-2.3.0, at-spi2-atk-2.16.0, | ||
| 275 | at-spi2-core-2.16.0, atk-2.16.0, autogen-5.18.5, bison-3.0.4, boost-1.57.0, | ||
| 276 | cairo-1.14.2, ccrtp-2.1.2, check-0.9.14, clang-3.6.0, cmake-3.2.2, | ||
| 277 | complexity-1.2, cups-filters-1.0.68, curl-7.42.1, dbus-1.8.16, | ||
| 278 | dbus-glib-0.104, dejagnu-1.5.3, docbook-xml-4.4, docbook-xml-4.5, | ||
| 279 | e2fsck-static-1.42.12, e2fsprogs-1.42.12, ed-1.11, eigen-3.2.4, | ||
| 280 | elfutils-0.161, emacs-24.5, emacs-no-x-toolkit-24.5, exo-0.10.3, ffmpeg-2.6.2, | ||
| 281 | fish-2.1.2, flac-1.3.1, flint-2.4.5, fltk-1.3.3, freetype-2.5.5, garcon-0.4.0, | ||
| 282 | gcc-5.1.0, gcc-toolchain-5.1.0, gdb-7.9, geiser-0.7, glib-2.44.0, glibc-2.21, | ||
| 283 | glibc-2.21, glibc-stripped-tarball-2.21, glibmm-2.44.0, global-6.4, | ||
| 284 | gnome-desktop-3.16.0, gnome-icon-theme-3.12.0, gnome-themes-standard-3.16.0, | ||
| 285 | gnu-pw-mgr-1.3, gnubik-2.4.2, gnumach-headers-1.5, gnunet-0.10.1, | ||
| 286 | gnupg-1.4.19, gnupg-2.0.27, gnupg-2.1.4, gnutls-3.4.0, | ||
| 287 | gobject-introspection-1.44.0, gpgme-1.5.4, gsettings-desktop-schemas-3.16.0, | ||
| 288 | gst-plugins-base-1.4.5, gst-plugins-good-1.4.5, gstreamer-1.4.5, gtk+-3.16.2, | ||
| 289 | gtkmm-2.24.4, gtkmm-3.16.0, guile-ssh-0.7.2, guix-0.8.1, guix-0.8.1.fc34dee, | ||
| 290 | help2man-1.46.6, httpd-2.4.12, hurd-headers-0.6, icecat-31.6.0-gnu1, | ||
| 291 | icu4c-55.1, imagemagick-6.9.0-4, imlib2-1.4.7, inetutils-1.9.3, inkscape-0.91, | ||
| 292 | isc-dhcp-4.3.1, itstool-2.0.2, kbd-2.0.2, libgcrypt-1.6.3, libgpg-error-1.18, | ||
| 293 | libidn-1.30, libltdl-2.4.6, libmicrohttpd-0.9.40, libmikmod-3.3.7, | ||
| 294 | libotr-4.1.0, libsigc++-2.4.1, libtasn1-4.5, libtool-2.4.6, | ||
| 295 | libunistring-0.9.5, libuv-1.4.2, libvorbis-1.3.5, libxfce4ui-4.12.0, | ||
| 296 | libxfce4util-4.12.1, libxfont-1.5.1, lightning-2.1.0, linux-libre-4.0.2, | ||
| 297 | linux-libre-headers-3.14.37, llvm-3.6.0, lua-5.2.3, man-pages-3.82, | ||
| 298 | mesa-10.5.4, mig-1.5, minetest-0.4.12, moe-1.7, mpc-1.0.3, mpd-0.19.9, | ||
| 299 | mu-0.9.12, nano-2.4.1, ncmpcpp-0.6.2, nettle-3.1, nginx-1.8.0, node-0.12.2, | ||
| 300 | notmuch-0.19, nspr-4.10.8, nss-3.18, ntp-4.2.8p2, ocrad-0.25, octave-3.8.2, | ||
| 301 | openconnect-7.05, openjpeg-2.0.1, openjpeg-2.1.0, openldap-2.4.40, | ||
| 302 | openssh-6.8p1, openssl-1.0.2a, pangomm-2.36.0, parallel-20150422, | ||
| 303 | pari-gp-2.7.3, patch-2.7.5, perf-4.0.2, perl-libwww-6.13, perl-net-http-6.07, | ||
| 304 | perl-net-ssleay-1.68, perl-test-simple-1.001014, perl-uri-1.67, | ||
| 305 | pinentry-0.9.0, pius-2.0.11, podofo-0.9.3, poppler-0.32.0, postgresql-9.3.6, | ||
| 306 | pulseaudio-6.0, python-3.4.3, python-pillow-2.7.0, python-pygobject-3.16.1, | ||
| 307 | python-setuptools-12.1, python-wrapper-3.4.3, python2-dateutil-2.2, | ||
| 308 | python2-pillow-2.7.0, python2-pygobject-3.16.1, python2-setuptools-12.1, | ||
| 309 | qt-5.4.1, ruby-2.2.2, samba-3.6.25, scons-2.3.4, sdl2-2.0.3, sharutils-4.15.1, | ||
| 310 | sipwitch-1.9.7, slock-1.2, source-highlight-3.1.8, sqlite-3.8.9, | ||
| 311 | subversion-1.8.13, texinfo-5.2, thunar-1.6.6, thunar-volman-0.8.1, | ||
| 312 | tor-0.2.5.12, tumbler-0.1.31, tzdata-2015c, ucommon-6.3.1, vala-0.28.0, | ||
| 313 | valgrind-3.10.1, vlc-2.2.0, vte-0.40.0, wget-1.16.3, wine-1.7.40, | ||
| 314 | wpa-supplicant-2.4, xboard-4.8.0, xfce4-appfinder-4.12.0, xfce4-panel-4.12.0, | ||
| 315 | xfce4-session-4.12.0, xfce4-settings-4.12.0, xfconf-4.12.0, xfdesktop-4.12.0, | ||
| 316 | xfwm4-4.12.0, xorg-server-1.16.4, xterm-317 | ||
| 317 | |||
| 318 | ** Programming interfaces | ||
| 319 | |||
| 320 | *** New (guix build gremlin) to parse and validate ELF dynamic link info | ||
| 321 | |||
| 322 | *** (guix build-system gnu) has a new ‘validate-runpath’ phase | ||
| 323 | |||
| 324 | This phase reads the dynamic entries of ELF files and reports libraries listed | ||
| 325 | as NEEDED that are not found in the RUNPATH. | ||
| 326 | |||
| 327 | *** New (gnu services desktop) module and ‘%desktop-services’ variable | ||
| 328 | |||
| 329 | *** New (guix cvs-download) module, for CVS checkouts | ||
| 330 | |||
| 331 | *** New (guix build-system waf) module, for the Waf build system | ||
| 332 | |||
| 333 | *** New (guix build-system haskell) module, to build Haskell packages | ||
| 334 | |||
| 335 | *** (guix build-system gnu) now supports zip archives | ||
| 336 | |||
| 337 | *** New convenience syntax ‘modify-phases’ added in (guix build utils) | ||
| 338 | |||
| 339 | *** The ‘ld’ wrapper more finely determines whether to use ‘-rpath’ | ||
| 340 | |||
| 341 | *** (guix gexp) exports ‘gexp-input’ to describe input unambiguously | ||
| 342 | |||
| 343 | *** The ‘define-gexp-compiler’ form allows (guix gexp) to be extended | ||
| 344 | |||
| 345 | *** New ‘local-file’ constructor exported by (guix gexp) | ||
| 346 | |||
| 347 | ** Noteworthy bug fixes | ||
| 348 | |||
| 349 | *** Profiles created with ‘guix package -p’ as indirect GC roots | ||
| 350 | |||
| 351 | Before that they were made permanent GC roots–i.e., uncollectable. | ||
| 352 | |||
| 353 | *** ‘guix package’ distinguishes downgrades from upgrades | ||
| 354 | |||
| 355 | *** Handle HTTP redirects to relative URI references | ||
| 356 | (<http://bugs.gnu.org/19840>) | ||
| 357 | |||
| 358 | *** Downloads now honor the ‘http_proxy’ environment variable | ||
| 359 | (<http://bugs.gnu.org/20402>) | ||
| 360 | |||
| 361 | *** ‘--no-*’ options are now always correctly handled | ||
| 362 | (<http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00702.html>) | ||
| 363 | |||
| 364 | *** SLiM no longer leaks open file descriptors | ||
| 365 | |||
| 366 | *** Don't compare <pam-service> objects with 'equal?' | ||
| 367 | (<http://bugs.gnu.org/20037>) | ||
| 368 | |||
| 369 | *** x86_64 and i686 bootstrap binaries updated (<http://bugs.gnu.org/19780>) | ||
| 370 | |||
| 371 | *** ‘find-files’ no longer follows symlinks (<http://bugs.gnu.org/20081>) | ||
| 372 | |||
| 373 | *** libc message catalog (‘libc.mo’) is now installed | ||
| 374 | |||
| 375 | *** libstdc++ has appropriate RUNPATH (<http://bugs.gnu.org/20358>) | ||
| 376 | |||
| 377 | *** ‘dhcp-client-service’ now correctly tracks dhclient’s PID | ||
| 378 | |||
| 379 | ** Native language support | ||
| 380 | |||
| 381 | *** New translations: da (Danish) | ||
| 382 | |||
| 383 | *** Updated translations: eo | ||
| 384 | |||
| 13 | * Changes in 0.8.1 (since 0.8) | 385 | * Changes in 0.8.1 (since 0.8) |
| 14 | 386 | ||
| 15 | ** Package management | 387 | ** Package management |
| @@ -20,8 +20,9 @@ Guix is based on the [[http://nixos.org/nix/][Nix]] package manager. | |||
| 20 | 20 | ||
| 21 | GNU Guix currently depends on the following packages: | 21 | GNU Guix currently depends on the following packages: |
| 22 | 22 | ||
| 23 | - [[http://gnu.org/software/guile/][GNU Guile 2.0.x]], version 2.0.5 or later | 23 | - [[http://gnu.org/software/guile/][GNU Guile 2.0.x]], version 2.0.7 or later |
| 24 | - [[http://gnupg.org/][GNU libgcrypt]] | 24 | - [[http://gnupg.org/][GNU libgcrypt]] |
| 25 | - [[http://www.gnu.org/software/make/][GNU Make]] | ||
| 25 | - optionally [[http://savannah.nongnu.org/projects/guile-json/][Guile-JSON]], for the 'guix import pypi' command | 26 | - optionally [[http://savannah.nongnu.org/projects/guile-json/][Guile-JSON]], for the 'guix import pypi' command |
| 26 | - optionally [[http://www.gnutls.org][GnuTLS]] compiled with guile support enabled, for HTTPS support | 27 | - optionally [[http://www.gnutls.org][GnuTLS]] compiled with guile support enabled, for HTTPS support |
| 27 | in the 'guix download' command. Note that 'guix import pypi' requires | 28 | in the 'guix download' command. Note that 'guix import pypi' requires |
| @@ -53,18 +54,9 @@ file. | |||
| 53 | You can re-build and re-install Guix using a system that already runs Guix. | 54 | You can re-build and re-install Guix using a system that already runs Guix. |
| 54 | To do so: | 55 | To do so: |
| 55 | 56 | ||
| 56 | - Install the dependencies (see 'Requirements' above) and build tools using | 57 | - Start a shell with the development environment for Guix: |
| 57 | Guix: | ||
| 58 | 58 | ||
| 59 | guix package --install autoconf automake bzip2 gcc-toolchain gettext \ | 59 | guix environment guix |
| 60 | guile libgcrypt pkg-config sqlite | ||
| 61 | |||
| 62 | - Set the environment variables that Guix recommends you to set during the | ||
| 63 | package installation process: | ||
| 64 | ACLOCAL_PATH, CPATH, LIBRARY_PATH, PKG_CONFIG_PATH | ||
| 65 | |||
| 66 | - Set the PATH environment variable to refer to the profile: | ||
| 67 | PATH=$HOME/.guix-profile/bin:$PATH | ||
| 68 | 60 | ||
| 69 | - Re-run the 'configure' script passing it the option | 61 | - Re-run the 'configure' script passing it the option |
| 70 | '--with-libgcrypt-prefix=$HOME/.guix-profile/', as well as | 62 | '--with-libgcrypt-prefix=$HOME/.guix-profile/', as well as |
| @@ -35,6 +35,7 @@ infrastructure help: | |||
| 35 | Bruno Félix Rezende Ribeiro <oitofelix@gnu.org> | 35 | Bruno Félix Rezende Ribeiro <oitofelix@gnu.org> |
| 36 | Cyrill Schenkel <cyrill.schenkel@gmail.com> | 36 | Cyrill Schenkel <cyrill.schenkel@gmail.com> |
| 37 | Benno Schulenberg <coordinator@translationproject.org> | 37 | Benno Schulenberg <coordinator@translationproject.org> |
| 38 | Thomas Schwinge <thomas@codesourcery.com> | ||
| 38 | Alen Skondro <askondro@gmail.com> | 39 | Alen Skondro <askondro@gmail.com> |
| 39 | Matthias Wachs <wachs@net.in.tum.de> | 40 | Matthias Wachs <wachs@net.in.tum.de> |
| 40 | Andy Wingo <wingo@pobox.com> | 41 | Andy Wingo <wingo@pobox.com> |
diff --git a/build-aux/check-final-inputs-self-contained.scm b/build-aux/check-final-inputs-self-contained.scm index ba85c876d2b..9b791f2e2de 100644 --- a/build-aux/check-final-inputs-self-contained.scm +++ b/build-aux/check-final-inputs-self-contained.scm | |||
| @@ -77,5 +77,5 @@ refer to the bootstrap tools." | |||
| 77 | (set-build-options store #:use-substitutes? #t) | 77 | (set-build-options store #:use-substitutes? #t) |
| 78 | 78 | ||
| 79 | (for-each (cut test-final-inputs store <>) | 79 | (for-each (cut test-final-inputs store <>) |
| 80 | %supported-systems))) | 80 | %hydra-supported-systems))) |
| 81 | 81 | ||
diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm index c612ff1f124..83cc6fb1770 100644 --- a/build-aux/hydra/gnu-system.scm +++ b/build-aux/hydra/gnu-system.scm | |||
| @@ -78,10 +78,8 @@ | |||
| 78 | (license . ,(package-license package)) | 78 | (license . ,(package-license package)) |
| 79 | (home-page . ,(package-home-page package)) | 79 | (home-page . ,(package-home-page package)) |
| 80 | (maintainers . ("bug-guix@gnu.org")) | 80 | (maintainers . ("bug-guix@gnu.org")) |
| 81 | 81 | (timeout . ,(or (assoc-ref (package-properties package) 'timeout) | |
| 82 | ;; Work around versions of 'hydra-eval-guile-jobs' before Hydra commit | 82 | 72000)))) ; 20 hours by default |
| 83 | ;; 61448ca (27 Feb. 2014) which used a default timeout of 2h. | ||
| 84 | (timeout . 72000))) | ||
| 85 | 83 | ||
| 86 | (define (package-job store job-name package system) | 84 | (define (package-job store job-name package system) |
| 87 | "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." | 85 | "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." |
| @@ -159,7 +157,7 @@ system.") | |||
| 159 | (set-guile-for-build (default-guile)) | 157 | (set-guile-for-build (default-guile)) |
| 160 | (system-disk-image installation-os | 158 | (system-disk-image installation-os |
| 161 | #:disk-image-size | 159 | #:disk-image-size |
| 162 | (* 850 MiB)))))) | 160 | (* 860 MiB)))))) |
| 163 | '())) | 161 | '())) |
| 164 | 162 | ||
| 165 | (define (tarball-jobs store system) | 163 | (define (tarball-jobs store system) |
diff --git a/build-aux/hydra/guix.scm b/build-aux/hydra/guix.scm index 3996a0b422d..1035f81b4af 100644 --- a/build-aux/hydra/guix.scm +++ b/build-aux/hydra/guix.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -68,25 +68,10 @@ | |||
| 68 | (home-page . ,(package-home-page package)) | 68 | (home-page . ,(package-home-page package)) |
| 69 | (maintainers . ("bug-guix@gnu.org")))) | 69 | (maintainers . ("bug-guix@gnu.org")))) |
| 70 | 70 | ||
| 71 | (define (tarball-package checkout nix-checkout) | 71 | (define (tarball-package checkout) |
| 72 | "Return a package that does `make distcheck' from CHECKOUT, a directory | 72 | "Return a package that does `make distcheck' from CHECKOUT, a directory |
| 73 | containing a Git checkout of Guix." | 73 | containing a Git checkout of Guix." |
| 74 | (let ((dist (dist-package guix checkout))) | 74 | (dist-package guix checkout)) |
| 75 | (package (inherit dist) | ||
| 76 | (location (source-properties->location (current-source-location))) | ||
| 77 | (arguments (substitute-keyword-arguments (package-arguments dist) | ||
| 78 | ((#:phases p) | ||
| 79 | `(alist-cons-before | ||
| 80 | 'autoreconf 'set-nix-submodule | ||
| 81 | (lambda _ | ||
| 82 | ;; Tell Git to use the Nix checkout that Hydra gave us. | ||
| 83 | (zero? | ||
| 84 | (system* "git" "config" "submodule.nix-upstream.url" | ||
| 85 | ,nix-checkout))) | ||
| 86 | ,p)))) | ||
| 87 | (native-inputs `(("git" ,git) | ||
| 88 | ("graphviz" ,graphviz) | ||
| 89 | ,@(package-native-inputs dist)))))) | ||
| 90 | 75 | ||
| 91 | (define (hydra-jobs store arguments) | 76 | (define (hydra-jobs store arguments) |
| 92 | "Return Hydra jobs." | 77 | "Return Hydra jobs." |
| @@ -104,13 +89,9 @@ containing a Git checkout of Guix." | |||
| 104 | (define guix-checkout | 89 | (define guix-checkout |
| 105 | (assq-ref arguments 'guix)) | 90 | (assq-ref arguments 'guix)) |
| 106 | 91 | ||
| 107 | (define nix-checkout | 92 | (let ((guix (assq-ref guix-checkout 'file-name))) |
| 108 | (assq-ref arguments 'nix)) | 93 | (format (current-error-port) "using checkout ~s (~s)~%" |
| 109 | 94 | guix-checkout guix) | |
| 110 | (format (current-error-port) "using checkout ~s (Nix: ~s)~%" | ||
| 111 | guix-checkout nix-checkout) | ||
| 112 | (let ((guix (assq-ref guix-checkout 'file-name)) | ||
| 113 | (nix (assq-ref nix-checkout 'file-name))) | ||
| 114 | `((tarball . ,(cute package->alist store | 95 | `((tarball . ,(cute package->alist store |
| 115 | (tarball-package guix nix) | 96 | (tarball-package guix) |
| 116 | (%current-system)))))) | 97 | (%current-system)))))) |
diff --git a/build-aux/make-binary-tarball.scm b/build-aux/make-binary-tarball.scm index 0b5dbaf1dee..e12bec476c1 100644 --- a/build-aux/make-binary-tarball.scm +++ b/build-aux/make-binary-tarball.scm | |||
| @@ -27,9 +27,6 @@ | |||
| 27 | (gnu system install) | 27 | (gnu system install) |
| 28 | (ice-9 match)) | 28 | (ice-9 match)) |
| 29 | 29 | ||
| 30 | (define show-what-to-build* | ||
| 31 | (store-lift show-what-to-build)) | ||
| 32 | |||
| 33 | (define copy-file* | 30 | (define copy-file* |
| 34 | (lift2 copy-file %store-monad)) | 31 | (lift2 copy-file %store-monad)) |
| 35 | 32 | ||
diff --git a/config-daemon.ac b/config-daemon.ac index fb80c754c9c..f96cc8f7ac1 100644 --- a/config-daemon.ac +++ b/config-daemon.ac | |||
| @@ -5,9 +5,12 @@ AC_MSG_RESULT([$guix_build_daemon]) | |||
| 5 | 5 | ||
| 6 | dnl C++ environment. This macro must be used unconditionnaly. | 6 | dnl C++ environment. This macro must be used unconditionnaly. |
| 7 | AC_PROG_CXX | 7 | AC_PROG_CXX |
| 8 | AC_LANG([C++]) | ||
| 8 | 9 | ||
| 9 | if test "x$guix_build_daemon" = "xyes"; then | 10 | if test "x$guix_build_daemon" = "xyes"; then |
| 10 | 11 | ||
| 12 | GUIX_ASSERT_CXX11 | ||
| 13 | |||
| 11 | AC_PROG_RANLIB | 14 | AC_PROG_RANLIB |
| 12 | AC_CONFIG_HEADER([nix/config.h]) | 15 | AC_CONFIG_HEADER([nix/config.h]) |
| 13 | 16 | ||
| @@ -73,7 +76,7 @@ if test "x$guix_build_daemon" = "xyes"; then | |||
| 73 | 76 | ||
| 74 | dnl Chroot support. | 77 | dnl Chroot support. |
| 75 | AC_CHECK_FUNCS([chroot unshare]) | 78 | AC_CHECK_FUNCS([chroot unshare]) |
| 76 | AC_CHECK_HEADERS([sched.h sys/param.h sys/mount.h tr1/unordered_set]) | 79 | AC_CHECK_HEADERS([sched.h sys/param.h sys/mount.h sys/syscall.h]) |
| 77 | 80 | ||
| 78 | if test "x$ac_cv_func_chroot" != "xyes"; then | 81 | if test "x$ac_cv_func_chroot" != "xyes"; then |
| 79 | AC_MSG_ERROR(['chroot' function missing, bailing out]) | 82 | AC_MSG_ERROR(['chroot' function missing, bailing out]) |
diff --git a/configure.ac b/configure.ac index 5a9cea6fe2b..50b65fdac18 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Process this file with autoconf to produce a configure script. | 2 | # Process this file with autoconf to produce a configure script. |
| 3 | 3 | ||
| 4 | AC_PREREQ(2.68) | 4 | AC_PREREQ(2.68) |
| 5 | AC_INIT([GNU Guix], [0.8.2], [bug-guix@gnu.org], [guix], | 5 | AC_INIT([GNU Guix], [0.8.3], [bug-guix@gnu.org], [guix], |
| 6 | [http://www.gnu.org/software/guix/]) | 6 | [http://www.gnu.org/software/guix/]) |
| 7 | AC_CONFIG_AUX_DIR([build-aux]) | 7 | AC_CONFIG_AUX_DIR([build-aux]) |
| 8 | 8 | ||
| @@ -67,7 +67,7 @@ dnl Make sure they are available. | |||
| 67 | m4_pattern_forbid([PKG_CHECK_MODULES]) | 67 | m4_pattern_forbid([PKG_CHECK_MODULES]) |
| 68 | m4_pattern_forbid([GUILE_MODULE_AVAILABLE]) | 68 | m4_pattern_forbid([GUILE_MODULE_AVAILABLE]) |
| 69 | 69 | ||
| 70 | PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5]) | 70 | PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7]) |
| 71 | AC_PATH_PROG([GUILE], [guile]) | 71 | AC_PATH_PROG([GUILE], [guile]) |
| 72 | AC_PATH_PROG([GUILD], [guild]) | 72 | AC_PATH_PROG([GUILD], [guild]) |
| 73 | if test "x$GUILD" = "x"; then | 73 | if test "x$GUILD" = "x"; then |
| @@ -182,6 +182,9 @@ dnl `dot' (from the Graphviz package) is only needed for maintainers. | |||
| 182 | dnl See `HACKING' for more info. | 182 | dnl See `HACKING' for more info. |
| 183 | AM_MISSING_PROG([DOT], [dot]) | 183 | AM_MISSING_PROG([DOT], [dot]) |
| 184 | 184 | ||
| 185 | dnl Manual pages. | ||
| 186 | AM_MISSING_PROG([HELP2MAN], [help2man]) | ||
| 187 | |||
| 185 | AC_CONFIG_FILES([Makefile | 188 | AC_CONFIG_FILES([Makefile |
| 186 | po/guix/Makefile.in | 189 | po/guix/Makefile.in |
| 187 | po/packages/Makefile.in | 190 | po/packages/Makefile.in |
| @@ -25,8 +25,8 @@ CLEANFILES += $(BUILT_SOURCES) | |||
| 25 | 25 | ||
| 26 | noinst_LIBRARIES = libformat.a libutil.a libstore.a | 26 | noinst_LIBRARIES = libformat.a libutil.a libstore.a |
| 27 | 27 | ||
| 28 | # Use '-std=c++0x' for 'std::shared_ptr'. | 28 | # Use '-std=c++11' for 'std::shared_ptr', 'auto', lambdas, and more. |
| 29 | AM_CXXFLAGS = -Wall -std=c++0x | 29 | AM_CXXFLAGS = -Wall -std=c++11 |
| 30 | 30 | ||
| 31 | libformat_a_SOURCES = \ | 31 | libformat_a_SOURCES = \ |
| 32 | nix/boost/format/free_funcs.cc \ | 32 | nix/boost/format/free_funcs.cc \ |
| @@ -112,7 +112,8 @@ libstore_a_CPPFLAGS = \ | |||
| 112 | -DNIX_CONF_DIR=\"$(sysconfdir)/guix\" \ | 112 | -DNIX_CONF_DIR=\"$(sysconfdir)/guix\" \ |
| 113 | -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ | 113 | -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ |
| 114 | -DNIX_BIN_DIR=\"$(bindir)\" \ | 114 | -DNIX_BIN_DIR=\"$(bindir)\" \ |
| 115 | -DOPENSSL_PATH="\"guix-authenticate\"" | 115 | -DOPENSSL_PATH="\"guix-authenticate\"" \ |
| 116 | -DDEFAULT_CHROOT_DIRS="\"\"" | ||
| 116 | 117 | ||
| 117 | libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \ | 118 | libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \ |
| 118 | $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) | 119 | $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) |
| @@ -125,6 +126,7 @@ guix_daemon_SOURCES = \ | |||
| 125 | nix/nix-daemon/guix-daemon.cc | 126 | nix/nix-daemon/guix-daemon.cc |
| 126 | 127 | ||
| 127 | guix_daemon_CPPFLAGS = \ | 128 | guix_daemon_CPPFLAGS = \ |
| 129 | -DLOCALEDIR=\"$(localedir)\" \ | ||
| 128 | $(libutil_a_CPPFLAGS) \ | 130 | $(libutil_a_CPPFLAGS) \ |
| 129 | -I$(top_srcdir)/nix/libstore | 131 | -I$(top_srcdir)/nix/libstore |
| 130 | 132 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | # GNU Guix --- Functional package management for GNU | 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | # Copyright © 2013 Andreas Enge <andreas@enge.fr> | 3 | # Copyright © 2013 Andreas Enge <andreas@enge.fr> |
| 4 | # | 4 | # |
| 5 | # This file is part of GNU Guix. | 5 | # This file is part of GNU Guix. |
| @@ -25,12 +25,16 @@ EXTRA_DIST += \ | |||
| 25 | doc/images/bootstrap-graph.eps \ | 25 | doc/images/bootstrap-graph.eps \ |
| 26 | doc/images/bootstrap-graph.pdf | 26 | doc/images/bootstrap-graph.pdf |
| 27 | 27 | ||
| 28 | OS_CONFIG_EXAMPLES_TEXI = \ | ||
| 29 | doc/os-config-bare-bones.texi \ | ||
| 30 | doc/os-config-desktop.texi | ||
| 31 | |||
| 28 | # Bundle this file so that makeinfo finds it in out-of-source-tree builds. | 32 | # Bundle this file so that makeinfo finds it in out-of-source-tree builds. |
| 29 | BUILT_SOURCES += doc/os-config.texi | 33 | BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) |
| 30 | EXTRA_DIST += doc/os-config.texi | 34 | EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) |
| 31 | MAINTAINERCLEANFILES = doc/os-config.texi | 35 | MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) |
| 32 | 36 | ||
| 33 | doc/os-config.texi: gnu/system/os-config.tmpl | 37 | doc/os-config-%.texi: gnu/system/examples/%.tmpl |
| 34 | $(MKDIR_P) "`dirname "$@"`" | 38 | $(MKDIR_P) "`dirname "$@"`" |
| 35 | cp "$<" "$@" | 39 | cp "$<" "$@" |
| 36 | 40 | ||
| @@ -61,3 +65,45 @@ DOT_OPTIONS = \ | |||
| 61 | pdf-local: $(top_srcdir)/doc/images/bootstrap-graph.pdf | 65 | pdf-local: $(top_srcdir)/doc/images/bootstrap-graph.pdf |
| 62 | info-local: $(top_srcdir)/doc/images/bootstrap-graph.png | 66 | info-local: $(top_srcdir)/doc/images/bootstrap-graph.png |
| 63 | ps-local: $(top_srcdir)/doc/images/bootstrap-graph.eps | 67 | ps-local: $(top_srcdir)/doc/images/bootstrap-graph.eps |
| 68 | |||
| 69 | |||
| 70 | # Manual pages. | ||
| 71 | |||
| 72 | doc/guix.1: scripts/guix | ||
| 73 | -LANGUAGE= $(top_builddir)/pre-inst-env \ | ||
| 74 | $(HELP2MAN) --output="$@" guix | ||
| 75 | |||
| 76 | doc/guix-daemon.1: guix-daemon | ||
| 77 | -LANGUAGE= $(top_builddir)/pre-inst-env \ | ||
| 78 | $(HELP2MAN) --output="$@" guix-daemon | ||
| 79 | |||
| 80 | define subcommand-manual-target | ||
| 81 | |||
| 82 | doc/guix-$(1).1: scripts/guix guix/scripts/$(1).go | ||
| 83 | -LANGUAGE= $(top_builddir)/pre-inst-env \ | ||
| 84 | $(HELP2MAN) --output="$$@" "guix $(1)" | ||
| 85 | |||
| 86 | endef | ||
| 87 | |||
| 88 | SUBCOMMANDS := \ | ||
| 89 | archive \ | ||
| 90 | build \ | ||
| 91 | download \ | ||
| 92 | environment \ | ||
| 93 | gc \ | ||
| 94 | hash \ | ||
| 95 | import \ | ||
| 96 | lint \ | ||
| 97 | package \ | ||
| 98 | publish \ | ||
| 99 | pull \ | ||
| 100 | refresh \ | ||
| 101 | system | ||
| 102 | |||
| 103 | $(eval $(foreach subcommand,$(SUBCOMMANDS), \ | ||
| 104 | $(call subcommand-manual-target,$(subcommand)))) | ||
| 105 | |||
| 106 | dist_man1_MANS = \ | ||
| 107 | doc/guix.1 \ | ||
| 108 | doc/guix-daemon.1 \ | ||
| 109 | $(SUBCOMMANDS:%=doc/guix-%.1) | ||
diff --git a/doc/emacs.texi b/doc/emacs.texi index 93d0c86b420..17682c3a51d 100644 --- a/doc/emacs.texi +++ b/doc/emacs.texi | |||
| @@ -19,6 +19,7 @@ guix package}). Specifically, ``guix.el'' makes it easy to: | |||
| 19 | * Usage: Emacs Usage. Using the interface. | 19 | * Usage: Emacs Usage. Using the interface. |
| 20 | * Configuration: Emacs Configuration. Configuring the interface. | 20 | * Configuration: Emacs Configuration. Configuring the interface. |
| 21 | * Prettify Mode: Emacs Prettify. Abbreviating @file{/gnu/store/@dots{}} file names. | 21 | * Prettify Mode: Emacs Prettify. Abbreviating @file{/gnu/store/@dots{}} file names. |
| 22 | * Completions: Emacs Completions. Completing @command{guix} shell command. | ||
| 22 | @end menu | 23 | @end menu |
| 23 | 24 | ||
| 24 | @node Emacs Initial Setup | 25 | @node Emacs Initial Setup |
| @@ -29,7 +30,7 @@ is ready to use, provided Guix is installed system-wide, which is the | |||
| 29 | case by default. So if that is what you're using, you can happily skip | 30 | case by default. So if that is what you're using, you can happily skip |
| 30 | this section and read about the fun stuff. | 31 | this section and read about the fun stuff. |
| 31 | 32 | ||
| 32 | If you're not yet a happy user of GSD, a little bit of setup is needed. | 33 | If you're not yet a happy user of GuixSD, a little bit of setup is needed. |
| 33 | To be able to use ``guix.el'', you need to install the following | 34 | To be able to use ``guix.el'', you need to install the following |
| 34 | packages: | 35 | packages: |
| 35 | 36 | ||
| @@ -44,23 +45,49 @@ used for interacting with the Guile process. | |||
| 44 | 45 | ||
| 45 | @end itemize | 46 | @end itemize |
| 46 | 47 | ||
| 47 | When it is done, add the following into your init file (@pxref{Init | 48 | When it is done ``guix.el'' may be configured by requiring a special |
| 48 | File,,, emacs, The GNU Emacs Manual}): | 49 | @code{guix-init} file---i.e., by adding the following code into your |
| 50 | init file (@pxref{Init File,,, emacs, The GNU Emacs Manual}): | ||
| 49 | 51 | ||
| 50 | @example | 52 | @example |
| 53 | (add-to-list 'load-path "/path/to/directory-with-guix.el") | ||
| 51 | (require 'guix-init nil t) | 54 | (require 'guix-init nil t) |
| 52 | @end example | 55 | @end example |
| 53 | 56 | ||
| 54 | However there is a chance that @code{load-path} of your Emacs does not | 57 | So the only thing you need to figure out is where the directory with |
| 55 | contain a directory with ``guix.el'' (usually it is | 58 | elisp files for Guix is placed. It depends on how you installed Guix: |
| 56 | @file{/usr/share/emacs/site-lisp/}). In that case you need to add it | 59 | |
| 57 | before requiring (@pxref{Lisp Libraries,,, emacs, The GNU Emacs | 60 | @itemize |
| 58 | Manual}): | 61 | @item |
| 62 | If it was installed by a package manager of your distribution or by a | ||
| 63 | usual @code{./configure && make && make install} command sequence, then | ||
| 64 | elisp files are placed in a standard directory with Emacs packages | ||
| 65 | (usually it is @file{/usr/share/emacs/site-lisp/}), which is already in | ||
| 66 | @code{load-path}, so there is no need to add that directory there. | ||
| 67 | |||
| 68 | @item | ||
| 69 | If you used a binary installation method (@pxref{Binary Installation}), | ||
| 70 | then Guix is installed somewhere in the store, so the elisp files are | ||
| 71 | placed in @file{/gnu/store/@dots{}-guix-0.8.2/share/emacs/site-lisp/} or | ||
| 72 | alike. However it is not recommended to refer directly to a store | ||
| 73 | directory. Instead you can install Guix using Guix itself with | ||
| 74 | @command{guix package -i guix} command (@pxref{Invoking guix package}) | ||
| 75 | and add @file{~/.guix-profile/share/emacs/site-lisp/} directory to | ||
| 76 | @code{load-path} variable. | ||
| 77 | |||
| 78 | @item | ||
| 79 | If you did not install Guix at all and prefer a hacking way | ||
| 80 | (@pxref{Running Guix Before It Is Installed}), along with augmenting | ||
| 81 | @code{load-path} you need to set @code{guix-load-path} variable to the | ||
| 82 | same directory, so your final configuration will look like this: | ||
| 59 | 83 | ||
| 60 | @example | 84 | @example |
| 61 | (add-to-list 'load-path "/path/to/directory-with-guix.el") | 85 | (let ((dir "/path/to/your-guix-git-tree/emacs")) |
| 62 | (require 'guix-init) | 86 | (add-to-list 'load-path dir) |
| 87 | (setq guix-load-path dir)) | ||
| 88 | (require 'guix-init nil t) | ||
| 63 | @end example | 89 | @end example |
| 90 | @end itemize | ||
| 64 | 91 | ||
| 65 | By default, along with autoloading (@pxref{Autoload,,, elisp, The GNU | 92 | By default, along with autoloading (@pxref{Autoload,,, elisp, The GNU |
| 66 | Emacs Lisp Reference Manual}) the main interactive commands for | 93 | Emacs Lisp Reference Manual}) the main interactive commands for |
| @@ -183,6 +210,11 @@ packages/generations and redisplay it. | |||
| 183 | @item R | 210 | @item R |
| 184 | Redisplay current buffer (without updating information). | 211 | Redisplay current buffer (without updating information). |
| 185 | 212 | ||
| 213 | @item M | ||
| 214 | Apply manifest to the current profile or to a specified profile, if | ||
| 215 | prefix argument is used. This has the same meaning as @code{--manifest} | ||
| 216 | option (@pxref{Invoking guix package}). | ||
| 217 | |||
| 186 | @item C-c C-z | 218 | @item C-c C-z |
| 187 | Go to the Guix REPL (@pxref{The REPL,,, geiser, Geiser User Manual}). | 219 | Go to the Guix REPL (@pxref{The REPL,,, geiser, Geiser User Manual}). |
| 188 | 220 | ||
| @@ -213,9 +245,7 @@ Default key bindings available for both ``package-list'' and | |||
| 213 | 245 | ||
| 214 | @table @kbd | 246 | @table @kbd |
| 215 | @item m | 247 | @item m |
| 216 | Mark the current entry. | 248 | Mark the current entry (with prefix, mark all entries). |
| 217 | @item M | ||
| 218 | Mark all entries. | ||
| 219 | @item u | 249 | @item u |
| 220 | Unmark the current entry (with prefix, unmark all entries). | 250 | Unmark the current entry (with prefix, unmark all entries). |
| 221 | @item @key{DEL} | 251 | @item @key{DEL} |
| @@ -486,3 +516,34 @@ mode hooks (@pxref{Hooks,,, emacs, The GNU Emacs Manual}), for example: | |||
| 486 | (add-hook 'shell-mode-hook 'guix-prettify-mode) | 516 | (add-hook 'shell-mode-hook 'guix-prettify-mode) |
| 487 | (add-hook 'dired-mode-hook 'guix-prettify-mode) | 517 | (add-hook 'dired-mode-hook 'guix-prettify-mode) |
| 488 | @end example | 518 | @end example |
| 519 | |||
| 520 | |||
| 521 | @node Emacs Completions | ||
| 522 | @subsection Shell Completions | ||
| 523 | |||
| 524 | Another feature that becomes available after configuring Emacs interface | ||
| 525 | (@pxref{Emacs Initial Setup}) is completing of @command{guix} | ||
| 526 | subcommands, options, packages and other things in @code{shell} | ||
| 527 | (@pxref{Interactive Shell,,, emacs, The GNU Emacs Manual}) and | ||
| 528 | @code{eshell} (@pxref{Top,,, eshell, Eshell: The Emacs Shell}). | ||
| 529 | |||
| 530 | It works the same way as other completions do. Just press @key{TAB} | ||
| 531 | when your intuition tells you. | ||
| 532 | |||
| 533 | And here are some examples, where pressing @key{TAB} may complete | ||
| 534 | something: | ||
| 535 | |||
| 536 | @itemize @w{} | ||
| 537 | |||
| 538 | @item @code{guix pa}@key{TAB} | ||
| 539 | @item @code{guix package -}@key{TAB} | ||
| 540 | @item @code{guix package --}@key{TAB} | ||
| 541 | @item @code{guix package -i gei}@key{TAB} | ||
| 542 | @item @code{guix build -L/tm}@key{TAB} | ||
| 543 | @item @code{guix build --sy}@key{TAB} | ||
| 544 | @item @code{guix build --system=i}@key{TAB} | ||
| 545 | @item @code{guix system rec}@key{TAB} | ||
| 546 | @item @code{guix lint --checkers=sy}@key{TAB} | ||
| 547 | @item @code{guix lint --checkers=synopsis,des}@key{TAB} | ||
| 548 | |||
| 549 | @end itemize | ||
diff --git a/doc/guix.texi b/doc/guix.texi index dd6af809654..be7a292f084 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -12,7 +12,8 @@ | |||
| 12 | @copying | 12 | @copying |
| 13 | Copyright @copyright{} 2012, 2013, 2014, 2015 Ludovic Courtès@* | 13 | Copyright @copyright{} 2012, 2013, 2014, 2015 Ludovic Courtès@* |
| 14 | Copyright @copyright{} 2013, 2014 Andreas Enge@* | 14 | Copyright @copyright{} 2013, 2014 Andreas Enge@* |
| 15 | Copyright @copyright{} 2013 Nikita Karetnikov | 15 | Copyright @copyright{} 2013 Nikita Karetnikov@* |
| 16 | Copyright @copyright{} 2015 Taylan Ulrich Bayırlı/Kammer | ||
| 16 | 17 | ||
| 17 | Permission is granted to copy, distribute and/or modify this document | 18 | Permission is granted to copy, distribute and/or modify this document |
| 18 | under the terms of the GNU Free Documentation License, Version 1.3 or | 19 | under the terms of the GNU Free Documentation License, Version 1.3 or |
| @@ -82,10 +83,12 @@ package management tool written for the GNU system. | |||
| 82 | 83 | ||
| 83 | Installation | 84 | Installation |
| 84 | 85 | ||
| 86 | * Binary Installation:: Getting Guix running in no time! | ||
| 85 | * Requirements:: Software needed to build and run Guix. | 87 | * Requirements:: Software needed to build and run Guix. |
| 86 | * Running the Test Suite:: Testing Guix. | 88 | * Running the Test Suite:: Testing Guix. |
| 87 | * Setting Up the Daemon:: Preparing the build daemon's environment. | 89 | * Setting Up the Daemon:: Preparing the build daemon's environment. |
| 88 | * Invoking guix-daemon:: Running the build daemon. | 90 | * Invoking guix-daemon:: Running the build daemon. |
| 91 | * Running Guix Before It Is Installed:: Hacker tricks. | ||
| 89 | 92 | ||
| 90 | Setting Up the Daemon | 93 | Setting Up the Daemon |
| 91 | 94 | ||
| @@ -112,6 +115,11 @@ Programming Interface | |||
| 112 | * The Store Monad:: Purely functional interface to the store. | 115 | * The Store Monad:: Purely functional interface to the store. |
| 113 | * G-Expressions:: Manipulating build expressions. | 116 | * G-Expressions:: Manipulating build expressions. |
| 114 | 117 | ||
| 118 | Defining Packages | ||
| 119 | |||
| 120 | * package Reference:: The package data type. | ||
| 121 | * origin Reference:: The origin data type. | ||
| 122 | |||
| 115 | Utilities | 123 | Utilities |
| 116 | 124 | ||
| 117 | * Invoking guix build:: Building packages from the command line. | 125 | * Invoking guix build:: Building packages from the command line. |
| @@ -144,6 +152,7 @@ System Configuration | |||
| 144 | * Locales:: Language and cultural convention settings. | 152 | * Locales:: Language and cultural convention settings. |
| 145 | * Services:: Specifying system services. | 153 | * Services:: Specifying system services. |
| 146 | * Setuid Programs:: Programs running with root privileges. | 154 | * Setuid Programs:: Programs running with root privileges. |
| 155 | * X.509 Certificates:: Authenticating HTTPS servers. | ||
| 147 | * Name Service Switch:: Configuring libc's name service switch. | 156 | * Name Service Switch:: Configuring libc's name service switch. |
| 148 | * Initial RAM Disk:: Linux-Libre bootstrapping. | 157 | * Initial RAM Disk:: Linux-Libre bootstrapping. |
| 149 | * GRUB Configuration:: Configuring the boot loader. | 158 | * GRUB Configuration:: Configuring the boot loader. |
| @@ -155,6 +164,8 @@ Services | |||
| 155 | * Base Services:: Essential system services. | 164 | * Base Services:: Essential system services. |
| 156 | * Networking Services:: Network setup, SSH daemon, etc. | 165 | * Networking Services:: Network setup, SSH daemon, etc. |
| 157 | * X Window:: Graphical display. | 166 | * X Window:: Graphical display. |
| 167 | * Desktop Services:: D-Bus and desktop services. | ||
| 168 | * Database Services:: SQL databases. | ||
| 158 | * Various Services:: Other services. | 169 | * Various Services:: Other services. |
| 159 | 170 | ||
| 160 | Packaging Guidelines | 171 | Packaging Guidelines |
| @@ -213,11 +224,11 @@ Guix has a command-line interface, which allows users to build, install, | |||
| 213 | upgrade, and remove packages, as well as a Scheme programming interface. | 224 | upgrade, and remove packages, as well as a Scheme programming interface. |
| 214 | 225 | ||
| 215 | @cindex Guix System Distribution | 226 | @cindex Guix System Distribution |
| 216 | @cindex GSD | 227 | @cindex GuixSD |
| 217 | Last but not least, Guix is used to build a distribution of the GNU | 228 | Last but not least, Guix is used to build a distribution of the GNU |
| 218 | system, with many GNU and non-GNU free software packages. The Guix | 229 | system, with many GNU and non-GNU free software packages. The Guix |
| 219 | System Distribution, or GNU@tie{}GSD, takes advantage of the core | 230 | System Distribution, or GNU@tie{}GuixSD, takes advantage of the core |
| 220 | properties of Guix at the system level. With GNU@tie{}GSD, users | 231 | properties of Guix at the system level. With GuixSD, users |
| 221 | @emph{declare} all aspects of the operating system configuration, and | 232 | @emph{declare} all aspects of the operating system configuration, and |
| 222 | Guix takes care of instantiating that configuration in a reproducible, | 233 | Guix takes care of instantiating that configuration in a reproducible, |
| 223 | stateless fashion. @xref{GNU Distribution}. | 234 | stateless fashion. @xref{GNU Distribution}. |
| @@ -242,6 +253,7 @@ instead, you want to install the complete GNU operating system, | |||
| 242 | * Running the Test Suite:: Testing Guix. | 253 | * Running the Test Suite:: Testing Guix. |
| 243 | * Setting Up the Daemon:: Preparing the build daemon's environment. | 254 | * Setting Up the Daemon:: Preparing the build daemon's environment. |
| 244 | * Invoking guix-daemon:: Running the build daemon. | 255 | * Invoking guix-daemon:: Running the build daemon. |
| 256 | * Running Guix Before It Is Installed:: Hacker tricks. | ||
| 245 | @end menu | 257 | @end menu |
| 246 | 258 | ||
| 247 | @node Binary Installation | 259 | @node Binary Installation |
| @@ -258,7 +270,7 @@ Installing goes along these lines: | |||
| 258 | @enumerate | 270 | @enumerate |
| 259 | @item | 271 | @item |
| 260 | Download the binary tarball from | 272 | Download the binary tarball from |
| 261 | @code{ftp://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz}@footnote{As | 273 | @indicateurl{ftp://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz}@footnote{As |
| 262 | usual, make sure to download the associated @file{.sig} file and to | 274 | usual, make sure to download the associated @file{.sig} file and to |
| 263 | verify the authenticity of the tarball against it!}, where @var{system} | 275 | verify the authenticity of the tarball against it!}, where @var{system} |
| 264 | is @code{x86_64-linux} for an @code{x86_64} machine already running the | 276 | is @code{x86_64-linux} for an @code{x86_64} machine already running the |
| @@ -268,23 +280,31 @@ kernel Linux, and so on. | |||
| 268 | As @code{root}, run: | 280 | As @code{root}, run: |
| 269 | 281 | ||
| 270 | @example | 282 | @example |
| 271 | # cd / | 283 | # cd /tmp |
| 272 | # tar xf guix-binary-@value{VERSION}.@var{system}.tar.xz | 284 | # tar xf guix-binary-@value{VERSION}.@var{system}.tar.xz |
| 285 | # mv var/guix /var/ && mv gnu / | ||
| 273 | @end example | 286 | @end example |
| 274 | 287 | ||
| 275 | This creates @file{/gnu/store} (@pxref{The Store}), @file{/var/guix}, | 288 | This creates @file{/gnu/store} (@pxref{The Store}) and @file{/var/guix}. |
| 276 | and @file{/root/.guix-profile}. @file{/root/.guix-profile} is a | 289 | The latter contains a ready-to-use profile for @code{root} (see next |
| 277 | ready-to-use profile for @code{root} where Guix is installed. | 290 | step.) |
| 278 | 291 | ||
| 279 | Do @emph{not} unpack the tarball on a working Guix system since that | 292 | Do @emph{not} unpack the tarball on a working Guix system since that |
| 280 | would overwrite its own essential files. | 293 | would overwrite its own essential files. |
| 281 | 294 | ||
| 282 | @item | 295 | @item |
| 283 | Set up the daemon as explained below (@pxref{Setting Up the Daemon}), and | 296 | Make @code{root}'s profile available under @file{~/.guix-profile}: |
| 284 | run it: | 297 | |
| 298 | @example | ||
| 299 | # ln -sf /var/guix/profiles/per-user/root/guix-profile \ | ||
| 300 | ~root/.guix-profile | ||
| 301 | @end example | ||
| 302 | |||
| 303 | @item | ||
| 304 | Run the daemon: | ||
| 285 | 305 | ||
| 286 | @example | 306 | @example |
| 287 | # /root/.guix-profile/bin/guix-daemon --build-users-group=guix-builder | 307 | # ~root/.guix-profile/bin/guix-daemon --build-users-group=guixbuild |
| 288 | @end example | 308 | @end example |
| 289 | 309 | ||
| 290 | @item | 310 | @item |
| @@ -294,7 +314,15 @@ for instance with: | |||
| 294 | @example | 314 | @example |
| 295 | # mkdir -p /usr/local/bin | 315 | # mkdir -p /usr/local/bin |
| 296 | # cd /usr/local/bin | 316 | # cd /usr/local/bin |
| 297 | # ln -s /root/.guix-profile/bin/guix | 317 | # ln -s /var/guix/profiles/per-user/root/guix-profile/bin/guix |
| 318 | @end example | ||
| 319 | |||
| 320 | @item | ||
| 321 | To use substitutes from @code{hydra.gnu.org} (@pxref{Substitutes}), | ||
| 322 | authorize them: | ||
| 323 | |||
| 324 | @example | ||
| 325 | # guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub | ||
| 298 | @end example | 326 | @end example |
| 299 | @end enumerate | 327 | @end enumerate |
| 300 | 328 | ||
| @@ -305,8 +333,8 @@ profile, or it would become subject to garbage collection---in which | |||
| 305 | case you would find yourself badly handicapped by the lack of the | 333 | case you would find yourself badly handicapped by the lack of the |
| 306 | @command{guix} command. | 334 | @command{guix} command. |
| 307 | 335 | ||
| 308 | The tarball in question can be (re)produced simply by running the | 336 | The tarball in question can be (re)produced and verified simply by |
| 309 | following command in the Guix source tree: | 337 | running the following command in the Guix source tree: |
| 310 | 338 | ||
| 311 | @example | 339 | @example |
| 312 | make guix-binary.@var{system}.tar.xz | 340 | make guix-binary.@var{system}.tar.xz |
| @@ -324,8 +352,9 @@ in the Guix source tree for additional details. | |||
| 324 | GNU Guix depends on the following packages: | 352 | GNU Guix depends on the following packages: |
| 325 | 353 | ||
| 326 | @itemize | 354 | @itemize |
| 327 | @item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.5 or later; | 355 | @item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.7 or later; |
| 328 | @item @url{http://gnupg.org/, GNU libgcrypt}; | 356 | @item @url{http://gnupg.org/, GNU libgcrypt}; |
| 357 | @item @url{http://www.gnu.org/software/make/, GNU Make}. | ||
| 329 | @end itemize | 358 | @end itemize |
| 330 | 359 | ||
| 331 | The following dependencies are optional: | 360 | The following dependencies are optional: |
| @@ -350,9 +379,10 @@ Unless @code{--disable-daemon} was passed to @command{configure}, the | |||
| 350 | following packages are also needed: | 379 | following packages are also needed: |
| 351 | 380 | ||
| 352 | @itemize | 381 | @itemize |
| 353 | @item @url{http://sqlite.org, SQLite 3} | 382 | @item @url{http://sqlite.org, SQLite 3}; |
| 354 | @item @url{http://www.bzip.org, libbz2} | 383 | @item @url{http://www.bzip.org, libbz2}; |
| 355 | @item @url{http://gcc.gnu.org, GCC's g++} | 384 | @item @url{http://gcc.gnu.org, GCC's g++}, with support for the |
| 385 | C++11 standard. | ||
| 356 | @end itemize | 386 | @end itemize |
| 357 | 387 | ||
| 358 | When a working installation of @url{http://nixos.org/nix/, the Nix package | 388 | When a working installation of @url{http://nixos.org/nix/, the Nix package |
| @@ -446,27 +476,30 @@ Bash syntax and the @code{shadow} commands): | |||
| 446 | @c See http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00239.html | 476 | @c See http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00239.html |
| 447 | @c for why `-G' is needed. | 477 | @c for why `-G' is needed. |
| 448 | @example | 478 | @example |
| 449 | # groupadd guix-builder | 479 | # groupadd --system guixbuild |
| 450 | # for i in `seq 1 10`; | 480 | # for i in `seq -w 1 10`; |
| 451 | do | 481 | do |
| 452 | useradd -g guix-builder -G guix-builder \ | 482 | useradd -g guixbuild -G guixbuild \ |
| 453 | -d /var/empty -s `which nologin` \ | 483 | -d /var/empty -s `which nologin` \ |
| 454 | -c "Guix build user $i" --system \ | 484 | -c "Guix build user $i" --system \ |
| 455 | guix-builder$i; | 485 | guixbuilder$i; |
| 456 | done | 486 | done |
| 457 | @end example | 487 | @end example |
| 458 | 488 | ||
| 459 | @noindent | 489 | @noindent |
| 490 | The number of build users determines how many build jobs may run in | ||
| 491 | parallel, as specified by the @option{--max-jobs} option | ||
| 492 | (@pxref{Invoking guix-daemon, @option{--max-jobs}}). | ||
| 460 | The @code{guix-daemon} program may then be run as @code{root} with: | 493 | The @code{guix-daemon} program may then be run as @code{root} with: |
| 461 | 494 | ||
| 462 | @example | 495 | @example |
| 463 | # guix-daemon --build-users-group=guix-builder | 496 | # guix-daemon --build-users-group=guixbuild |
| 464 | @end example | 497 | @end example |
| 465 | 498 | ||
| 466 | @cindex chroot | 499 | @cindex chroot |
| 467 | @noindent | 500 | @noindent |
| 468 | This way, the daemon starts build processes in a chroot, under one of | 501 | This way, the daemon starts build processes in a chroot, under one of |
| 469 | the @code{guix-builder} users. On GNU/Linux, by default, the chroot | 502 | the @code{guixbuilder} users. On GNU/Linux, by default, the chroot |
| 470 | environment contains nothing but: | 503 | environment contains nothing but: |
| 471 | 504 | ||
| 472 | @c Keep this list in sync with libstore/build.cc! ----------------------- | 505 | @c Keep this list in sync with libstore/build.cc! ----------------------- |
| @@ -496,12 +529,13 @@ user @file{nobody}; | |||
| 496 | a writable @file{/tmp} directory. | 529 | a writable @file{/tmp} directory. |
| 497 | @end itemize | 530 | @end itemize |
| 498 | 531 | ||
| 499 | If you are installing Guix as an unprivileged user, it is still | 532 | If you are installing Guix as an unprivileged user, it is still possible |
| 500 | possible to run @command{guix-daemon}. However, build processes will | 533 | to run @command{guix-daemon} provided you pass @code{--disable-chroot}. |
| 501 | not be isolated from one another, and not from the rest of the system. | 534 | However, build processes will not be isolated from one another, and not |
| 502 | Thus, build processes may interfere with each other, and may access | 535 | from the rest of the system. Thus, build processes may interfere with |
| 503 | programs, libraries, and other files available on the system---making it | 536 | each other, and may access programs, libraries, and other files |
| 504 | much harder to view them as @emph{pure} functions. | 537 | available on the system---making it much harder to view them as |
| 538 | @emph{pure} functions. | ||
| 505 | 539 | ||
| 506 | 540 | ||
| 507 | @node Daemon Offload Setup | 541 | @node Daemon Offload Setup |
| @@ -628,7 +662,7 @@ garbage collector, querying the availability of a build result, etc. It | |||
| 628 | is normally run as @code{root} like this: | 662 | is normally run as @code{root} like this: |
| 629 | 663 | ||
| 630 | @example | 664 | @example |
| 631 | # guix-daemon --build-users-group=guix-builder | 665 | # guix-daemon --build-users-group=guixbuild |
| 632 | @end example | 666 | @end example |
| 633 | 667 | ||
| 634 | @noindent | 668 | @noindent |
| @@ -686,7 +720,7 @@ remote procedure call (@pxref{The Store}). | |||
| 686 | 720 | ||
| 687 | @item --substitute-urls=@var{urls} | 721 | @item --substitute-urls=@var{urls} |
| 688 | Consider @var{urls} the default whitespace-separated list of substitute | 722 | Consider @var{urls} the default whitespace-separated list of substitute |
| 689 | source URLs. When this option is omitted, @code{http://hydra.gnu.org} | 723 | source URLs. When this option is omitted, @indicateurl{http://hydra.gnu.org} |
| 690 | is used. | 724 | is used. |
| 691 | 725 | ||
| 692 | This means that substitutes may be downloaded from @var{urls}, as long | 726 | This means that substitutes may be downloaded from @var{urls}, as long |
| @@ -743,7 +777,9 @@ needs. | |||
| 743 | Disable chroot builds. | 777 | Disable chroot builds. |
| 744 | 778 | ||
| 745 | Using this option is not recommended since, again, it would allow build | 779 | Using this option is not recommended since, again, it would allow build |
| 746 | processes to gain access to undeclared dependencies. | 780 | processes to gain access to undeclared dependencies. It is necessary, |
| 781 | though, when @command{guix-daemon} is running under an unprivileged user | ||
| 782 | account. | ||
| 747 | 783 | ||
| 748 | @item --disable-log-compression | 784 | @item --disable-log-compression |
| 749 | Disable compression of the build logs. | 785 | Disable compression of the build logs. |
| @@ -811,6 +847,44 @@ useful in exceptional circumstances, such as if you need to run several | |||
| 811 | daemons on the same machine. | 847 | daemons on the same machine. |
| 812 | @end table | 848 | @end table |
| 813 | 849 | ||
| 850 | @node Running Guix Before It Is Installed | ||
| 851 | @section Running Guix Before It Is Installed | ||
| 852 | |||
| 853 | If you are hacking Guix itself---which is a good idea!---you will find | ||
| 854 | it useful to test the changes made in your local source tree checkout | ||
| 855 | without actually installing them. | ||
| 856 | |||
| 857 | To that end, all the command-line tools can be used even if you have not | ||
| 858 | run @command{make install}. To do that, prefix each command with | ||
| 859 | @command{./pre-inst-env} (the @file{pre-inst-env} script lives in the | ||
| 860 | top build tree of Guix), as in: | ||
| 861 | |||
| 862 | @example | ||
| 863 | $ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild | ||
| 864 | $ ./pre-inst-env guix build hello | ||
| 865 | @end example | ||
| 866 | |||
| 867 | @noindent | ||
| 868 | Similarly, for a Guile session using the Guix modules: | ||
| 869 | |||
| 870 | @example | ||
| 871 | $ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' | ||
| 872 | @end example | ||
| 873 | |||
| 874 | The @command{pre-inst-env} script sets up all the environment variables | ||
| 875 | necessary to support this, including @code{PATH} and | ||
| 876 | @code{GUILE_LOAD_PATH}. | ||
| 877 | |||
| 878 | If you are hacking Guix from Emacs using the wonderful Geiser | ||
| 879 | (@pxref{Introduction,,, geiser, Geiser User Manual}), make sure to | ||
| 880 | augment Guile's load path so that it finds source files from your | ||
| 881 | checkout: | ||
| 882 | |||
| 883 | @lisp | ||
| 884 | ;; Assuming the Guix checkout is in ~/src/guix. | ||
| 885 | (add-to-list 'geiser-guile-load-path "~/src/guix") | ||
| 886 | @end lisp | ||
| 887 | |||
| 814 | 888 | ||
| 815 | @c ********************************************************************* | 889 | @c ********************************************************************* |
| 816 | @node Package Management | 890 | @node Package Management |
| @@ -927,7 +1001,7 @@ guix package @var{options} | |||
| 927 | 1001 | ||
| 928 | Primarily, @var{options} specifies the operations to be performed during | 1002 | Primarily, @var{options} specifies the operations to be performed during |
| 929 | the transaction. Upon completion, a new profile is created, but | 1003 | the transaction. Upon completion, a new profile is created, but |
| 930 | previous generations of the profile remain available, should the user | 1004 | previous @dfn{generations} of the profile remain available, should the user |
| 931 | want to roll back. | 1005 | want to roll back. |
| 932 | 1006 | ||
| 933 | For example, to remove @code{lua} and install @code{guile} and | 1007 | For example, to remove @code{lua} and install @code{guile} and |
| @@ -937,11 +1011,26 @@ For example, to remove @code{lua} and install @code{guile} and | |||
| 937 | guix package -r lua -i guile guile-cairo | 1011 | guix package -r lua -i guile guile-cairo |
| 938 | @end example | 1012 | @end example |
| 939 | 1013 | ||
| 1014 | @command{guix package} also supports a @dfn{declarative approach} | ||
| 1015 | whereby the user specifies the exact set of packages to be available and | ||
| 1016 | passes it @i{via} the @option{--manifest} option | ||
| 1017 | (@pxref{profile-manifest, @option{--manifest}}). | ||
| 1018 | |||
| 940 | For each user, a symlink to the user's default profile is automatically | 1019 | For each user, a symlink to the user's default profile is automatically |
| 941 | created in @file{$HOME/.guix-profile}. This symlink always points to the | 1020 | created in @file{$HOME/.guix-profile}. This symlink always points to the |
| 942 | current generation of the user's default profile. Thus, users can add | 1021 | current generation of the user's default profile. Thus, users can add |
| 943 | @file{$HOME/.guix-profile/bin} to their @code{PATH} environment | 1022 | @file{$HOME/.guix-profile/bin} to their @code{PATH} environment |
| 944 | variable, and so on. | 1023 | variable, and so on. |
| 1024 | @cindex search paths | ||
| 1025 | If you are not using the Guix System Distribution, consider adding the | ||
| 1026 | following lines to your @file{~/.bash_profile} (@pxref{Bash Startup | ||
| 1027 | Files,,, bash, The GNU Bash Reference Manual}) so that newly-spawned | ||
| 1028 | shells get all the right environment variable definitions: | ||
| 1029 | |||
| 1030 | @example | ||
| 1031 | GUIX_PROFILE="$HOME/.guix-profile" \ | ||
| 1032 | source "$HOME/.guix-profile/etc/profile" | ||
| 1033 | @end example | ||
| 945 | 1034 | ||
| 946 | In a multi-user setup, user profiles are stored in a place registered as | 1035 | In a multi-user setup, user profiles are stored in a place registered as |
| 947 | a @dfn{garbage-collector root}, which @file{$HOME/.guix-profile} points | 1036 | a @dfn{garbage-collector root}, which @file{$HOME/.guix-profile} points |
| @@ -976,8 +1065,12 @@ distribution modules (@pxref{Package Modules}). | |||
| 976 | 1065 | ||
| 977 | @cindex propagated inputs | 1066 | @cindex propagated inputs |
| 978 | Sometimes packages have @dfn{propagated inputs}: these are dependencies | 1067 | Sometimes packages have @dfn{propagated inputs}: these are dependencies |
| 979 | that automatically get installed along with the required package. | 1068 | that automatically get installed along with the required package |
| 1069 | (@pxref{package-propagated-inputs, @code{propagated-inputs} in | ||
| 1070 | @code{package} objects}, for information about propagated inputs in | ||
| 1071 | package definitions). | ||
| 980 | 1072 | ||
| 1073 | @anchor{package-cmd-propagated-inputs} | ||
| 981 | An example is the GNU MPC library: its C header files refer to those of | 1074 | An example is the GNU MPC library: its C header files refer to those of |
| 982 | the GNU MPFR library, which in turn refer to those of the GMP library. | 1075 | the GNU MPFR library, which in turn refer to those of the GMP library. |
| 983 | Thus, when installing MPC, the MPFR and GMP libraries also get installed | 1076 | Thus, when installing MPC, the MPFR and GMP libraries also get installed |
| @@ -1038,6 +1131,34 @@ substring ``emacs'': | |||
| 1038 | $ guix package --upgrade . --do-not-upgrade emacs | 1131 | $ guix package --upgrade . --do-not-upgrade emacs |
| 1039 | @end example | 1132 | @end example |
| 1040 | 1133 | ||
| 1134 | @item @anchor{profile-manifest}--manifest=@var{file} | ||
| 1135 | @itemx -m @var{file} | ||
| 1136 | @cindex profile declaration | ||
| 1137 | @cindex profile manifest | ||
| 1138 | Create a new generation of the profile from the manifest object | ||
| 1139 | returned by the Scheme code in @var{file}. | ||
| 1140 | |||
| 1141 | This allows you to @emph{declare} the profile's contents rather than | ||
| 1142 | constructing it through a sequence of @code{--install} and similar | ||
| 1143 | commands. The advantage is that @var{file} can be put under version | ||
| 1144 | control, copied to different machines to reproduce the same profile, and | ||
| 1145 | so on. | ||
| 1146 | |||
| 1147 | @c FIXME: Add reference to (guix profile) documentation when available. | ||
| 1148 | @var{file} must return a @dfn{manifest} object, which is roughly a list | ||
| 1149 | of packages: | ||
| 1150 | |||
| 1151 | @findex packages->manifest | ||
| 1152 | @example | ||
| 1153 | (use-package-modules guile emacs) | ||
| 1154 | |||
| 1155 | (packages->manifest | ||
| 1156 | (list emacs | ||
| 1157 | guile-2.0 | ||
| 1158 | ;; Use a specific package output. | ||
| 1159 | (list guile-2.0 "debug"))) | ||
| 1160 | @end example | ||
| 1161 | |||
| 1041 | @item --roll-back | 1162 | @item --roll-back |
| 1042 | Roll back to the previous @dfn{generation} of the profile---i.e., undo | 1163 | Roll back to the previous @dfn{generation} of the profile---i.e., undo |
| 1043 | the last transaction. | 1164 | the last transaction. |
| @@ -1068,7 +1189,7 @@ The difference between @code{--roll-back} and | |||
| 1068 | not make a zeroth generation, so if a specified generation does not | 1189 | not make a zeroth generation, so if a specified generation does not |
| 1069 | exist, the current generation will not be changed. | 1190 | exist, the current generation will not be changed. |
| 1070 | 1191 | ||
| 1071 | @item --search-paths | 1192 | @item --search-paths[=@var{kind}] |
| 1072 | @cindex search paths | 1193 | @cindex search paths |
| 1073 | Report environment variable definitions, in Bash syntax, that may be | 1194 | Report environment variable definitions, in Bash syntax, that may be |
| 1074 | needed in order to use the set of installed packages. These environment | 1195 | needed in order to use the set of installed packages. These environment |
| @@ -1083,6 +1204,18 @@ library are installed in the profile, then @code{--search-paths} will | |||
| 1083 | suggest setting these variables to @code{@var{profile}/include} and | 1204 | suggest setting these variables to @code{@var{profile}/include} and |
| 1084 | @code{@var{profile}/lib}, respectively. | 1205 | @code{@var{profile}/lib}, respectively. |
| 1085 | 1206 | ||
| 1207 | The typical use case is to define these environment variables in the | ||
| 1208 | shell: | ||
| 1209 | |||
| 1210 | @example | ||
| 1211 | $ eval `guix package --search-paths` | ||
| 1212 | @end example | ||
| 1213 | |||
| 1214 | @var{kind} may be one of @code{exact}, @code{prefix}, or @code{suffix}, | ||
| 1215 | meaning that the returned environment variable definitions will either | ||
| 1216 | be exact settings, or prefixes or suffixes of the current value of these | ||
| 1217 | variables. When omitted, @var{kind} defaults to @code{exact}. | ||
| 1218 | |||
| 1086 | @item --profile=@var{profile} | 1219 | @item --profile=@var{profile} |
| 1087 | @itemx -p @var{profile} | 1220 | @itemx -p @var{profile} |
| 1088 | Use @var{profile} instead of the user's default profile. | 1221 | Use @var{profile} instead of the user's default profile. |
| @@ -1330,7 +1463,9 @@ determination to subvert the computing infrastructure and exploit its | |||
| 1330 | weaknesses. While using @code{hydra.gnu.org} substitutes can be | 1463 | weaknesses. While using @code{hydra.gnu.org} substitutes can be |
| 1331 | convenient, we encourage users to also build on their own, or even run | 1464 | convenient, we encourage users to also build on their own, or even run |
| 1332 | their own build farm, such that @code{hydra.gnu.org} is less of an | 1465 | their own build farm, such that @code{hydra.gnu.org} is less of an |
| 1333 | interesting target. | 1466 | interesting target. One way to help is by publishing the software you |
| 1467 | build using @command{guix publish} so that others have one more choice | ||
| 1468 | of server to download substitutes from (@pxref{Invoking guix publish}). | ||
| 1334 | 1469 | ||
| 1335 | Guix has the foundations to maximize build reproducibility | 1470 | Guix has the foundations to maximize build reproducibility |
| 1336 | (@pxref{Features}). In most cases, independent builds of a given | 1471 | (@pxref{Features}). In most cases, independent builds of a given |
| @@ -1418,8 +1553,9 @@ is achieved by running @code{guix package --delete-generations} | |||
| 1418 | 1553 | ||
| 1419 | The @command{guix gc} command has three modes of operation: it can be | 1554 | The @command{guix gc} command has three modes of operation: it can be |
| 1420 | used to garbage-collect any dead files (the default), to delete specific | 1555 | used to garbage-collect any dead files (the default), to delete specific |
| 1421 | files (the @code{--delete} option), or to print garbage-collector | 1556 | files (the @code{--delete} option), to print garbage-collector |
| 1422 | information. The available options are listed below: | 1557 | information, or for more advanced queries. The garbage collection |
| 1558 | options are as follows: | ||
| 1423 | 1559 | ||
| 1424 | @table @code | 1560 | @table @code |
| 1425 | @item --collect-garbage[=@var{min}] | 1561 | @item --collect-garbage[=@var{min}] |
| @@ -1468,6 +1604,47 @@ of these, recursively. In other words, the returned list is the | |||
| 1468 | 1604 | ||
| 1469 | @end table | 1605 | @end table |
| 1470 | 1606 | ||
| 1607 | Lastly, the following options allow you to check the integrity of the | ||
| 1608 | store and to control disk usage. | ||
| 1609 | |||
| 1610 | @table @option | ||
| 1611 | |||
| 1612 | @item --verify[=@var{options}] | ||
| 1613 | @cindex integrity, of the store | ||
| 1614 | @cindex integrity checking | ||
| 1615 | Verify the integrity of the store. | ||
| 1616 | |||
| 1617 | By default, make sure that all the store items marked as valid in the | ||
| 1618 | daemon's database actually exist in @file{/gnu/store}. | ||
| 1619 | |||
| 1620 | When provided, @var{options} must a comma-separated list containing one | ||
| 1621 | or more of @code{contents} and @code{repair}. | ||
| 1622 | |||
| 1623 | When passing @option{--verify=contents}, the daemon will compute the | ||
| 1624 | content hash of each store item and compare it against its hash in the | ||
| 1625 | database. Hash mismatches are reported as data corruptions. Because it | ||
| 1626 | traverses @emph{all the files in the store}, this command can take a | ||
| 1627 | long time, especially on systems with a slow disk drive. | ||
| 1628 | |||
| 1629 | @cindex repairing the store | ||
| 1630 | Using @option{--verify=repair} or @option{--verify=contents,repair} | ||
| 1631 | causes the daemon to try to repair corrupt store items by fetching | ||
| 1632 | substitutes for them (@pxref{Substitutes}). Because repairing is not | ||
| 1633 | atomic, and thus potentially dangerous, it is available only to the | ||
| 1634 | system administrator. | ||
| 1635 | |||
| 1636 | @item --optimize | ||
| 1637 | @cindex deduplication | ||
| 1638 | Optimize the store by hard-linking identical files---this is | ||
| 1639 | @dfn{deduplication}. | ||
| 1640 | |||
| 1641 | The daemon performs deduplication after each successful build or archive | ||
| 1642 | import, unless it was started with @code{--disable-deduplication} | ||
| 1643 | (@pxref{Invoking guix-daemon, @code{--disable-deduplication}}). Thus, | ||
| 1644 | this option is primarily useful when the daemon was running with | ||
| 1645 | @code{--disable-deduplication}. | ||
| 1646 | |||
| 1647 | @end table | ||
| 1471 | 1648 | ||
| 1472 | @node Invoking guix pull | 1649 | @node Invoking guix pull |
| 1473 | @section Invoking @command{guix pull} | 1650 | @section Invoking @command{guix pull} |
| @@ -1724,7 +1901,8 @@ There are a few points worth noting in the above package definition: | |||
| 1724 | 1901 | ||
| 1725 | @itemize | 1902 | @itemize |
| 1726 | @item | 1903 | @item |
| 1727 | The @code{source} field of the package is an @code{<origin>} object. | 1904 | The @code{source} field of the package is an @code{<origin>} object |
| 1905 | (@pxref{origin Reference}, for the complete reference). | ||
| 1728 | Here, the @code{url-fetch} method from @code{(guix download)} is used, | 1906 | Here, the @code{url-fetch} method from @code{(guix download)} is used, |
| 1729 | meaning that the source is a file to be downloaded over FTP or HTTP. | 1907 | meaning that the source is a file to be downloaded over FTP or HTTP. |
| 1730 | 1908 | ||
| @@ -1772,6 +1950,8 @@ However, any other dependencies need to be specified in the | |||
| 1772 | unavailable to the build process, possibly leading to a build failure. | 1950 | unavailable to the build process, possibly leading to a build failure. |
| 1773 | @end itemize | 1951 | @end itemize |
| 1774 | 1952 | ||
| 1953 | @xref{package Reference}, for a full description of possible fields. | ||
| 1954 | |||
| 1775 | Once a package definition is in place, the | 1955 | Once a package definition is in place, the |
| 1776 | package may actually be built using the @code{guix build} command-line | 1956 | package may actually be built using the @code{guix build} command-line |
| 1777 | tool (@pxref{Invoking guix build}). @xref{Packaging Guidelines}, for | 1957 | tool (@pxref{Invoking guix build}). @xref{Packaging Guidelines}, for |
| @@ -1816,6 +1996,194 @@ and operating system, such as @code{"mips64el-linux-gnu"} | |||
| 1816 | Configure and Build System}). | 1996 | Configure and Build System}). |
| 1817 | @end deffn | 1997 | @end deffn |
| 1818 | 1998 | ||
| 1999 | @menu | ||
| 2000 | * package Reference :: The package data type. | ||
| 2001 | * origin Reference:: The origin data type. | ||
| 2002 | @end menu | ||
| 2003 | |||
| 2004 | |||
| 2005 | @node package Reference | ||
| 2006 | @subsection @code{package} Reference | ||
| 2007 | |||
| 2008 | This section summarizes all the options available in @code{package} | ||
| 2009 | declarations (@pxref{Defining Packages}). | ||
| 2010 | |||
| 2011 | @deftp {Data Type} package | ||
| 2012 | This is the data type representing a package recipe. | ||
| 2013 | |||
| 2014 | @table @asis | ||
| 2015 | @item @code{name} | ||
| 2016 | The name of the package, as a string. | ||
| 2017 | |||
| 2018 | @item @code{version} | ||
| 2019 | The version of the package, as a string. | ||
| 2020 | |||
| 2021 | @item @code{source} | ||
| 2022 | An origin object telling how the source code for the package should be | ||
| 2023 | acquired (@pxref{origin Reference}). | ||
| 2024 | |||
| 2025 | @item @code{build-system} | ||
| 2026 | The build system that should be used to build the package (@pxref{Build | ||
| 2027 | Systems}). | ||
| 2028 | |||
| 2029 | @item @code{arguments} (default: @code{'()}) | ||
| 2030 | The arguments that should be passed to the build system. This is a | ||
| 2031 | list, typically containing sequential keyword-value pairs. | ||
| 2032 | |||
| 2033 | @item @code{inputs} (default: @code{'()}) | ||
| 2034 | Package or derivation inputs to the build. This is a list of lists, | ||
| 2035 | where each list has the name of the input (a string) as its first | ||
| 2036 | element, a package or derivation object as its second element, and | ||
| 2037 | optionally the name of the output of the package or derivation that | ||
| 2038 | should be used, which defaults to @code{"out"}. | ||
| 2039 | |||
| 2040 | @item @anchor{package-propagated-inputs}@code{propagated-inputs} (default: @code{'()}) | ||
| 2041 | @cindex propagated inputs | ||
| 2042 | This field is like @code{inputs}, but the specified packages will be | ||
| 2043 | force-installed alongside the package they belong to | ||
| 2044 | (@pxref{package-cmd-propagated-inputs, @command{guix package}}, for | ||
| 2045 | information on how @command{guix package} deals with propagated inputs.) | ||
| 2046 | |||
| 2047 | For example this is necessary when a library needs headers of another | ||
| 2048 | library to compile, or needs another shared library to be linked | ||
| 2049 | alongside itself when a program wants to link to it. | ||
| 2050 | |||
| 2051 | @item @code{native-inputs} (default: @code{'()}) | ||
| 2052 | This field is like @code{inputs}, but in case of a cross-compilation it | ||
| 2053 | will be ensured that packages for the architecture of the build machine | ||
| 2054 | are present, such that executables from them can be used during the | ||
| 2055 | build. | ||
| 2056 | |||
| 2057 | This is typically where you would list tools needed at build time but | ||
| 2058 | not at run time, such as Autoconf, Automake, pkg-config, Gettext, or | ||
| 2059 | Bison. @command{guix lint} can report likely mistakes in this area | ||
| 2060 | (@pxref{Invoking guix lint}). | ||
| 2061 | |||
| 2062 | @item @code{self-native-input?} (default: @code{#f}) | ||
| 2063 | This is a Boolean field telling whether the package should use itself as | ||
| 2064 | a native input when cross-compiling. | ||
| 2065 | |||
| 2066 | @item @code{outputs} (default: @code{'("out")}) | ||
| 2067 | The list of output names of the package. @xref{Packages with Multiple | ||
| 2068 | Outputs}, for typical uses of additional outputs. | ||
| 2069 | |||
| 2070 | @item @code{native-search-paths} (default: @code{'()}) | ||
| 2071 | @itemx @code{search-paths} (default: @code{'()}) | ||
| 2072 | A list of @code{search-path-specification} objects describing | ||
| 2073 | search-path environment variables honored by the package. | ||
| 2074 | |||
| 2075 | @item @code{replacement} (default: @code{#f}) | ||
| 2076 | This must either @code{#f} or a package object that will be used as a | ||
| 2077 | @dfn{replacement} for this package. @xref{Security Updates, grafts}, | ||
| 2078 | for details. | ||
| 2079 | |||
| 2080 | @item @code{synopsis} | ||
| 2081 | A one-line description of the package. | ||
| 2082 | |||
| 2083 | @item @code{description} | ||
| 2084 | A more elaborate description of the package. | ||
| 2085 | |||
| 2086 | @item @code{license} | ||
| 2087 | The license of the package; a value from @code{(guix licenses)}. | ||
| 2088 | |||
| 2089 | @item @code{home-page} | ||
| 2090 | The URL to the home-page of the package, as a string. | ||
| 2091 | |||
| 2092 | @item @code{supported-systems} (default: @var{%supported-systems}) | ||
| 2093 | The list of systems supported by the package, as strings of the form | ||
| 2094 | @code{architecture-kernel}, for example @code{"x86_64-linux"}. | ||
| 2095 | |||
| 2096 | @item @code{maintainers} (default: @code{'()}) | ||
| 2097 | The list of maintainers of the package, as @code{maintainer} objects. | ||
| 2098 | |||
| 2099 | @item @code{location} (default: source location of the @code{package} form) | ||
| 2100 | The source location of the package. It's useful to override this when | ||
| 2101 | inheriting from another package, in which case this field is not | ||
| 2102 | automatically corrected. | ||
| 2103 | @end table | ||
| 2104 | @end deftp | ||
| 2105 | |||
| 2106 | |||
| 2107 | @node origin Reference | ||
| 2108 | @subsection @code{origin} Reference | ||
| 2109 | |||
| 2110 | This section summarizes all the options available in @code{origin} | ||
| 2111 | declarations (@pxref{Defining Packages}). | ||
| 2112 | |||
| 2113 | @deftp {Data Type} origin | ||
| 2114 | This is the data type representing a source code origin. | ||
| 2115 | |||
| 2116 | @table @asis | ||
| 2117 | @item @code{uri} | ||
| 2118 | An object containing the URI of the source. The object type depends on | ||
| 2119 | the @code{method} (see below). For example, when using the | ||
| 2120 | @var{url-fetch} method of @code{(guix download)}, the valid @code{uri} | ||
| 2121 | values are: a URL represented as a string, or a list thereof. | ||
| 2122 | |||
| 2123 | @item @code{method} | ||
| 2124 | A procedure that will handle the URI. | ||
| 2125 | |||
| 2126 | Examples include: | ||
| 2127 | |||
| 2128 | @table @asis | ||
| 2129 | @item @var{url-fetch} from @code{(guix download)} | ||
| 2130 | download a file the HTTP, HTTPS, or FTP URL specified in the | ||
| 2131 | @code{uri} field; | ||
| 2132 | |||
| 2133 | @item @var{git-fetch} from @code{(guix git-download)} | ||
| 2134 | clone the Git version control repository, and check out the revision | ||
| 2135 | specified in the @code{uri} field as a @code{git-reference} object; a | ||
| 2136 | @code{git-reference} looks like this: | ||
| 2137 | |||
| 2138 | @example | ||
| 2139 | (git-reference | ||
| 2140 | (url "git://git.debian.org/git/pkg-shadow/shadow") | ||
| 2141 | (commit "v4.1.5.1")) | ||
| 2142 | @end example | ||
| 2143 | @end table | ||
| 2144 | |||
| 2145 | @item @code{sha256} | ||
| 2146 | A bytevector containing the SHA-256 hash of the source. Typically the | ||
| 2147 | @code{base32} form is used here to generate the bytevector from a | ||
| 2148 | base-32 string. | ||
| 2149 | |||
| 2150 | @item @code{file-name} (default: @code{#f}) | ||
| 2151 | The file name under which the source code should be saved. When this is | ||
| 2152 | @code{#f}, a sensible default value will be used in most cases. In case | ||
| 2153 | the source is fetched from a URL, the file name from the URL will be | ||
| 2154 | used. For version control checkouts, it's recommended to provide the | ||
| 2155 | file name explicitly because the default is not very descriptive. | ||
| 2156 | |||
| 2157 | @item @code{patches} (default: @code{'()}) | ||
| 2158 | A list of file names containing patches to be applied to the source. | ||
| 2159 | |||
| 2160 | @item @code{snippet} (default: @code{#f}) | ||
| 2161 | A quoted piece of code that will be run in the source directory to make | ||
| 2162 | any modifications, which is sometimes more convenient than a patch. | ||
| 2163 | |||
| 2164 | @item @code{patch-flags} (default: @code{'("-p1")}) | ||
| 2165 | A list of command-line flags that should be passed to the @code{patch} | ||
| 2166 | command. | ||
| 2167 | |||
| 2168 | @item @code{patch-inputs} (default: @code{#f}) | ||
| 2169 | Input packages or derivations to the patching process. When this is | ||
| 2170 | @code{#f}, the usual set of inputs necessary for patching are provided, | ||
| 2171 | such as GNU@tie{}Patch. | ||
| 2172 | |||
| 2173 | @item @code{modules} (default: @code{'()}) | ||
| 2174 | A list of Guile modules that should be loaded during the patching | ||
| 2175 | process and while running the code in the @code{snippet} field. | ||
| 2176 | |||
| 2177 | @item @code{imported-modules} (default: @code{'()}) | ||
| 2178 | The list of Guile modules to import in the patch derivation, for use by | ||
| 2179 | the @code{snippet}. | ||
| 2180 | |||
| 2181 | @item @code{patch-guile} (default: @code{#f}) | ||
| 2182 | The Guile package that should be used in the patching process. When | ||
| 2183 | this is @code{#f}, a sensible default is used. | ||
| 2184 | @end table | ||
| 2185 | @end deftp | ||
| 2186 | |||
| 1819 | 2187 | ||
| 1820 | @node Build Systems | 2188 | @node Build Systems |
| 1821 | @section Build Systems | 2189 | @section Build Systems |
| @@ -2056,7 +2424,7 @@ the @code{#:haddock-flags} parameter. If the file @code{Setup.hs} is | |||
| 2056 | not found, the build system looks for @code{Setup.lhs} instead. | 2424 | not found, the build system looks for @code{Setup.lhs} instead. |
| 2057 | 2425 | ||
| 2058 | Which Haskell compiler is used can be specified with the @code{#:haskell} | 2426 | Which Haskell compiler is used can be specified with the @code{#:haskell} |
| 2059 | parameter which defaults to @code{ghc}. | 2427 | parameter which defaults to @code{ghc}. |
| 2060 | @end defvr | 2428 | @end defvr |
| 2061 | 2429 | ||
| 2062 | Lastly, for packages that do not need anything as sophisticated, a | 2430 | Lastly, for packages that do not need anything as sophisticated, a |
| @@ -2338,28 +2706,41 @@ Consider this ``normal'' procedure: | |||
| 2338 | `(symlink ,sh %output)))) | 2706 | `(symlink ,sh %output)))) |
| 2339 | @end example | 2707 | @end example |
| 2340 | 2708 | ||
| 2341 | Using @code{(guix monads)}, it may be rewritten as a monadic function: | 2709 | Using @code{(guix monads)} and @code{(guix gexp)}, it may be rewritten |
| 2710 | as a monadic function: | ||
| 2342 | 2711 | ||
| 2343 | @c FIXME: Find a better example, one that uses 'mlet'. | ||
| 2344 | @example | 2712 | @example |
| 2345 | (define (sh-symlink) | 2713 | (define (sh-symlink) |
| 2346 | ;; Same, but return a monadic value. | 2714 | ;; Same, but return a monadic value. |
| 2347 | (gexp->derivation "sh" | 2715 | (mlet %store-monad ((drv (package->derivation bash))) |
| 2348 | #~(symlink (string-append #$bash "/bin/bash") #$output))) | 2716 | (gexp->derivation "sh" |
| 2717 | #~(symlink (string-append #$drv "/bin/bash") | ||
| 2718 | #$output)))) | ||
| 2349 | @end example | 2719 | @end example |
| 2350 | 2720 | ||
| 2351 | There are two things to note in the second version: the @code{store} | 2721 | There several things to note in the second version: the @code{store} |
| 2352 | parameter is now implicit, and the monadic value returned by | 2722 | parameter is now implicit and is ``threaded'' in the calls to the |
| 2353 | @code{package-file}---a wrapper around @code{package-derivation} and | 2723 | @code{package->derivation} and @code{gexp->derivation} monadic |
| 2354 | @code{derivation->output-path}---is @dfn{bound} using @code{mlet} | 2724 | procedures, and the monadic value returned by @code{package->derivation} |
| 2355 | instead of plain @code{let}. | 2725 | is @dfn{bound} using @code{mlet} instead of plain @code{let}. |
| 2356 | 2726 | ||
| 2357 | Calling the monadic @code{profile.sh} has no effect. To get the desired | 2727 | As it turns out, the call to @code{package->derivation} can even be |
| 2728 | omitted since it will take place implicitly, as we will see later | ||
| 2729 | (@pxref{G-Expressions}): | ||
| 2730 | |||
| 2731 | @example | ||
| 2732 | (define (sh-symlink) | ||
| 2733 | (gexp->derivation "sh" | ||
| 2734 | #~(symlink (string-append #$bash "/bin/bash") | ||
| 2735 | #$output))) | ||
| 2736 | @end example | ||
| 2737 | |||
| 2738 | Calling the monadic @code{sh-symlink} has no effect. To get the desired | ||
| 2358 | effect, one must use @code{run-with-store}: | 2739 | effect, one must use @code{run-with-store}: |
| 2359 | 2740 | ||
| 2360 | @example | 2741 | @example |
| 2361 | (run-with-store (open-connection) (profile.sh)) | 2742 | (run-with-store (open-connection) (sh-symlink)) |
| 2362 | @result{} /gnu/store/...-profile.sh | 2743 | @result{} /gnu/store/...-sh-symlink |
| 2363 | @end example | 2744 | @end example |
| 2364 | 2745 | ||
| 2365 | Note that the @code{(guix monad-repl)} module extends Guile's REPL with | 2746 | Note that the @code{(guix monad-repl)} module extends Guile's REPL with |
| @@ -2401,12 +2782,25 @@ in @var{monad}. | |||
| 2401 | Return a monadic value that encapsulates @var{val}. | 2782 | Return a monadic value that encapsulates @var{val}. |
| 2402 | @end deffn | 2783 | @end deffn |
| 2403 | 2784 | ||
| 2404 | @deffn {Scheme Syntax} >>= @var{mval} @var{mproc} | 2785 | @deffn {Scheme Syntax} >>= @var{mval} @var{mproc} ... |
| 2405 | @dfn{Bind} monadic value @var{mval}, passing its ``contents'' to monadic | 2786 | @dfn{Bind} monadic value @var{mval}, passing its ``contents'' to monadic |
| 2406 | procedure @var{mproc}@footnote{This operation is commonly referred to as | 2787 | procedures @var{mproc}@dots{}@footnote{This operation is commonly |
| 2407 | ``bind'', but that name denotes an unrelated procedure in Guile. Thus | 2788 | referred to as ``bind'', but that name denotes an unrelated procedure in |
| 2408 | we use this somewhat cryptic symbol inherited from the Haskell | 2789 | Guile. Thus we use this somewhat cryptic symbol inherited from the |
| 2409 | language.}. | 2790 | Haskell language.}. There can be one @var{mproc} or several of them, as |
| 2791 | in this example: | ||
| 2792 | |||
| 2793 | @example | ||
| 2794 | (run-with-state | ||
| 2795 | (with-monad %state-monad | ||
| 2796 | (>>= (return 1) | ||
| 2797 | (lambda (x) (return (+ 1 x))) | ||
| 2798 | (lambda (x) (return (* 2 x))))) | ||
| 2799 | 'some-state) | ||
| 2800 | |||
| 2801 | @result{} 4 | ||
| 2802 | @result{} some-state | ||
| 2803 | @end example | ||
| 2410 | @end deffn | 2804 | @end deffn |
| 2411 | 2805 | ||
| 2412 | @deffn {Scheme Syntax} mlet @var{monad} ((@var{var} @var{mval}) ...) @ | 2806 | @deffn {Scheme Syntax} mlet @var{monad} ((@var{var} @var{mval}) ...) @ |
| @@ -2604,13 +2998,14 @@ and these dependencies are automatically added as inputs to the build | |||
| 2604 | processes that use them. | 2998 | processes that use them. |
| 2605 | @end itemize | 2999 | @end itemize |
| 2606 | 3000 | ||
| 2607 | Actually this mechanism is not limited to package and derivation | 3001 | This mechanism is not limited to package and derivation |
| 2608 | objects; @dfn{compilers} able to ``lower'' other high-level objects to | 3002 | objects: @dfn{compilers} able to ``lower'' other high-level objects to |
| 2609 | derivations can be defined, such that these objects can also be inserted | 3003 | derivations can be defined, such that these objects can also be inserted |
| 2610 | into gexps. Another useful type of high-level object that can be | 3004 | into gexps. For example, a useful type of high-level object that can be |
| 2611 | inserted in a gexp is @dfn{local files}, which allows files from the | 3005 | inserted in a gexp is ``file-like objects'', which make it easy to |
| 2612 | local file system to be added to the store and referred to by | 3006 | add files to the store and refer to them in |
| 2613 | derivations and such (see @code{local-file} below.) | 3007 | derivations and such (see @code{local-file} and @code{plain-file} |
| 3008 | below.) | ||
| 2614 | 3009 | ||
| 2615 | To illustrate the idea, here is an example of a gexp: | 3010 | To illustrate the idea, here is an example of a gexp: |
| 2616 | 3011 | ||
| @@ -2774,6 +3169,24 @@ refer to. Any reference to another store item will lead to a build error. | |||
| 2774 | The other arguments are as for @code{derivation} (@pxref{Derivations}). | 3169 | The other arguments are as for @code{derivation} (@pxref{Derivations}). |
| 2775 | @end deffn | 3170 | @end deffn |
| 2776 | 3171 | ||
| 3172 | @cindex file-like objects | ||
| 3173 | The @code{local-file} and @code{plain-file} procedures below return | ||
| 3174 | @dfn{file-like objects}. That is, when unquoted in a G-expression, | ||
| 3175 | these objects lead to a file in the store. Consider this G-expression: | ||
| 3176 | |||
| 3177 | @example | ||
| 3178 | #~(system* (string-append #$glibc "/sbin/nscd") "-f" | ||
| 3179 | #$(local-file "/tmp/my-nscd.conf")) | ||
| 3180 | @end example | ||
| 3181 | |||
| 3182 | The effect here is to ``intern'' @file{/tmp/my-nscd.conf} by copying it | ||
| 3183 | to the store. Once expanded, for instance @i{via} | ||
| 3184 | @code{gexp->derivation}, the G-expression refers to that copy under | ||
| 3185 | @file{/gnu/store}; thus, modifying or removing the file in @file{/tmp} | ||
| 3186 | does not have any effect on what the G-expression does. | ||
| 3187 | @code{plain-file} can be used similarly; it differs in that the file | ||
| 3188 | content is directly passed as a string. | ||
| 3189 | |||
| 2777 | @deffn {Scheme Procedure} local-file @var{file} [@var{name}] @ | 3190 | @deffn {Scheme Procedure} local-file @var{file} [@var{name}] @ |
| 2778 | [#:recursive? #t] | 3191 | [#:recursive? #t] |
| 2779 | Return an object representing local file @var{file} to add to the store; this | 3192 | Return an object representing local file @var{file} to add to the store; this |
| @@ -2788,6 +3201,13 @@ This is the declarative counterpart of the @code{interned-file} monadic | |||
| 2788 | procedure (@pxref{The Store Monad, @code{interned-file}}). | 3201 | procedure (@pxref{The Store Monad, @code{interned-file}}). |
| 2789 | @end deffn | 3202 | @end deffn |
| 2790 | 3203 | ||
| 3204 | @deffn {Scheme Procedure} plain-file @var{name} @var{content} | ||
| 3205 | Return an object representing a text file called @var{name} with the given | ||
| 3206 | @var{content} (a string) to be added to the store. | ||
| 3207 | |||
| 3208 | This is the declarative counterpart of @code{text-file}. | ||
| 3209 | @end deffn | ||
| 3210 | |||
| 2791 | @deffn {Monadic Procedure} gexp->script @var{name} @var{exp} | 3211 | @deffn {Monadic Procedure} gexp->script @var{name} @var{exp} |
| 2792 | Return an executable script @var{name} that runs @var{exp} using | 3212 | Return an executable script @var{name} that runs @var{exp} using |
| 2793 | @var{guile} with @var{modules} in its search path. | 3213 | @var{guile} with @var{modules} in its search path. |
| @@ -2932,6 +3352,49 @@ The returned source tarball is the result of applying any patches and | |||
| 2932 | code snippets specified in the package's @code{origin} (@pxref{Defining | 3352 | code snippets specified in the package's @code{origin} (@pxref{Defining |
| 2933 | Packages}). | 3353 | Packages}). |
| 2934 | 3354 | ||
| 3355 | @item --sources | ||
| 3356 | Fetch and return the source of @var{package-or-derivation} and all their | ||
| 3357 | dependencies, recursively. This is a handy way to obtain a local copy | ||
| 3358 | of all the source code needed to build @var{packages}, allowing you to | ||
| 3359 | eventually build them even without network access. It is an extension | ||
| 3360 | of the @code{--source} option and can accept one of the following | ||
| 3361 | optional argument values: | ||
| 3362 | |||
| 3363 | @table @code | ||
| 3364 | @item package | ||
| 3365 | This value causes the @code{--sources} option to behave in the same way | ||
| 3366 | as the @code{--source} option. | ||
| 3367 | |||
| 3368 | @item all | ||
| 3369 | Build all packages' source derivations, including any source that might | ||
| 3370 | be listed as @code{inputs}. This is the default value. | ||
| 3371 | |||
| 3372 | @example | ||
| 3373 | $ guix build --sources tzdata | ||
| 3374 | The following derivations will be built: | ||
| 3375 | /gnu/store/@dots{}-tzdata2015b.tar.gz.drv | ||
| 3376 | /gnu/store/@dots{}-tzcode2015b.tar.gz.drv | ||
| 3377 | @end example | ||
| 3378 | |||
| 3379 | @item transitive | ||
| 3380 | Build all packages' source derivations, as well as all source | ||
| 3381 | derivations for packages' transitive inputs. This can be used e.g. to | ||
| 3382 | prefetch package source for later offline building. | ||
| 3383 | |||
| 3384 | @example | ||
| 3385 | $ guix build --sources=transitive tzdata | ||
| 3386 | The following derivations will be built: | ||
| 3387 | /gnu/store/@dots{}-tzcode2015b.tar.gz.drv | ||
| 3388 | /gnu/store/@dots{}-findutils-4.4.2.tar.xz.drv | ||
| 3389 | /gnu/store/@dots{}-grep-2.21.tar.xz.drv | ||
| 3390 | /gnu/store/@dots{}-coreutils-8.23.tar.xz.drv | ||
| 3391 | /gnu/store/@dots{}-make-4.1.tar.xz.drv | ||
| 3392 | /gnu/store/@dots{}-bash-4.3.tar.xz.drv | ||
| 3393 | @dots{} | ||
| 3394 | @end example | ||
| 3395 | |||
| 3396 | @end table | ||
| 3397 | |||
| 2935 | @item --system=@var{system} | 3398 | @item --system=@var{system} |
| 2936 | @itemx -s @var{system} | 3399 | @itemx -s @var{system} |
| 2937 | Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of | 3400 | Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of |
| @@ -3291,16 +3754,30 @@ dependencies. | |||
| 3291 | Specific command-line options are: | 3754 | Specific command-line options are: |
| 3292 | 3755 | ||
| 3293 | @table @code | 3756 | @table @code |
| 3757 | @item --stdin | ||
| 3758 | @itemx -s | ||
| 3759 | Read a Cabal file from the standard input. | ||
| 3294 | @item --no-test-dependencies | 3760 | @item --no-test-dependencies |
| 3295 | @itemx -t | 3761 | @itemx -t |
| 3296 | Do not include dependencies only required to run the test suite. | 3762 | Do not include dependencies required by the test suites only. |
| 3763 | @item --cabal-environment=@var{alist} | ||
| 3764 | @itemx -e @var{alist} | ||
| 3765 | @var{alist} is a Scheme alist defining the environment in which the | ||
| 3766 | Cabal conditionals are evaluated. The accepted keys are: @code{os}, | ||
| 3767 | @code{arch}, @code{impl} and a string representing the name of a flag. | ||
| 3768 | The value associated with a flag has to be either the symbol | ||
| 3769 | @code{true} or @code{false}. The value associated with other keys | ||
| 3770 | has to conform to the Cabal file format definition. The default value | ||
| 3771 | associated with the keys @code{os}, @code{arch} and @code{impl} is | ||
| 3772 | @samp{linux}, @samp{x86_64} and @samp{ghc} respectively. | ||
| 3297 | @end table | 3773 | @end table |
| 3298 | 3774 | ||
| 3299 | The command below imports meta-data for the latest version of the | 3775 | The command below imports meta-data for the latest version of the |
| 3300 | @code{HTTP} Haskell package without including test dependencies: | 3776 | @code{HTTP} Haskell package without including test dependencies and |
| 3777 | specifying the value of the flag @samp{network-uri} as @code{false}: | ||
| 3301 | 3778 | ||
| 3302 | @example | 3779 | @example |
| 3303 | guix import hackage -t HTTP | 3780 | guix import hackage -t -e "'((\"network-uri\" . false))" HTTP |
| 3304 | @end example | 3781 | @end example |
| 3305 | 3782 | ||
| 3306 | A specific package version may optionally be specified by following the | 3783 | A specific package version may optionally be specified by following the |
| @@ -3309,8 +3786,6 @@ package name by a hyphen and a version number as in the following example: | |||
| 3309 | @example | 3786 | @example |
| 3310 | guix import hackage mtl-2.1.3.1 | 3787 | guix import hackage mtl-2.1.3.1 |
| 3311 | @end example | 3788 | @end example |
| 3312 | |||
| 3313 | Currently only indentation structured Cabal files are supported. | ||
| 3314 | @end table | 3789 | @end table |
| 3315 | 3790 | ||
| 3316 | The structure of the @command{guix import} code is modular. It would be | 3791 | The structure of the @command{guix import} code is modular. It would be |
| @@ -3551,6 +4026,21 @@ evaluates to. | |||
| 3551 | @item -E @var{command} | 4026 | @item -E @var{command} |
| 3552 | Execute @var{command} in the new environment. | 4027 | Execute @var{command} in the new environment. |
| 3553 | 4028 | ||
| 4029 | @item --ad-hoc | ||
| 4030 | Include all specified packages in the resulting environment, as if an | ||
| 4031 | @i{ad hoc} package were defined with them as inputs. This option is | ||
| 4032 | useful for quickly creating an environment without having to write a | ||
| 4033 | package expression to contain the desired inputs. | ||
| 4034 | |||
| 4035 | For instance, the command: | ||
| 4036 | |||
| 4037 | @example | ||
| 4038 | guix environment --ad-hoc guile guile-sdl -E guile | ||
| 4039 | @end example | ||
| 4040 | |||
| 4041 | runs @command{guile} in an environment where Guile and Guile-SDL are | ||
| 4042 | available. | ||
| 4043 | |||
| 3554 | @item --pure | 4044 | @item --pure |
| 3555 | Unset existing environment variables when building the new environment. | 4045 | Unset existing environment variables when building the new environment. |
| 3556 | This has the effect of creating an environment in which search paths | 4046 | This has the effect of creating an environment in which search paths |
| @@ -3568,16 +4058,20 @@ build} supports (@pxref{Invoking guix build, common build options}). | |||
| 3568 | @section Invoking @command{guix publish} | 4058 | @section Invoking @command{guix publish} |
| 3569 | 4059 | ||
| 3570 | The purpose of @command{guix publish} is to enable users to easily share | 4060 | The purpose of @command{guix publish} is to enable users to easily share |
| 3571 | their store with others. When @command{guix publish} runs, it spawns an | 4061 | their store with others, which can then use it as a substitute server |
| 3572 | HTTP server which allows anyone with network access to obtain | 4062 | (@pxref{Substitutes}). |
| 3573 | substitutes from it. This means that any machine running Guix can also | 4063 | |
| 3574 | act as if it were a build farm, since the HTTP interface is | 4064 | When @command{guix publish} runs, it spawns an HTTP server which allows |
| 3575 | Hydra-compatible. | 4065 | anyone with network access to obtain substitutes from it. This means |
| 4066 | that any machine running Guix can also act as if it were a build farm, | ||
| 4067 | since the HTTP interface is compatible with Hydra, the software behind | ||
| 4068 | the @code{hydra.gnu.org} build farm. | ||
| 3576 | 4069 | ||
| 3577 | For security, each substitute is signed, allowing recipients to check | 4070 | For security, each substitute is signed, allowing recipients to check |
| 3578 | their authenticity and integrity (@pxref{Substitutes}). Because | 4071 | their authenticity and integrity (@pxref{Substitutes}). Because |
| 3579 | @command{guix publish} uses the system's signing key, which is only | 4072 | @command{guix publish} uses the system's signing key, which is only |
| 3580 | readable by the system administrator, it must run as root. | 4073 | readable by the system administrator, it must be started as root; the |
| 4074 | @code{--user} option makes it drop root privileges early on. | ||
| 3581 | 4075 | ||
| 3582 | The general syntax is: | 4076 | The general syntax is: |
| 3583 | 4077 | ||
| @@ -3606,10 +4100,20 @@ The following options are available: | |||
| 3606 | @itemx -p @var{port} | 4100 | @itemx -p @var{port} |
| 3607 | Listen for HTTP requests on @var{port}. | 4101 | Listen for HTTP requests on @var{port}. |
| 3608 | 4102 | ||
| 4103 | @item --listen=@var{host} | ||
| 4104 | Listen on the network interface for @var{host}. The default is to | ||
| 4105 | accept connections from any interface. | ||
| 4106 | |||
| 4107 | @item --user=@var{user} | ||
| 4108 | @itemx -u @var{user} | ||
| 4109 | Change privileges to @var{user} as soon as possible---i.e., once the | ||
| 4110 | server socket is open and the signing key has been read. | ||
| 4111 | |||
| 3609 | @item --repl[=@var{port}] | 4112 | @item --repl[=@var{port}] |
| 3610 | @itemx -r [@var{port}] | 4113 | @itemx -r [@var{port}] |
| 3611 | Spawn a Guile REPL server (@pxref{REPL Servers,,, guile, GNU Guile | 4114 | Spawn a Guile REPL server (@pxref{REPL Servers,,, guile, GNU Guile |
| 3612 | Reference Manual}) on @var{port} (37146 by default). | 4115 | Reference Manual}) on @var{port} (37146 by default). This is used |
| 4116 | primarily for debugging a running @command{guix publish} server. | ||
| 3613 | @end table | 4117 | @end table |
| 3614 | 4118 | ||
| 3615 | @c ********************************************************************* | 4119 | @c ********************************************************************* |
| @@ -3617,7 +4121,7 @@ Reference Manual}) on @var{port} (37146 by default). | |||
| 3617 | @chapter GNU Distribution | 4121 | @chapter GNU Distribution |
| 3618 | 4122 | ||
| 3619 | @cindex Guix System Distribution | 4123 | @cindex Guix System Distribution |
| 3620 | @cindex GSD | 4124 | @cindex GuixSD |
| 3621 | Guix comes with a distribution of the GNU system consisting entirely of | 4125 | Guix comes with a distribution of the GNU system consisting entirely of |
| 3622 | free software@footnote{The term ``free'' here refers to the | 4126 | free software@footnote{The term ``free'' here refers to the |
| 3623 | @url{http://www.gnu.org/philosophy/free-sw.html,freedom provided to | 4127 | @url{http://www.gnu.org/philosophy/free-sw.html,freedom provided to |
| @@ -3626,7 +4130,7 @@ distribution can be installed on its own (@pxref{System Installation}), | |||
| 3626 | but it is also possible to install Guix as a package manager on top of | 4130 | but it is also possible to install Guix as a package manager on top of |
| 3627 | an installed GNU/Linux system (@pxref{Installation}). To distinguish | 4131 | an installed GNU/Linux system (@pxref{Installation}). To distinguish |
| 3628 | between the two, we refer to the standalone distribution as the Guix | 4132 | between the two, we refer to the standalone distribution as the Guix |
| 3629 | System Distribution, or GNU@tie{}GSD. | 4133 | System Distribution, or GuixSD. |
| 3630 | 4134 | ||
| 3631 | The distribution provides core GNU packages such as GNU libc, GCC, and | 4135 | The distribution provides core GNU packages such as GNU libc, GCC, and |
| 3632 | Binutils, as well as many GNU and non-GNU applications. The complete | 4136 | Binutils, as well as many GNU and non-GNU applications. The complete |
| @@ -3663,7 +4167,7 @@ n32 application binary interface (ABI), and Linux-Libre kernel. | |||
| 3663 | 4167 | ||
| 3664 | @end table | 4168 | @end table |
| 3665 | 4169 | ||
| 3666 | GSD itself is currently only available on @code{i686} and @code{x86_64}. | 4170 | GuixSD itself is currently only available on @code{i686} and @code{x86_64}. |
| 3667 | 4171 | ||
| 3668 | @noindent | 4172 | @noindent |
| 3669 | For information on porting to other architectures or kernels, | 4173 | For information on porting to other architectures or kernels, |
| @@ -3703,13 +4207,13 @@ link that follows: @pxref{Help,,, info, Info: An Introduction}. Hit | |||
| 3703 | 4207 | ||
| 3704 | @subsection Limitations | 4208 | @subsection Limitations |
| 3705 | 4209 | ||
| 3706 | As of version @value{VERSION}, the Guix System Distribution (GSD) is | 4210 | As of version @value{VERSION}, the Guix System Distribution (GuixSD) is |
| 3707 | not production-ready. It may contain bugs and lack important | 4211 | not production-ready. It may contain bugs and lack important |
| 3708 | features. Thus, if you are looking for a stable production system that | 4212 | features. Thus, if you are looking for a stable production system that |
| 3709 | respects your freedom as a computer user, a good solution at this point | 4213 | respects your freedom as a computer user, a good solution at this point |
| 3710 | is to consider @url{http://www.gnu.org/distros/free-distros.html, one of | 4214 | is to consider @url{http://www.gnu.org/distros/free-distros.html, one of |
| 3711 | more established GNU/Linux distributions}. We hope you can soon switch | 4215 | more established GNU/Linux distributions}. We hope you can soon switch |
| 3712 | to the GSD without fear, of course. In the meantime, you can | 4216 | to the GuixSD without fear, of course. In the meantime, you can |
| 3713 | also keep using your distribution and try out the package manager on top | 4217 | also keep using your distribution and try out the package manager on top |
| 3714 | of it (@pxref{Installation}). | 4218 | of it (@pxref{Installation}). |
| 3715 | 4219 | ||
| @@ -3734,7 +4238,7 @@ Few system services are currently supported out-of-the-box | |||
| 3734 | (@pxref{Services}). | 4238 | (@pxref{Services}). |
| 3735 | 4239 | ||
| 3736 | @item | 4240 | @item |
| 3737 | On the order of 1,200 packages are available, which means that you may | 4241 | On the order of 1,900 packages are available, which means that you may |
| 3738 | occasionally find that a useful package is missing. | 4242 | occasionally find that a useful package is missing. |
| 3739 | @end itemize | 4243 | @end itemize |
| 3740 | 4244 | ||
| @@ -3745,7 +4249,7 @@ to report issues (and success stories!), and join us in improving it. | |||
| 3745 | @subsection USB Stick Installation | 4249 | @subsection USB Stick Installation |
| 3746 | 4250 | ||
| 3747 | An installation image for USB sticks can be downloaded from | 4251 | An installation image for USB sticks can be downloaded from |
| 3748 | @code{ftp://alpha.gnu.org/gnu/guix/gsd-usb-install-@value{VERSION}.@var{system}.xz}, | 4252 | @indicateurl{ftp://alpha.gnu.org/gnu/guix/guixsd-usb-install-@value{VERSION}.@var{system}.xz}, |
| 3749 | where @var{system} is one of: | 4253 | where @var{system} is one of: |
| 3750 | 4254 | ||
| 3751 | @table @code | 4255 | @table @code |
| @@ -3767,7 +4271,7 @@ To copy the image to a USB stick, follow these steps: | |||
| 3767 | Decompress the image using the @command{xz} command: | 4271 | Decompress the image using the @command{xz} command: |
| 3768 | 4272 | ||
| 3769 | @example | 4273 | @example |
| 3770 | xz -d gsd-usb-install-@value{VERSION}.@var{system}.xz | 4274 | xz -d guixsd-usb-install-@value{VERSION}.@var{system}.xz |
| 3771 | @end example | 4275 | @end example |
| 3772 | 4276 | ||
| 3773 | @item | 4277 | @item |
| @@ -3776,7 +4280,7 @@ its device name. Assuming that USB stick is known as @file{/dev/sdX}, | |||
| 3776 | copy the image with: | 4280 | copy the image with: |
| 3777 | 4281 | ||
| 3778 | @example | 4282 | @example |
| 3779 | dd if=gsd-usb-install-@value{VERSION}.x86_64 of=/dev/sdX | 4283 | dd if=guixsd-usb-install-@value{VERSION}.x86_64 of=/dev/sdX |
| 3780 | @end example | 4284 | @end example |
| 3781 | 4285 | ||
| 3782 | Access to @file{/dev/sdX} usually requires root privileges. | 4286 | Access to @file{/dev/sdX} usually requires root privileges. |
| @@ -3799,9 +4303,9 @@ To install the system, you would: | |||
| 3799 | @enumerate | 4303 | @enumerate |
| 3800 | 4304 | ||
| 3801 | @item | 4305 | @item |
| 3802 | Configure the network, by running @command{dhclient eno1} (to get an | 4306 | Configure the network, by running @command{ifconfig eno1 up && dhclient |
| 3803 | automatically assigned IP address from the wired network interface | 4307 | eno1} (to get an automatically assigned IP address from the wired |
| 3804 | controller@footnote{ | 4308 | network interface controller@footnote{ |
| 3805 | @c http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c#n20 | 4309 | @c http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c#n20 |
| 3806 | The name @code{eno1} is for the first on-board Ethernet controller. The | 4310 | The name @code{eno1} is for the first on-board Ethernet controller. The |
| 3807 | interface name for an Ethernet controller that is in the first slot of | 4311 | interface name for an Ethernet controller that is in the first slot of |
| @@ -3851,20 +4355,14 @@ that end, the installation system comes with two text editors: GNU nano | |||
| 3851 | It is better to store that file on the target root file system, say, as | 4355 | It is better to store that file on the target root file system, say, as |
| 3852 | @file{/mnt/etc/config.scm}. | 4356 | @file{/mnt/etc/config.scm}. |
| 3853 | 4357 | ||
| 3854 | A minimal operating system configuration, with just the bare minimum and | 4358 | @xref{Using the Configuration System}, for examples of operating system |
| 3855 | only a root account would look like this (on the installation system, | 4359 | configurations. These examples are available under |
| 3856 | this example is available as @file{/etc/configuration-template.scm}): | 4360 | @file{/etc/configuration} in the installation image, so you can copy |
| 4361 | them and use them as a starting point for your own configuration. | ||
| 3857 | 4362 | ||
| 3858 | @example | 4363 | Once you are done preparing the configuration file, the new system must |
| 3859 | @include os-config.texi | 4364 | be initialized (remember that the target root file system is mounted |
| 3860 | @end example | 4365 | under @file{/mnt}): |
| 3861 | |||
| 3862 | @noindent | ||
| 3863 | For more information on @code{operating-system} declarations, | ||
| 3864 | @pxref{Using the Configuration System}. | ||
| 3865 | |||
| 3866 | Once that is done, the new system must be initialized (remember that the | ||
| 3867 | target root file system is mounted under @file{/mnt}): | ||
| 3868 | 4366 | ||
| 3869 | @example | 4367 | @example |
| 3870 | guix system init /mnt/etc/config.scm /mnt | 4368 | guix system init /mnt/etc/config.scm /mnt |
| @@ -3929,6 +4427,7 @@ instance to support new system services. | |||
| 3929 | * Locales:: Language and cultural convention settings. | 4427 | * Locales:: Language and cultural convention settings. |
| 3930 | * Services:: Specifying system services. | 4428 | * Services:: Specifying system services. |
| 3931 | * Setuid Programs:: Programs running with root privileges. | 4429 | * Setuid Programs:: Programs running with root privileges. |
| 4430 | * X.509 Certificates:: Authenticating HTTPS servers. | ||
| 3932 | * Name Service Switch:: Configuring libc's name service switch. | 4431 | * Name Service Switch:: Configuring libc's name service switch. |
| 3933 | * Initial RAM Disk:: Linux-Libre bootstrapping. | 4432 | * Initial RAM Disk:: Linux-Libre bootstrapping. |
| 3934 | * GRUB Configuration:: Configuring the boot loader. | 4433 | * GRUB Configuration:: Configuring the boot loader. |
| @@ -3947,29 +4446,7 @@ kernel, initial RAM disk, and boot loader looks like this: | |||
| 3947 | 4446 | ||
| 3948 | @findex operating-system | 4447 | @findex operating-system |
| 3949 | @lisp | 4448 | @lisp |
| 3950 | (use-modules (gnu) ; for 'user-account', '%base-services', etc. | 4449 | @include os-config-bare-bones.texi |
| 3951 | (gnu packages emacs) ; for 'emacs' | ||
| 3952 | (gnu services ssh)) ; for 'lsh-service' | ||
| 3953 | |||
| 3954 | (operating-system | ||
| 3955 | (host-name "komputilo") | ||
| 3956 | (timezone "Europe/Paris") | ||
| 3957 | (locale "fr_FR.utf8") | ||
| 3958 | (bootloader (grub-configuration | ||
| 3959 | (device "/dev/sda"))) | ||
| 3960 | (file-systems (cons (file-system | ||
| 3961 | (device "/dev/sda1") ; or partition label | ||
| 3962 | (mount-point "/") | ||
| 3963 | (type "ext3")) | ||
| 3964 | %base-file-systems)) | ||
| 3965 | (users (list (user-account | ||
| 3966 | (name "alice") | ||
| 3967 | (group "users") | ||
| 3968 | (comment "Bob's sister") | ||
| 3969 | (home-directory "/home/alice")))) | ||
| 3970 | (packages (cons emacs %base-packages)) | ||
| 3971 | (services (cons (lsh-service #:port 2222 #:root-login? #t) | ||
| 3972 | %base-services))) | ||
| 3973 | @end lisp | 4450 | @end lisp |
| 3974 | 4451 | ||
| 3975 | This example should be self-describing. Some of the fields defined | 4452 | This example should be self-describing. Some of the fields defined |
| @@ -4002,6 +4479,18 @@ generated as needed (@pxref{Defining Services}). @xref{operating-system | |||
| 4002 | Reference}, for details about the available @code{operating-system} | 4479 | Reference}, for details about the available @code{operating-system} |
| 4003 | fields. | 4480 | fields. |
| 4004 | 4481 | ||
| 4482 | The configuration for a typical ``desktop'' usage, with the X11 display | ||
| 4483 | server, a desktop environment, network management, an SSH server, and | ||
| 4484 | more, would look like this: | ||
| 4485 | |||
| 4486 | @lisp | ||
| 4487 | @include os-config-desktop.texi | ||
| 4488 | @end lisp | ||
| 4489 | |||
| 4490 | @xref{Desktop Services}, for the exact list of services provided by | ||
| 4491 | @var{%desktop-services}. @xref{X.509 Certificates}, for background | ||
| 4492 | information about the @code{nss-certs} package that is used here. | ||
| 4493 | |||
| 4005 | Assuming the above snippet is stored in the @file{my-system-config.scm} | 4494 | Assuming the above snippet is stored in the @file{my-system-config.scm} |
| 4006 | file, the @command{guix system reconfigure my-system-config.scm} command | 4495 | file, the @command{guix system reconfigure my-system-config.scm} command |
| 4007 | instantiates that configuration, and makes it the default GRUB boot | 4496 | instantiates that configuration, and makes it the default GRUB boot |
| @@ -4036,7 +4525,7 @@ configuration (@pxref{Using the Configuration System}). | |||
| 4036 | 4525 | ||
| 4037 | @table @asis | 4526 | @table @asis |
| 4038 | @item @code{kernel} (default: @var{linux-libre}) | 4527 | @item @code{kernel} (default: @var{linux-libre}) |
| 4039 | The package object of the operating system to use@footnote{Currently | 4528 | The package object of the operating system kernel to use@footnote{Currently |
| 4040 | only the Linux-libre kernel is supported. In the future, it will be | 4529 | only the Linux-libre kernel is supported. In the future, it will be |
| 4041 | possible to use the GNU@tie{}Hurd.}. | 4530 | possible to use the GNU@tie{}Hurd.}. |
| 4042 | 4531 | ||
| @@ -4059,9 +4548,9 @@ The host name. | |||
| 4059 | 4548 | ||
| 4060 | @item @code{hosts-file} | 4549 | @item @code{hosts-file} |
| 4061 | @cindex hosts file | 4550 | @cindex hosts file |
| 4062 | A zero-argument monadic procedure that returns a text file for use as | 4551 | A file-like object (@pxref{G-Expressions, file-like objects}) for use as |
| 4063 | @file{/etc/hosts} (@pxref{Host Names,,, libc, The GNU C Library | 4552 | @file{/etc/hosts} (@pxref{Host Names,,, libc, The GNU C Library |
| 4064 | Reference Manual}). The default is to produce a file with entries for | 4553 | Reference Manual}). The default is a file with entries for |
| 4065 | @code{localhost} and @var{host-name}. | 4554 | @code{localhost} and @var{host-name}. |
| 4066 | 4555 | ||
| 4067 | @item @code{mapped-devices} (default: @code{'()}) | 4556 | @item @code{mapped-devices} (default: @code{'()}) |
| @@ -4076,7 +4565,7 @@ A list of strings identifying devices to be used for ``swap space'' | |||
| 4076 | (@pxref{Memory Concepts,,, libc, The GNU C Library Reference Manual}). | 4565 | (@pxref{Memory Concepts,,, libc, The GNU C Library Reference Manual}). |
| 4077 | For example, @code{'("/dev/sda3")}. | 4566 | For example, @code{'("/dev/sda3")}. |
| 4078 | 4567 | ||
| 4079 | @item @code{users} (default: @code{'()}) | 4568 | @item @code{users} (default: @code{%base-user-accounts}) |
| 4080 | @itemx @code{groups} (default: @var{%base-groups}) | 4569 | @itemx @code{groups} (default: @var{%base-groups}) |
| 4081 | List of user accounts and groups. @xref{User Accounts}. | 4570 | List of user accounts and groups. @xref{User Accounts}. |
| 4082 | 4571 | ||
| @@ -4135,7 +4624,8 @@ List of string-valued G-expressions denoting setuid programs. | |||
| 4135 | 4624 | ||
| 4136 | @item @code{sudoers} (default: @var{%sudoers-specification}) | 4625 | @item @code{sudoers} (default: @var{%sudoers-specification}) |
| 4137 | @cindex sudoers | 4626 | @cindex sudoers |
| 4138 | The contents of the @file{/etc/sudoers} file as a string. | 4627 | The contents of the @file{/etc/sudoers} file as a file-like object |
| 4628 | (@pxref{G-Expressions, @code{local-file} and @code{plain-file}}). | ||
| 4139 | 4629 | ||
| 4140 | This file specifies which users can use the @command{sudo} command, what | 4630 | This file specifies which users can use the @command{sudo} command, what |
| 4141 | they are allowed to do, and what privileges they may gain. The default | 4631 | they are allowed to do, and what privileges they may gain. The default |
| @@ -4455,6 +4945,14 @@ to be present on the system. This includes groups such as ``root'', | |||
| 4455 | specific devices such as ``audio'', ``disk'', and ``cdrom''. | 4945 | specific devices such as ``audio'', ``disk'', and ``cdrom''. |
| 4456 | @end defvr | 4946 | @end defvr |
| 4457 | 4947 | ||
| 4948 | @defvr {Scheme Variable} %base-user-accounts | ||
| 4949 | This is the list of basic system accounts that programs may expect to | ||
| 4950 | find on a GNU/Linux system, such as the ``nobody'' account. | ||
| 4951 | |||
| 4952 | Note that the ``root'' account is not included here. It is a | ||
| 4953 | special-case and is automatically added whether or not it is specified. | ||
| 4954 | @end defvr | ||
| 4955 | |||
| 4458 | @node Locales | 4956 | @node Locales |
| 4459 | @subsection Locales | 4957 | @subsection Locales |
| 4460 | 4958 | ||
| @@ -4577,6 +5075,8 @@ declaration. | |||
| 4577 | * Base Services:: Essential system services. | 5075 | * Base Services:: Essential system services. |
| 4578 | * Networking Services:: Network setup, SSH daemon, etc. | 5076 | * Networking Services:: Network setup, SSH daemon, etc. |
| 4579 | * X Window:: Graphical display. | 5077 | * X Window:: Graphical display. |
| 5078 | * Desktop Services:: D-Bus and desktop services. | ||
| 5079 | * Database Services:: SQL databases. | ||
| 4580 | * Various Services:: Other services. | 5080 | * Various Services:: Other services. |
| 4581 | @end menu | 5081 | @end menu |
| 4582 | 5082 | ||
| @@ -4745,6 +5245,11 @@ passed to @command{guix-daemon}. | |||
| 4745 | Run @var{udev}, which populates the @file{/dev} directory dynamically. | 5245 | Run @var{udev}, which populates the @file{/dev} directory dynamically. |
| 4746 | @end deffn | 5246 | @end deffn |
| 4747 | 5247 | ||
| 5248 | @deffn {Monadic Procedure} console-keymap-service @var{file} | ||
| 5249 | Return a service to load console keymap from @var{file} using | ||
| 5250 | @command{loadkeys} command. | ||
| 5251 | @end deffn | ||
| 5252 | |||
| 4748 | 5253 | ||
| 4749 | @node Networking Services | 5254 | @node Networking Services |
| 4750 | @subsubsection Networking Services | 5255 | @subsubsection Networking Services |
| @@ -4862,15 +5367,39 @@ This variable is typically used in the @code{hosts-file} field of an | |||
| 4862 | (hosts-file | 5367 | (hosts-file |
| 4863 | ;; Create a /etc/hosts file with aliases for "localhost" | 5368 | ;; Create a /etc/hosts file with aliases for "localhost" |
| 4864 | ;; and "mymachine", as well as for Facebook servers. | 5369 | ;; and "mymachine", as well as for Facebook servers. |
| 4865 | (text-file "hosts" | 5370 | (plain-file "hosts" |
| 4866 | (string-append (local-host-aliases host-name) | 5371 | (string-append (local-host-aliases host-name) |
| 4867 | %facebook-host-aliases)))) | 5372 | %facebook-host-aliases)))) |
| 4868 | @end example | 5373 | @end example |
| 4869 | 5374 | ||
| 4870 | This mechanism can prevent programs running locally, such as Web | 5375 | This mechanism can prevent programs running locally, such as Web |
| 4871 | browsers, from accessing Facebook. | 5376 | browsers, from accessing Facebook. |
| 4872 | @end defvr | 5377 | @end defvr |
| 4873 | 5378 | ||
| 5379 | The @code{(gnu services avahi)} provides the following definition. | ||
| 5380 | |||
| 5381 | @deffn {Monadic Procedure} avahi-service [#:avahi @var{avahi}] @ | ||
| 5382 | [#:host-name #f] [#:publish? #t] [#:ipv4? #t] @ | ||
| 5383 | [#:ipv6? #t] [#:wide-area? #f] @ | ||
| 5384 | [#:domains-to-browse '()] | ||
| 5385 | Return a service that runs @command{avahi-daemon}, a system-wide | ||
| 5386 | mDNS/DNS-SD responder that allows for service discovery and | ||
| 5387 | "zero-configuration" host name lookups (see @uref{http://avahi.org/}). | ||
| 5388 | |||
| 5389 | If @var{host-name} is different from @code{#f}, use that as the host name to | ||
| 5390 | publish for this machine; otherwise, use the machine's actual host name. | ||
| 5391 | |||
| 5392 | When @var{publish?} is true, publishing of host names and services is allowed; | ||
| 5393 | in particular, avahi-daemon will publish the machine's host name and IP | ||
| 5394 | address via mDNS on the local network. | ||
| 5395 | |||
| 5396 | When @var{wide-area?} is true, DNS-SD over unicast DNS is enabled. | ||
| 5397 | |||
| 5398 | Boolean values @var{ipv4?} and @var{ipv6?} determine whether to use IPv4/IPv6 | ||
| 5399 | sockets. | ||
| 5400 | @end deffn | ||
| 5401 | |||
| 5402 | |||
| 4874 | @node X Window | 5403 | @node X Window |
| 4875 | @subsubsection X Window | 5404 | @subsubsection X Window |
| 4876 | 5405 | ||
| @@ -4887,6 +5416,19 @@ Return a service that spawns the SLiM graphical login manager, which in | |||
| 4887 | turn starts the X display server with @var{startx}, a command as returned by | 5416 | turn starts the X display server with @var{startx}, a command as returned by |
| 4888 | @code{xorg-start-command}. | 5417 | @code{xorg-start-command}. |
| 4889 | 5418 | ||
| 5419 | @cindex X session | ||
| 5420 | |||
| 5421 | SLiM automatically looks for session types described by the @file{.desktop} | ||
| 5422 | files in @file{/run/current-system/profile/share/xsessions} and allows users | ||
| 5423 | to choose a session from the log-in screen using @kbd{F1}. Packages such as | ||
| 5424 | @var{xfce}, @var{sawfish}, and @var{ratpoison} provide @file{.desktop} files; | ||
| 5425 | adding them to the system-wide set of packages automatically makes them | ||
| 5426 | available at the log-in screen. | ||
| 5427 | |||
| 5428 | In addition, @file{~/.xsession} files are honored. When available, | ||
| 5429 | @file{~/.xsession} must be an executable that starts a window manager | ||
| 5430 | and/or other X clients. | ||
| 5431 | |||
| 4890 | When @var{allow-empty-passwords?} is true, allow logins with an empty | 5432 | When @var{allow-empty-passwords?} is true, allow logins with an empty |
| 4891 | password. When @var{auto-login?} is true, log in automatically as | 5433 | password. When @var{auto-login?} is true, log in automatically as |
| 4892 | @var{default-user}. | 5434 | @var{default-user}. |
| @@ -4903,39 +5445,78 @@ The G-Expression denoting the default SLiM theme and its name. | |||
| 4903 | @end defvr | 5445 | @end defvr |
| 4904 | 5446 | ||
| 4905 | @deffn {Monadic Procedure} xorg-start-command [#:guile] @ | 5447 | @deffn {Monadic Procedure} xorg-start-command [#:guile] @ |
| 4906 | [#:drivers '()] [#:resolutions '()] [#:xorg-server @var{xorg-server}] | 5448 | [#:configuration-file #f] [#:xorg-server @var{xorg-server}] |
| 4907 | Return a derivation that builds a @var{guile} script to start the X server | 5449 | Return a derivation that builds a @var{guile} script to start the X server |
| 4908 | from @var{xorg-server}. Usually the X server is started by a login manager. | 5450 | from @var{xorg-server}. @var{configuration-file} is the server configuration |
| 5451 | file or a derivation that builds it; when omitted, the result of | ||
| 5452 | @code{xorg-configuration-file} is used. | ||
| 5453 | |||
| 5454 | Usually the X server is started by a login manager. | ||
| 5455 | @end deffn | ||
| 5456 | |||
| 5457 | @deffn {Monadic Procedure} xorg-configuration-file @ | ||
| 5458 | [#:drivers '()] [#:resolutions '()] [#:extra-config '()] | ||
| 5459 | Return a configuration file for the Xorg server containing search paths for | ||
| 5460 | all the common drivers. | ||
| 4909 | 5461 | ||
| 4910 | @var{drivers} must be either the empty list, in which case Xorg chooses a | 5462 | @var{drivers} must be either the empty list, in which case Xorg chooses a |
| 4911 | graphics driver automatically, or a list of driver names that will be tried in | 5463 | graphics driver automatically, or a list of driver names that will be tried in |
| 4912 | this order---e.g., @code{("modesetting" "vesa")}. | 5464 | this order---e.g., @code{(\"modesetting\" \"vesa\")}. |
| 4913 | 5465 | ||
| 4914 | Likewise, when @var{resolutions} is the empty list, Xorg chooses an | 5466 | Likewise, when @var{resolutions} is the empty list, Xorg chooses an |
| 4915 | appropriate screen resolution; otherwise, it must be a list of | 5467 | appropriate screen resolution; otherwise, it must be a list of |
| 4916 | resolutions---e.g., @code{((1024 768) (640 480))}. | 5468 | resolutions---e.g., @code{((1024 768) (640 480))}. |
| 5469 | |||
| 5470 | Last, @var{extra-config} is a list of strings or objects appended to the | ||
| 5471 | @code{text-file*} argument list. It is used to pass extra text to be added | ||
| 5472 | verbatim to the configuration file. | ||
| 4917 | @end deffn | 5473 | @end deffn |
| 4918 | 5474 | ||
| 4919 | @node Various Services | 5475 | @node Desktop Services |
| 4920 | @subsubsection Various Services | 5476 | @subsubsection Desktop Services |
| 4921 | 5477 | ||
| 4922 | The @code{(gnu services lirc)} module provides the following service. | 5478 | The @code{(gnu services desktop)} module provides services that are |
| 5479 | usually useful in the context of a ``desktop'' setup---that is, on a | ||
| 5480 | machine running a graphical display server, possibly with graphical user | ||
| 5481 | interfaces, etc. | ||
| 4923 | 5482 | ||
| 4924 | @deffn {Monadic Procedure} lirc-service [#:lirc lirc] @ | 5483 | To simplify things, the module defines a variable containing the set of |
| 4925 | [#:device #f] [#:driver #f] [#:config-file #f] @ | 5484 | services that users typically expect on a machine with a graphical |
| 4926 | [#:extra-options '()] | 5485 | environment and networking: |
| 4927 | Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that | ||
| 4928 | decodes infrared signals from remote controls. | ||
| 4929 | 5486 | ||
| 4930 | Optionally, @var{device}, @var{driver} and @var{config-file} | 5487 | @defvr {Scheme Variable} %desktop-services |
| 4931 | (configuration file name) may be specified. See @command{lircd} manual | 5488 | This is a list of services that builds upon @var{%base-services} and |
| 4932 | for details. | 5489 | adds or adjust services for a typical ``desktop'' setup. |
| 4933 | 5490 | ||
| 4934 | Finally, @var{extra-options} is a list of additional command-line options | 5491 | In particular, it adds a graphical login manager (@pxref{X Window, |
| 4935 | passed to @command{lircd}. | 5492 | @code{slim-service}}), a network management tool (@pxref{Networking |
| 4936 | @end deffn | 5493 | Services, @code{wicd-service}}), energy and color management services, |
| 5494 | an NTP client and an SSH server (@pxref{Networking Services}), the Avahi | ||
| 5495 | daemon, and has the name service switch service configured to be able to | ||
| 5496 | use @code{nss-mdns} (@pxref{Name Service Switch, mDNS}). | ||
| 5497 | @end defvr | ||
| 5498 | |||
| 5499 | The @var{%desktop-services} variable can be used as the @code{services} | ||
| 5500 | field of an @code{operating-system} declaration (@pxref{operating-system | ||
| 5501 | Reference, @code{services}}). | ||
| 5502 | |||
| 5503 | The actual service definitions provided by @code{(gnu services desktop)} | ||
| 5504 | are described below. | ||
| 4937 | 5505 | ||
| 4938 | @code{(gnu services upower)} provides a power-management daemon: | 5506 | @deffn {Monadic Procedure} dbus-service @var{services} @ |
| 5507 | [#:dbus @var{dbus}] | ||
| 5508 | Return a service that runs the ``system bus'', using @var{dbus}, with | ||
| 5509 | support for @var{services}. | ||
| 5510 | |||
| 5511 | @uref{http://dbus.freedesktop.org/, D-Bus} is an inter-process communication | ||
| 5512 | facility. Its system bus is used to allow system services to communicate | ||
| 5513 | and be notified of system-wide events. | ||
| 5514 | |||
| 5515 | @var{services} must be a list of packages that provide an | ||
| 5516 | @file{etc/dbus-1/system.d} directory containing additional D-Bus configuration | ||
| 5517 | and policy files. For example, to allow avahi-daemon to use the system bus, | ||
| 5518 | @var{services} must be equal to @code{(list avahi)}. | ||
| 5519 | @end deffn | ||
| 4939 | 5520 | ||
| 4940 | @deffn {Monadic Procedure} upower-service [#:upower @var{upower}] @ | 5521 | @deffn {Monadic Procedure} upower-service [#:upower @var{upower}] @ |
| 4941 | [#:watts-up-pro? #f] @ | 5522 | [#:watts-up-pro? #f] @ |
| @@ -4956,8 +5537,6 @@ levels, with the given configuration settings. It implements the | |||
| 4956 | GNOME. | 5537 | GNOME. |
| 4957 | @end deffn | 5538 | @end deffn |
| 4958 | 5539 | ||
| 4959 | @code{(gnu services colord)} provides a color management service: | ||
| 4960 | |||
| 4961 | @deffn {Monadic Procedure} colord-service [#:colord @var{colord}] | 5540 | @deffn {Monadic Procedure} colord-service [#:colord @var{colord}] |
| 4962 | Return a service that runs @command{colord}, a system service with a D-Bus | 5541 | Return a service that runs @command{colord}, a system service with a D-Bus |
| 4963 | interface to manage the color profiles of input and output devices such as | 5542 | interface to manage the color profiles of input and output devices such as |
| @@ -4966,6 +5545,41 @@ tool. See @uref{http://www.freedesktop.org/software/colord/, the colord web | |||
| 4966 | site} for more information. | 5545 | site} for more information. |
| 4967 | @end deffn | 5546 | @end deffn |
| 4968 | 5547 | ||
| 5548 | @node Database Services | ||
| 5549 | @subsubsection Database Services | ||
| 5550 | |||
| 5551 | The @code{(gnu services databases)} module provides the following service. | ||
| 5552 | |||
| 5553 | @deffn {Monadic Procedure} postgresql-service [#:postgresql postgresql] @ | ||
| 5554 | [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] | ||
| 5555 | Return a service that runs @var{postgresql}, the PostgreSQL database | ||
| 5556 | server. | ||
| 5557 | |||
| 5558 | The PostgreSQL daemon loads its runtime configuration from | ||
| 5559 | @var{config-file} and stores the database cluster in | ||
| 5560 | @var{data-directory}. | ||
| 5561 | @end deffn | ||
| 5562 | |||
| 5563 | @node Various Services | ||
| 5564 | @subsubsection Various Services | ||
| 5565 | |||
| 5566 | The @code{(gnu services lirc)} module provides the following service. | ||
| 5567 | |||
| 5568 | @deffn {Monadic Procedure} lirc-service [#:lirc lirc] @ | ||
| 5569 | [#:device #f] [#:driver #f] [#:config-file #f] @ | ||
| 5570 | [#:extra-options '()] | ||
| 5571 | Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that | ||
| 5572 | decodes infrared signals from remote controls. | ||
| 5573 | |||
| 5574 | Optionally, @var{device}, @var{driver} and @var{config-file} | ||
| 5575 | (configuration file name) may be specified. See @command{lircd} manual | ||
| 5576 | for details. | ||
| 5577 | |||
| 5578 | Finally, @var{extra-options} is a list of additional command-line options | ||
| 5579 | passed to @command{lircd}. | ||
| 5580 | @end deffn | ||
| 5581 | |||
| 5582 | |||
| 4969 | @node Setuid Programs | 5583 | @node Setuid Programs |
| 4970 | @subsection Setuid Programs | 5584 | @subsection Setuid Programs |
| 4971 | 5585 | ||
| @@ -5012,6 +5626,48 @@ Under the hood, the actual setuid programs are created in the | |||
| 5012 | files in this directory refer to the ``real'' binaries, which are in the | 5626 | files in this directory refer to the ``real'' binaries, which are in the |
| 5013 | store. | 5627 | store. |
| 5014 | 5628 | ||
| 5629 | @node X.509 Certificates | ||
| 5630 | @subsection X.509 Certificates | ||
| 5631 | |||
| 5632 | @cindex HTTPS, certificates | ||
| 5633 | @cindex X.509 certificates | ||
| 5634 | @cindex TLS | ||
| 5635 | Web servers available over HTTPS (that is, HTTP over the transport-layer | ||
| 5636 | security mechanism, TLS) send client programs an @dfn{X.509 certificate} | ||
| 5637 | that the client can then use to @emph{authenticate} the server. To do | ||
| 5638 | that, clients verify that the server's certificate is signed by a | ||
| 5639 | so-called @dfn{certificate authority} (CA). But to verify the CA's | ||
| 5640 | signature, clients must have first acquired the CA's certificate. | ||
| 5641 | |||
| 5642 | Web browsers such as GNU@tie{}IceCat include their own set of CA | ||
| 5643 | certificates, such that they are able to verify CA signatures | ||
| 5644 | out-of-the-box. | ||
| 5645 | |||
| 5646 | However, most other programs that can talk HTTPS---@command{wget}, | ||
| 5647 | @command{git}, @command{w3m}, etc.---need to be told where CA | ||
| 5648 | certificates can be found. | ||
| 5649 | |||
| 5650 | @cindex @code{nss-certs} | ||
| 5651 | In GuixSD, this is done by adding a package that provides certificates | ||
| 5652 | to the @code{packages} field of the @code{operating-system} declaration | ||
| 5653 | (@pxref{operating-system Reference}). GuixSD includes one such package, | ||
| 5654 | @code{nss-certs}, which is a set of CA certificates provided as part of | ||
| 5655 | Mozilla's Network Security Services. | ||
| 5656 | |||
| 5657 | Note that it is @emph{not} part of @var{%base-packages}, so you need to | ||
| 5658 | explicitly add it. The @file{/etc/ssl/certs} directory, which is where | ||
| 5659 | most applications and libraries look for certificates by default, points | ||
| 5660 | to the certificates installed globally. | ||
| 5661 | |||
| 5662 | Unprivileged users can also install their own certificate package in | ||
| 5663 | their profile. A number of environment variables need to be defined so | ||
| 5664 | that applications and libraries know where to find them. Namely, the | ||
| 5665 | OpenSSL library honors the @code{SSL_CERT_DIR} and @code{SSL_CERT_FILE} | ||
| 5666 | variables. Some applications add their own environment variables; for | ||
| 5667 | instance, the Git version control system honors the certificate bundle | ||
| 5668 | pointed to by the @code{GIT_SSL_CAINFO} environment variable. | ||
| 5669 | |||
| 5670 | |||
| 5015 | @node Name Service Switch | 5671 | @node Name Service Switch |
| 5016 | @subsection Name Service Switch | 5672 | @subsection Name Service Switch |
| 5017 | 5673 | ||
| @@ -5064,6 +5720,10 @@ for host names ending in @code{.local}: | |||
| 5064 | (name "mdns"))))) | 5720 | (name "mdns"))))) |
| 5065 | @end example | 5721 | @end example |
| 5066 | 5722 | ||
| 5723 | Don't worry: the @code{%mdns-host-lookup-nss} variable (see below) | ||
| 5724 | contains this configuration, so you won't have to type it if all you | ||
| 5725 | want is to have @code{.local} host lookup working. | ||
| 5726 | |||
| 5067 | Note that, in this case, in addition to setting the | 5727 | Note that, in this case, in addition to setting the |
| 5068 | @code{name-service-switch} of the @code{operating-system} declaration, | 5728 | @code{name-service-switch} of the @code{operating-system} declaration, |
| 5069 | @code{nscd-service} must be told where to find the @code{nss-mdns} | 5729 | @code{nscd-service} must be told where to find the @code{nss-mdns} |
| @@ -5091,6 +5751,21 @@ configuration file: | |||
| 5091 | @noindent | 5751 | @noindent |
| 5092 | @dots{} and then refer to @var{%my-base-services} instead of | 5752 | @dots{} and then refer to @var{%my-base-services} instead of |
| 5093 | @var{%base-services} in the @code{operating-system} declaration. | 5753 | @var{%base-services} in the @code{operating-system} declaration. |
| 5754 | Lastly, this relies on the availability of the Avahi service | ||
| 5755 | (@pxref{Networking Services, @code{avahi-service}}). | ||
| 5756 | |||
| 5757 | For convenience, the following variables provide typical NSS | ||
| 5758 | configurations. | ||
| 5759 | |||
| 5760 | @defvr {Scheme Variable} %default-nss | ||
| 5761 | This is the default name service switch configuration, a | ||
| 5762 | @code{name-service-switch} object. | ||
| 5763 | @end defvr | ||
| 5764 | |||
| 5765 | @defvr {Scheme Variable} %mdns-host-lookup-nss | ||
| 5766 | This is the name service switch configuration with support for host name | ||
| 5767 | lookup over multicast DNS (mDNS) for host names ending in @code{.local}. | ||
| 5768 | @end defvr | ||
| 5094 | 5769 | ||
| 5095 | The reference for name service switch configuration is given below. It | 5770 | The reference for name service switch configuration is given below. It |
| 5096 | is a direct mapping of the C library's configuration file format, so | 5771 | is a direct mapping of the C library's configuration file format, so |
| @@ -5101,11 +5776,6 @@ not only of adding this warm parenthetic feel that we like, but also | |||
| 5101 | static checks: you'll know about syntax errors and typos as soon as you | 5776 | static checks: you'll know about syntax errors and typos as soon as you |
| 5102 | run @command{guix system}. | 5777 | run @command{guix system}. |
| 5103 | 5778 | ||
| 5104 | @defvr {Scheme Variable} %default-nss | ||
| 5105 | This is the default name service switch configuration, a | ||
| 5106 | @code{name-service-switch} object. | ||
| 5107 | @end defvr | ||
| 5108 | |||
| 5109 | @deftp {Data Type} name-service-switch | 5779 | @deftp {Data Type} name-service-switch |
| 5110 | 5780 | ||
| 5111 | This is the data type representation the configuration of libc's name | 5781 | This is the data type representation the configuration of libc's name |
| @@ -5355,7 +6025,7 @@ This action does not actually install anything. | |||
| 5355 | @item init | 6025 | @item init |
| 5356 | Populate the given directory with all the files necessary to run the | 6026 | Populate the given directory with all the files necessary to run the |
| 5357 | operating system specified in @var{file}. This is useful for first-time | 6027 | operating system specified in @var{file}. This is useful for first-time |
| 5358 | installations of GSD. For instance: | 6028 | installations of GuixSD. For instance: |
| 5359 | 6029 | ||
| 5360 | @example | 6030 | @example |
| 5361 | guix system init my-os-config.scm /mnt | 6031 | guix system init my-os-config.scm /mnt |
| @@ -5438,6 +6108,25 @@ For the @code{vm-image} and @code{disk-image} actions, create an image | |||
| 5438 | of the given @var{size}. @var{size} may be a number of bytes, or it may | 6108 | of the given @var{size}. @var{size} may be a number of bytes, or it may |
| 5439 | include a unit as a suffix (@pxref{Block size, size specifications,, | 6109 | include a unit as a suffix (@pxref{Block size, size specifications,, |
| 5440 | coreutils, GNU Coreutils}). | 6110 | coreutils, GNU Coreutils}). |
| 6111 | |||
| 6112 | @item --on-error=@var{strategy} | ||
| 6113 | Apply @var{strategy} when an error occurs when reading @var{file}. | ||
| 6114 | @var{strategy} may be one of the following: | ||
| 6115 | |||
| 6116 | @table @code | ||
| 6117 | @item nothing-special | ||
| 6118 | Report the error concisely and exit. This is the default strategy. | ||
| 6119 | |||
| 6120 | @item backtrace | ||
| 6121 | Likewise, but also display a backtrace. | ||
| 6122 | |||
| 6123 | @item debug | ||
| 6124 | Report the error and enter Guile's debugger. From there, you can run | ||
| 6125 | commands such as @code{,bt} to get a backtrace, @code{,locals} to | ||
| 6126 | display local variable values, and more generally inspect the program's | ||
| 6127 | state. @xref{Debug Commands,,, guile, GNU Guile Reference Manual}, for | ||
| 6128 | a list of available debugging commands. | ||
| 6129 | @end table | ||
| 5441 | @end table | 6130 | @end table |
| 5442 | 6131 | ||
| 5443 | Note that all the actions above, except @code{build} and @code{init}, | 6132 | Note that all the actions above, except @code{build} and @code{init}, |
| @@ -5650,11 +6339,15 @@ facility is implemented in the @code{(gnu packages)} module. | |||
| 5650 | @cindex package module search path | 6339 | @cindex package module search path |
| 5651 | Users can store package definitions in modules with different | 6340 | Users can store package definitions in modules with different |
| 5652 | names---e.g., @code{(my-packages emacs)}@footnote{Note that the file | 6341 | names---e.g., @code{(my-packages emacs)}@footnote{Note that the file |
| 5653 | name and module name must match. @xref{Modules and the File System,,, | 6342 | name and module name must match. For instance, the @code{(my-packages |
| 5654 | guile, GNU Guile Reference Manual}, for details.} These package definitions | 6343 | emacs)} module must be stored in a @file{my-packages/emacs.scm} file |
| 6344 | relative to the load path specified with @option{--load-path} or | ||
| 6345 | @code{GUIX_PACKAGE_PATH}. @xref{Modules and the File System,,, | ||
| 6346 | guile, GNU Guile Reference Manual}, for details.}. These package definitions | ||
| 5655 | will not be visible by default. Thus, users can invoke commands such as | 6347 | will not be visible by default. Thus, users can invoke commands such as |
| 5656 | @command{guix package} and @command{guix build} have to be used with the | 6348 | @command{guix package} and @command{guix build} have to be used with the |
| 5657 | @code{-e} option so that they know where to find the package, or use the | 6349 | @code{-e} option so that they know where to find the package. Better |
| 6350 | yet, they can use the | ||
| 5658 | @code{-L} option of these commands to make those modules visible | 6351 | @code{-L} option of these commands to make those modules visible |
| 5659 | (@pxref{Invoking guix build, @code{--load-path}}), or define the | 6352 | (@pxref{Invoking guix build, @code{--load-path}}), or define the |
| 5660 | @code{GUIX_PACKAGE_PATH} environment variable. This environment | 6353 | @code{GUIX_PACKAGE_PATH} environment variable. This environment |
| @@ -5702,7 +6395,8 @@ creating packages. For more information on package definitions, | |||
| 5702 | Once a package definition is in place, stored in a file in the Guix | 6395 | Once a package definition is in place, stored in a file in the Guix |
| 5703 | source tree, it can be tested using the @command{guix build} command | 6396 | source tree, it can be tested using the @command{guix build} command |
| 5704 | (@pxref{Invoking guix build}). For example, assuming the new package is | 6397 | (@pxref{Invoking guix build}). For example, assuming the new package is |
| 5705 | called @code{gnew}, you may run this command from the Guix build tree: | 6398 | called @code{gnew}, you may run this command from the Guix build tree |
| 6399 | (@pxref{Running Guix Before It Is Installed}): | ||
| 5706 | 6400 | ||
| 5707 | @example | 6401 | @example |
| 5708 | ./pre-inst-env guix build gnew --keep-failed | 6402 | ./pre-inst-env guix build gnew --keep-failed |
| @@ -26,6 +26,7 @@ ELFILES = \ | |||
| 26 | emacs/guix-info.el \ | 26 | emacs/guix-info.el \ |
| 27 | emacs/guix-list.el \ | 27 | emacs/guix-list.el \ |
| 28 | emacs/guix-messages.el \ | 28 | emacs/guix-messages.el \ |
| 29 | emacs/guix-pcomplete.el \ | ||
| 29 | emacs/guix-prettify.el \ | 30 | emacs/guix-prettify.el \ |
| 30 | emacs/guix-utils.el \ | 31 | emacs/guix-utils.el \ |
| 31 | emacs/guix.el | 32 | emacs/guix.el |
diff --git a/emacs/guix-base.el b/emacs/guix-base.el index 5129c87a5df..851ee895b98 100644 --- a/emacs/guix-base.el +++ b/emacs/guix-base.el | |||
| @@ -439,6 +439,7 @@ following keywords are available: | |||
| 439 | (define-key map (kbd "r") 'guix-history-forward) | 439 | (define-key map (kbd "r") 'guix-history-forward) |
| 440 | (define-key map (kbd "g") 'revert-buffer) | 440 | (define-key map (kbd "g") 'revert-buffer) |
| 441 | (define-key map (kbd "R") 'guix-redisplay-buffer) | 441 | (define-key map (kbd "R") 'guix-redisplay-buffer) |
| 442 | (define-key map (kbd "M") 'guix-apply-manifest) | ||
| 442 | (define-key map (kbd "C-c C-z") 'guix-switch-to-repl))))) | 443 | (define-key map (kbd "C-c C-z") 'guix-switch-to-repl))))) |
| 443 | 444 | ||
| 444 | (put 'guix-define-buffer-type 'lisp-indent-function 'defun) | 445 | (put 'guix-define-buffer-type 'lisp-indent-function 'defun) |
| @@ -1022,6 +1023,32 @@ Ask a user with PROMPT for continuing an operation." | |||
| 1022 | :dry-run? (or guix-dry-run 'f)) | 1023 | :dry-run? (or guix-dry-run 'f)) |
| 1023 | nil 'source-download))) | 1024 | nil 'source-download))) |
| 1024 | 1025 | ||
| 1026 | ;;;###autoload | ||
| 1027 | (defun guix-apply-manifest (profile file &optional operation-buffer) | ||
| 1028 | "Apply manifest from FILE to PROFILE. | ||
| 1029 | This function has the same meaning as 'guix package --manifest' command. | ||
| 1030 | See Info node `(guix) Invoking guix package' for details. | ||
| 1031 | |||
| 1032 | Interactively, use the current profile and prompt for manifest | ||
| 1033 | FILE. With a prefix argument, also prompt for PROFILE." | ||
| 1034 | (interactive | ||
| 1035 | (let* ((default-profile (or guix-profile guix-current-profile)) | ||
| 1036 | (profile (if current-prefix-arg | ||
| 1037 | (guix-profile-prompt) | ||
| 1038 | default-profile)) | ||
| 1039 | (file (read-file-name "File with manifest: ")) | ||
| 1040 | (buffer (and guix-profile (current-buffer)))) | ||
| 1041 | (list profile file buffer))) | ||
| 1042 | (when (or (not guix-operation-confirm) | ||
| 1043 | (y-or-n-p (format "Apply manifest from '%s' to profile '%s'? " | ||
| 1044 | file profile))) | ||
| 1045 | (guix-eval-in-repl | ||
| 1046 | (guix-make-guile-expression | ||
| 1047 | 'guix-package | ||
| 1048 | (concat "--profile=" profile) | ||
| 1049 | (concat "--manifest=" file)) | ||
| 1050 | operation-buffer))) | ||
| 1051 | |||
| 1025 | 1052 | ||
| 1026 | ;;; Pull | 1053 | ;;; Pull |
| 1027 | 1054 | ||
diff --git a/emacs/guix-list.el b/emacs/guix-list.el index 600f2bd9bd4..279de818c66 100644 --- a/emacs/guix-list.el +++ b/emacs/guix-list.el | |||
| @@ -292,13 +292,11 @@ See `guix-list-marked' for the meaning of ARGS." | |||
| 292 | See `guix-list-get-marked' for details." | 292 | See `guix-list-get-marked' for details." |
| 293 | (mapcar #'car (apply #'guix-list-get-marked mark-names))) | 293 | (mapcar #'car (apply #'guix-list-get-marked mark-names))) |
| 294 | 294 | ||
| 295 | (defun guix-list-mark (mark-name &optional advance &rest args) | 295 | (defun guix-list--mark (mark-name &optional advance &rest args) |
| 296 | "Put a mark on the current line. | 296 | "Put a mark on the current line. |
| 297 | Also add the current entry to `guix-list-marked' using its ID and ARGS. | 297 | Also add the current entry to `guix-list-marked' using its ID and ARGS. |
| 298 | MARK-NAME is a symbol from `guix-list-mark-alist'. | 298 | MARK-NAME is a symbol from `guix-list-mark-alist'. |
| 299 | If ADVANCE is non-nil, move forward by one line after marking. | 299 | If ADVANCE is non-nil, move forward by one line after marking." |
| 300 | Interactively, put a general mark and move to the next line." | ||
| 301 | (interactive '(general t)) | ||
| 302 | (let ((id (guix-list-current-id))) | 300 | (let ((id (guix-list-current-id))) |
| 303 | (if (eq mark-name 'empty) | 301 | (if (eq mark-name 'empty) |
| 304 | (setq guix-list-marked (assq-delete-all id guix-list-marked)) | 302 | (setq guix-list-marked (assq-delete-all id guix-list-marked)) |
| @@ -310,12 +308,21 @@ Interactively, put a general mark and move to the next line." | |||
| 310 | (tabulated-list-put-tag (guix-list-get-mark-string mark-name) | 308 | (tabulated-list-put-tag (guix-list-get-mark-string mark-name) |
| 311 | advance)) | 309 | advance)) |
| 312 | 310 | ||
| 313 | (defun guix-list-mark-all (mark-name) | 311 | (defun guix-list-mark (&optional arg) |
| 312 | "Mark the current line and move to the next line. | ||
| 313 | With ARG, mark all lines." | ||
| 314 | (interactive "P") | ||
| 315 | (if arg | ||
| 316 | (guix-list-mark-all) | ||
| 317 | (guix-list--mark 'general t))) | ||
| 318 | |||
| 319 | (defun guix-list-mark-all (&optional mark-name) | ||
| 314 | "Mark all lines with MARK-NAME mark. | 320 | "Mark all lines with MARK-NAME mark. |
| 315 | MARK-NAME is a symbol from `guix-list-mark-alist'. | 321 | MARK-NAME is a symbol from `guix-list-mark-alist'. |
| 316 | Interactively, put a general mark on all lines." | 322 | Interactively, put a general mark on all lines." |
| 317 | (interactive '(general)) | 323 | (interactive) |
| 318 | (guix-list-for-each-line #'guix-list-mark mark-name)) | 324 | (or mark-name (setq mark-name 'general)) |
| 325 | (guix-list-for-each-line #'guix-list--mark mark-name)) | ||
| 319 | 326 | ||
| 320 | (defun guix-list-unmark (&optional arg) | 327 | (defun guix-list-unmark (&optional arg) |
| 321 | "Unmark the current line and move to the next line. | 328 | "Unmark the current line and move to the next line. |
| @@ -323,13 +330,13 @@ With ARG, unmark all lines." | |||
| 323 | (interactive "P") | 330 | (interactive "P") |
| 324 | (if arg | 331 | (if arg |
| 325 | (guix-list-unmark-all) | 332 | (guix-list-unmark-all) |
| 326 | (guix-list-mark 'empty t))) | 333 | (guix-list--mark 'empty t))) |
| 327 | 334 | ||
| 328 | (defun guix-list-unmark-backward () | 335 | (defun guix-list-unmark-backward () |
| 329 | "Move up one line and unmark it." | 336 | "Move up one line and unmark it." |
| 330 | (interactive) | 337 | (interactive) |
| 331 | (forward-line -1) | 338 | (forward-line -1) |
| 332 | (guix-list-mark 'empty)) | 339 | (guix-list--mark 'empty)) |
| 333 | 340 | ||
| 334 | (defun guix-list-unmark-all () | 341 | (defun guix-list-unmark-all () |
| 335 | "Unmark all lines." | 342 | "Unmark all lines." |
| @@ -360,7 +367,6 @@ Same as `tabulated-list-sort', but also restore marks after sorting." | |||
| 360 | (define-key map (kbd "RET") 'guix-list-describe) | 367 | (define-key map (kbd "RET") 'guix-list-describe) |
| 361 | (define-key map (kbd "m") 'guix-list-mark) | 368 | (define-key map (kbd "m") 'guix-list-mark) |
| 362 | (define-key map (kbd "*") 'guix-list-mark) | 369 | (define-key map (kbd "*") 'guix-list-mark) |
| 363 | (define-key map (kbd "M") 'guix-list-mark-all) | ||
| 364 | (define-key map (kbd "u") 'guix-list-unmark) | 370 | (define-key map (kbd "u") 'guix-list-unmark) |
| 365 | (define-key map (kbd "DEL") 'guix-list-unmark-backward) | 371 | (define-key map (kbd "DEL") 'guix-list-unmark-backward) |
| 366 | (define-key map [remap tabulated-list-sort] 'guix-list-sort) | 372 | (define-key map [remap tabulated-list-sort] 'guix-list-sort) |
| @@ -417,7 +423,7 @@ This macro defines the following functions: | |||
| 417 | ,(concat "Put '" mark-name-str "' mark and move to the next line.\n" | 423 | ,(concat "Put '" mark-name-str "' mark and move to the next line.\n" |
| 418 | "Also add the current entry to `guix-list-marked'.") | 424 | "Also add the current entry to `guix-list-marked'.") |
| 419 | (interactive) | 425 | (interactive) |
| 420 | (guix-list-mark ',mark-name t)))) | 426 | (guix-list--mark ',mark-name t)))) |
| 421 | marks-val) | 427 | marks-val) |
| 422 | 428 | ||
| 423 | (defun ,init-fun () | 429 | (defun ,init-fun () |
| @@ -531,7 +537,7 @@ AVAILABLE list, otherwise mark all DEFAULT outputs." | |||
| 531 | (guix-completing-read-multiple | 537 | (guix-completing-read-multiple |
| 532 | prompt available nil t) | 538 | prompt available nil t) |
| 533 | default))) | 539 | default))) |
| 534 | (apply #'guix-list-mark mark t outputs))) | 540 | (apply #'guix-list--mark mark t outputs))) |
| 535 | 541 | ||
| 536 | (defun guix-package-list-mark-install (&optional arg) | 542 | (defun guix-package-list-mark-install (&optional arg) |
| 537 | "Mark the current package for installation and move to the next line. | 543 | "Mark the current package for installation and move to the next line. |
| @@ -606,7 +612,7 @@ accept an entry as argument." | |||
| 606 | (interactive) | 612 | (interactive) |
| 607 | (guix-list-mark-package-upgrades | 613 | (guix-list-mark-package-upgrades |
| 608 | (lambda (entry) | 614 | (lambda (entry) |
| 609 | (apply #'guix-list-mark | 615 | (apply #'guix-list--mark |
| 610 | 'upgrade nil | 616 | 'upgrade nil |
| 611 | (guix-get-installed-outputs entry))))) | 617 | (guix-get-installed-outputs entry))))) |
| 612 | 618 | ||
| @@ -661,7 +667,7 @@ The specification is suitable for `guix-process-package-actions'." | |||
| 661 | (installed (guix-get-key-val entry 'installed))) | 667 | (installed (guix-get-key-val entry 'installed))) |
| 662 | (if installed | 668 | (if installed |
| 663 | (user-error "This output is already installed") | 669 | (user-error "This output is already installed") |
| 664 | (guix-list-mark 'install t)))) | 670 | (guix-list--mark 'install t)))) |
| 665 | 671 | ||
| 666 | (defun guix-output-list-mark-delete () | 672 | (defun guix-output-list-mark-delete () |
| 667 | "Mark the current output for deletion and move to the next line." | 673 | "Mark the current output for deletion and move to the next line." |
| @@ -670,7 +676,7 @@ The specification is suitable for `guix-process-package-actions'." | |||
| 670 | (let* ((entry (guix-list-current-entry)) | 676 | (let* ((entry (guix-list-current-entry)) |
| 671 | (installed (guix-get-key-val entry 'installed))) | 677 | (installed (guix-get-key-val entry 'installed))) |
| 672 | (if installed | 678 | (if installed |
| 673 | (guix-list-mark 'delete t) | 679 | (guix-list--mark 'delete t) |
| 674 | (user-error "This output is not installed")))) | 680 | (user-error "This output is not installed")))) |
| 675 | 681 | ||
| 676 | (defun guix-output-list-mark-upgrade () | 682 | (defun guix-output-list-mark-upgrade () |
| @@ -683,13 +689,13 @@ The specification is suitable for `guix-process-package-actions'." | |||
| 683 | (user-error "This output is not installed")) | 689 | (user-error "This output is not installed")) |
| 684 | (when (or (guix-get-key-val entry 'obsolete) | 690 | (when (or (guix-get-key-val entry 'obsolete) |
| 685 | (y-or-n-p "This output is not obsolete. Try to upgrade it anyway? ")) | 691 | (y-or-n-p "This output is not obsolete. Try to upgrade it anyway? ")) |
| 686 | (guix-list-mark 'upgrade t)))) | 692 | (guix-list--mark 'upgrade t)))) |
| 687 | 693 | ||
| 688 | (defun guix-output-list-mark-upgrades () | 694 | (defun guix-output-list-mark-upgrades () |
| 689 | "Mark all obsolete package outputs for upgrading." | 695 | "Mark all obsolete package outputs for upgrading." |
| 690 | (interactive) | 696 | (interactive) |
| 691 | (guix-list-mark-package-upgrades | 697 | (guix-list-mark-package-upgrades |
| 692 | (lambda (_) (guix-list-mark 'upgrade)))) | 698 | (lambda (_) (guix-list--mark 'upgrade)))) |
| 693 | 699 | ||
| 694 | (defun guix-output-list-execute () | 700 | (defun guix-output-list-execute () |
| 695 | "Perform actions on the marked outputs." | 701 | "Perform actions on the marked outputs." |
| @@ -850,7 +856,7 @@ With ARG, mark all generations for deletion." | |||
| 850 | (interactive "P") | 856 | (interactive "P") |
| 851 | (if arg | 857 | (if arg |
| 852 | (guix-list-mark-all 'delete) | 858 | (guix-list-mark-all 'delete) |
| 853 | (guix-list-mark 'delete t))) | 859 | (guix-list--mark 'delete t))) |
| 854 | 860 | ||
| 855 | (defun guix-generation-list-execute () | 861 | (defun guix-generation-list-execute () |
| 856 | "Delete marked generations." | 862 | "Delete marked generations." |
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm index b1662fbb809..c6e4a8259bf 100644 --- a/emacs/guix-main.scm +++ b/emacs/guix-main.scm | |||
| @@ -878,7 +878,8 @@ OUTPUTS is a list of package outputs (may be an empty list)." | |||
| 878 | (format #t (N_ "~a package in profile~%" | 878 | (format #t (N_ "~a package in profile~%" |
| 879 | "~a packages in profile~%" | 879 | "~a packages in profile~%" |
| 880 | count) | 880 | count) |
| 881 | count)))))))))) | 881 | count) |
| 882 | (display-search-paths entries profile)))))))))) | ||
| 882 | 883 | ||
| 883 | (define (delete-generations* profile generations) | 884 | (define (delete-generations* profile generations) |
| 884 | "Delete GENERATIONS from PROFILE. | 885 | "Delete GENERATIONS from PROFILE. |
diff --git a/emacs/guix-pcomplete.el b/emacs/guix-pcomplete.el new file mode 100644 index 00000000000..fa71dd5e211 --- /dev/null +++ b/emacs/guix-pcomplete.el | |||
| @@ -0,0 +1,392 @@ | |||
| 1 | ;;; guix-pcomplete.el --- Functions for completing guix commands -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright © 2015 Alex Kost <alezost@gmail.com> | ||
| 4 | |||
| 5 | ;; This file is part of GNU Guix. | ||
| 6 | |||
| 7 | ;; GNU Guix is free software; you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Guix is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;; This file provides completions for "guix" command that may be used in | ||
| 23 | ;; `shell', `eshell' and wherever `pcomplete' works. | ||
| 24 | |||
| 25 | ;;; Code: | ||
| 26 | |||
| 27 | (require 'pcomplete) | ||
| 28 | (require 'pcmpl-unix) | ||
| 29 | (require 'cl-lib) | ||
| 30 | (require 'guix-utils) | ||
| 31 | |||
| 32 | |||
| 33 | ;;; Regexps for parsing various "guix ..." outputs | ||
| 34 | |||
| 35 | (defvar guix-pcomplete-parse-package-regexp | ||
| 36 | (rx bol (group (one-or-more (not blank)))) | ||
| 37 | "Regexp used to find names of the packages.") | ||
| 38 | |||
| 39 | (defvar guix-pcomplete-parse-command-regexp | ||
| 40 | (rx bol " " | ||
| 41 | (group wordchar (one-or-more (or wordchar "-")))) | ||
| 42 | "Regexp used to find guix commands. | ||
| 43 | 'Command' means any option not prefixed with '-'. For example, | ||
| 44 | guix subcommand, system action, importer, etc.") | ||
| 45 | |||
| 46 | (defvar guix-pcomplete-parse-long-option-regexp | ||
| 47 | (rx (or " " ", ") | ||
| 48 | (group "--" (one-or-more (or wordchar "-")) | ||
| 49 | (zero-or-one "="))) | ||
| 50 | "Regexp used to find long options.") | ||
| 51 | |||
| 52 | (defvar guix-pcomplete-parse-short-option-regexp | ||
| 53 | (rx bol (one-or-more blank) | ||
| 54 | "-" (group (not (any "- ")))) | ||
| 55 | "Regexp used to find short options.") | ||
| 56 | |||
| 57 | (defvar guix-pcomplete-parse-linter-regexp | ||
| 58 | (rx bol "- " (group (one-or-more (or wordchar "-")))) | ||
| 59 | "Regexp used to find 'lint' checkers.") | ||
| 60 | |||
| 61 | (defvar guix-pcomplete-parse-regexp-group 1 | ||
| 62 | "Parenthesized expression of regexps used to find commands and | ||
| 63 | options.") | ||
| 64 | |||
| 65 | |||
| 66 | ;;; Non-receivable completions | ||
| 67 | |||
| 68 | (defvar guix-pcomplete-systems | ||
| 69 | '("x86_64-linux" "i686-linux" "armhf-linux" "mips64el-linux") | ||
| 70 | "List of supported systems.") | ||
| 71 | |||
| 72 | (defvar guix-pcomplete-hash-formats | ||
| 73 | '("nix-base32" "base32" "base16" "hex" "hexadecimal") | ||
| 74 | "List of supported hash formats.") | ||
| 75 | |||
| 76 | (defvar guix-pcomplete-refresh-subsets | ||
| 77 | '("core" "non-core") | ||
| 78 | "List of supported 'refresh' subsets.") | ||
| 79 | |||
| 80 | (defvar guix-pcomplete-key-policies | ||
| 81 | '("interactive" "always" "never") | ||
| 82 | "List of supported key download policies.") | ||
| 83 | |||
| 84 | |||
| 85 | ;;; Interacting with guix | ||
| 86 | |||
| 87 | (defcustom guix-pcomplete-guix-program (executable-find "guix") | ||
| 88 | "Name of the 'guix' program. | ||
| 89 | It is used to find guix commands, options, packages, etc." | ||
| 90 | :type 'file | ||
| 91 | :group 'pcomplete | ||
| 92 | :group 'guix) | ||
| 93 | |||
| 94 | (defun guix-pcomplete-run-guix (&rest args) | ||
| 95 | "Run `guix-pcomplete-guix-program' with ARGS. | ||
| 96 | Insert the output to the current buffer." | ||
| 97 | (apply #'call-process | ||
| 98 | guix-pcomplete-guix-program nil t nil args)) | ||
| 99 | |||
| 100 | (defun guix-pcomplete-run-guix-and-search (regexp &optional group | ||
| 101 | &rest args) | ||
| 102 | "Run `guix-pcomplete-guix-program' with ARGS and search for matches. | ||
| 103 | Return a list of strings matching REGEXP. | ||
| 104 | GROUP specifies a parenthesized expression used in REGEXP." | ||
| 105 | (with-temp-buffer | ||
| 106 | (apply #'guix-pcomplete-run-guix args) | ||
| 107 | (goto-char (point-min)) | ||
| 108 | (let (result) | ||
| 109 | (while (re-search-forward regexp nil t) | ||
| 110 | (push (match-string-no-properties group) result)) | ||
| 111 | (nreverse result)))) | ||
| 112 | |||
| 113 | (defmacro guix-pcomplete-define-options-finder (name docstring regexp | ||
| 114 | &optional filter) | ||
| 115 | "Define function NAME to receive guix options and commands. | ||
| 116 | |||
| 117 | The defined function takes an optional COMMAND argument. This | ||
| 118 | function will run 'guix COMMAND --help' (or 'guix --help' if | ||
| 119 | COMMAND is nil) using `guix-pcomplete-run-guix-and-search' and | ||
| 120 | return its result. | ||
| 121 | |||
| 122 | If FILTER is specified, it should be a function. The result is | ||
| 123 | passed to this FILTER as argument and the result value of this | ||
| 124 | function call is returned." | ||
| 125 | (declare (doc-string 2) (indent 1)) | ||
| 126 | `(guix-memoized-defun ,name (&optional command) | ||
| 127 | ,docstring | ||
| 128 | (let* ((args '("--help")) | ||
| 129 | (args (if command (cons command args) args)) | ||
| 130 | (res (apply #'guix-pcomplete-run-guix-and-search | ||
| 131 | ,regexp guix-pcomplete-parse-regexp-group args))) | ||
| 132 | ,(if filter | ||
| 133 | `(funcall ,filter res) | ||
| 134 | 'res)))) | ||
| 135 | |||
| 136 | (guix-pcomplete-define-options-finder guix-pcomplete-commands | ||
| 137 | "If COMMAND is nil, return a list of available guix commands. | ||
| 138 | If COMMAND is non-nil (it should be a string), return available | ||
| 139 | subcommands, actions, etc. for this guix COMMAND." | ||
| 140 | guix-pcomplete-parse-command-regexp) | ||
| 141 | |||
| 142 | (guix-pcomplete-define-options-finder guix-pcomplete-long-options | ||
| 143 | "Return a list of available long options for guix COMMAND." | ||
| 144 | guix-pcomplete-parse-long-option-regexp) | ||
| 145 | |||
| 146 | (guix-pcomplete-define-options-finder guix-pcomplete-short-options | ||
| 147 | "Return a string with available short options for guix COMMAND." | ||
| 148 | guix-pcomplete-parse-short-option-regexp | ||
| 149 | (lambda (list) | ||
| 150 | (mapconcat #'identity list ""))) | ||
| 151 | |||
| 152 | (guix-memoized-defun guix-pcomplete-all-packages () | ||
| 153 | "Return a list of all available Guix packages." | ||
| 154 | (guix-pcomplete-run-guix-and-search | ||
| 155 | guix-pcomplete-parse-package-regexp | ||
| 156 | guix-pcomplete-parse-regexp-group | ||
| 157 | "package" "--list-available")) | ||
| 158 | |||
| 159 | (guix-memoized-defun guix-pcomplete-installed-packages (&optional profile) | ||
| 160 | "Return a list of Guix packages installed in PROFILE." | ||
| 161 | (let* ((args (and profile | ||
| 162 | (list (concat "--profile=" profile)))) | ||
| 163 | (args (append '("package" "--list-installed") args))) | ||
| 164 | (apply #'guix-pcomplete-run-guix-and-search | ||
| 165 | guix-pcomplete-parse-package-regexp | ||
| 166 | guix-pcomplete-parse-regexp-group | ||
| 167 | args))) | ||
| 168 | |||
| 169 | (guix-memoized-defun guix-pcomplete-lint-checkers () | ||
| 170 | "Return a list of all available lint checkers." | ||
| 171 | (guix-pcomplete-run-guix-and-search | ||
| 172 | guix-pcomplete-parse-linter-regexp | ||
| 173 | guix-pcomplete-parse-regexp-group | ||
| 174 | "lint" "--list-checkers")) | ||
| 175 | |||
| 176 | |||
| 177 | ;;; Completing | ||
| 178 | |||
| 179 | (defvar guix-pcomplete-option-regexp (rx string-start "-") | ||
| 180 | "Regexp to match an option.") | ||
| 181 | |||
| 182 | (defvar guix-pcomplete-long-option-regexp (rx string-start "--") | ||
| 183 | "Regexp to match a long option.") | ||
| 184 | |||
| 185 | (defvar guix-pcomplete-long-option-with-arg-regexp | ||
| 186 | (rx string-start | ||
| 187 | (group "--" (one-or-more any)) "=" | ||
| 188 | (group (zero-or-more any))) | ||
| 189 | "Regexp to match a long option with its argument. | ||
| 190 | The first parenthesized group defines the option and the second | ||
| 191 | group - the argument.") | ||
| 192 | |||
| 193 | (defvar guix-pcomplete-short-option-with-arg-regexp | ||
| 194 | (rx string-start | ||
| 195 | (group "-" (not (any "-"))) | ||
| 196 | (group (zero-or-more any))) | ||
| 197 | "Regexp to match a short option with its argument. | ||
| 198 | The first parenthesized group defines the option and the second | ||
| 199 | group - the argument.") | ||
| 200 | |||
| 201 | (defun guix-pcomplete-match-option () | ||
| 202 | "Return non-nil, if the current argument is an option." | ||
| 203 | (pcomplete-match guix-pcomplete-option-regexp 0)) | ||
| 204 | |||
| 205 | (defun guix-pcomplete-match-long-option () | ||
| 206 | "Return non-nil, if the current argument is a long option." | ||
| 207 | (pcomplete-match guix-pcomplete-long-option-regexp 0)) | ||
| 208 | |||
| 209 | (defun guix-pcomplete-match-long-option-with-arg () | ||
| 210 | "Return non-nil, if the current argument is a long option with value." | ||
| 211 | (pcomplete-match guix-pcomplete-long-option-with-arg-regexp 0)) | ||
| 212 | |||
| 213 | (defun guix-pcomplete-match-short-option-with-arg () | ||
| 214 | "Return non-nil, if the current argument is a short option with value." | ||
| 215 | (pcomplete-match guix-pcomplete-short-option-with-arg-regexp 0)) | ||
| 216 | |||
| 217 | (defun guix-pcomplete-long-option-arg (option args) | ||
| 218 | "Return a long OPTION's argument from a list of arguments ARGS." | ||
| 219 | (let* ((re (concat "\\`" option "=\\(.*\\)")) | ||
| 220 | (args (cl-member-if (lambda (arg) | ||
| 221 | (string-match re arg)) | ||
| 222 | args)) | ||
| 223 | (cur (car args))) | ||
| 224 | (when cur | ||
| 225 | (match-string-no-properties 1 cur)))) | ||
| 226 | |||
| 227 | (defun guix-pcomplete-short-option-arg (option args) | ||
| 228 | "Return a short OPTION's argument from a list of arguments ARGS." | ||
| 229 | (let* ((re (concat "\\`" option "\\(.*\\)")) | ||
| 230 | (args (cl-member-if (lambda (arg) | ||
| 231 | (string-match re arg)) | ||
| 232 | args)) | ||
| 233 | (cur (car args))) | ||
| 234 | (when cur | ||
| 235 | (let ((arg (match-string-no-properties 1 cur))) | ||
| 236 | (if (string= "" arg) | ||
| 237 | (cadr args) ; take the next arg | ||
| 238 | arg))))) | ||
| 239 | |||
| 240 | (defun guix-pcomplete-complete-comma-args (entries) | ||
| 241 | "Complete comma separated arguments using ENTRIES." | ||
| 242 | (let ((index pcomplete-index)) | ||
| 243 | (while (= index pcomplete-index) | ||
| 244 | (let* ((args (if (or (guix-pcomplete-match-long-option-with-arg) | ||
| 245 | (guix-pcomplete-match-short-option-with-arg)) | ||
| 246 | (pcomplete-match-string 2 0) | ||
| 247 | (pcomplete-arg 0))) | ||
| 248 | (input (if (string-match ".*,\\(.*\\)" args) | ||
| 249 | (match-string-no-properties 1 args) | ||
| 250 | args))) | ||
| 251 | (pcomplete-here* entries input))))) | ||
| 252 | |||
| 253 | (defun guix-pcomplete-complete-command-arg (command) | ||
| 254 | "Complete argument for guix COMMAND." | ||
| 255 | (cond | ||
| 256 | ((member command | ||
| 257 | '("archive" "build" "environment" "lint" "refresh")) | ||
| 258 | (while t | ||
| 259 | (pcomplete-here (guix-pcomplete-all-packages)))) | ||
| 260 | (t (pcomplete-here* (pcomplete-entries))))) | ||
| 261 | |||
| 262 | (defun guix-pcomplete-complete-option-arg (command option &optional input) | ||
| 263 | "Complete argument for COMMAND's OPTION. | ||
| 264 | INPUT is the current partially completed string." | ||
| 265 | (cl-flet ((option? (short long) | ||
| 266 | (or (string= option short) | ||
| 267 | (string= option long))) | ||
| 268 | (command? (&rest commands) | ||
| 269 | (member command commands)) | ||
| 270 | (complete (entries) | ||
| 271 | (pcomplete-here entries input nil t)) | ||
| 272 | (complete* (entries) | ||
| 273 | (pcomplete-here* entries input t))) | ||
| 274 | (cond | ||
| 275 | ((option? "-L" "--load-path") | ||
| 276 | (complete* (pcomplete-dirs))) | ||
| 277 | ((string= "--key-download" option) | ||
| 278 | (complete* guix-pcomplete-key-policies)) | ||
| 279 | |||
| 280 | ((command? "package") | ||
| 281 | (cond | ||
| 282 | ;; For '--install[=]' and '--remove[=]', try to complete a package | ||
| 283 | ;; name (INPUT) after the "=" sign, and then the rest packages | ||
| 284 | ;; separated with spaces. | ||
| 285 | ((option? "-i" "--install") | ||
| 286 | (complete (guix-pcomplete-all-packages)) | ||
| 287 | (while (not (guix-pcomplete-match-option)) | ||
| 288 | (pcomplete-here (guix-pcomplete-all-packages)))) | ||
| 289 | ((option? "-r" "--remove") | ||
| 290 | (let* ((profile (or (guix-pcomplete-short-option-arg | ||
| 291 | "-p" pcomplete-args) | ||
| 292 | (guix-pcomplete-long-option-arg | ||
| 293 | "--profile" pcomplete-args))) | ||
| 294 | (profile (and profile (expand-file-name profile)))) | ||
| 295 | (complete (guix-pcomplete-installed-packages profile)) | ||
| 296 | (while (not (guix-pcomplete-match-option)) | ||
| 297 | (pcomplete-here (guix-pcomplete-installed-packages profile))))) | ||
| 298 | ((string= "--show" option) | ||
| 299 | (complete (guix-pcomplete-all-packages))) | ||
| 300 | ((option? "-p" "--profile") | ||
| 301 | (complete* (pcomplete-dirs))) | ||
| 302 | ((option? "-m" "--manifest") | ||
| 303 | (complete* (pcomplete-entries))))) | ||
| 304 | |||
| 305 | ((and (command? "archive" "build") | ||
| 306 | (option? "-s" "--system")) | ||
| 307 | (complete* guix-pcomplete-systems)) | ||
| 308 | |||
| 309 | ((and (command? "build") | ||
| 310 | (option? "-r" "--root")) | ||
| 311 | (complete* (pcomplete-entries))) | ||
| 312 | |||
| 313 | ((and (command? "environment") | ||
| 314 | (option? "-l" "--load")) | ||
| 315 | (complete* (pcomplete-entries))) | ||
| 316 | |||
| 317 | ((and (command? "hash" "download") | ||
| 318 | (option? "-f" "--format")) | ||
| 319 | (complete* guix-pcomplete-hash-formats)) | ||
| 320 | |||
| 321 | ((and (command? "lint") | ||
| 322 | (option? "-c" "--checkers")) | ||
| 323 | (guix-pcomplete-complete-comma-args | ||
| 324 | (guix-pcomplete-lint-checkers))) | ||
| 325 | |||
| 326 | ((and (command? "publish") | ||
| 327 | (option? "-u" "--user")) | ||
| 328 | (complete* (pcmpl-unix-user-names))) | ||
| 329 | |||
| 330 | ((and (command? "refresh") | ||
| 331 | (option? "-s" "--select")) | ||
| 332 | (complete* guix-pcomplete-refresh-subsets))))) | ||
| 333 | |||
| 334 | (defun guix-pcomplete-complete-options (command) | ||
| 335 | "Complete options (with their arguments) for guix COMMAND." | ||
| 336 | (while (guix-pcomplete-match-option) | ||
| 337 | (let ((index pcomplete-index)) | ||
| 338 | (if (guix-pcomplete-match-long-option) | ||
| 339 | |||
| 340 | ;; Long options. | ||
| 341 | (if (guix-pcomplete-match-long-option-with-arg) | ||
| 342 | (let ((option (pcomplete-match-string 1 0)) | ||
| 343 | (arg (pcomplete-match-string 2 0))) | ||
| 344 | (guix-pcomplete-complete-option-arg | ||
| 345 | command option arg)) | ||
| 346 | |||
| 347 | (pcomplete-here* (guix-pcomplete-long-options command)) | ||
| 348 | ;; We support '--opt arg' style (along with '--opt=arg'), | ||
| 349 | ;; because 'guix package --install/--remove' may be used this | ||
| 350 | ;; way. So try to complete an argument after the option has | ||
| 351 | ;; been completed. | ||
| 352 | (unless (guix-pcomplete-match-option) | ||
| 353 | (guix-pcomplete-complete-option-arg | ||
| 354 | command (pcomplete-arg 0 -1)))) | ||
| 355 | |||
| 356 | ;; Short options. | ||
| 357 | (let ((arg (pcomplete-arg 0))) | ||
| 358 | (if (> (length arg) 2) | ||
| 359 | ;; Support specifying an argument after a short option without | ||
| 360 | ;; spaces (for example, '-L/tmp/foo'). | ||
| 361 | (guix-pcomplete-complete-option-arg | ||
| 362 | command | ||
| 363 | (substring-no-properties arg 0 2) | ||
| 364 | (substring-no-properties arg 2)) | ||
| 365 | (pcomplete-opt (guix-pcomplete-short-options command)) | ||
| 366 | (guix-pcomplete-complete-option-arg | ||
| 367 | command (pcomplete-arg 0 -1))))) | ||
| 368 | |||
| 369 | ;; If there were no completions, move to the next argument and get | ||
| 370 | ;; out if the last argument is achieved. | ||
| 371 | (when (= index pcomplete-index) | ||
| 372 | (if (= pcomplete-index pcomplete-last) | ||
| 373 | (throw 'pcompleted nil) | ||
| 374 | (pcomplete-next-arg)))))) | ||
| 375 | |||
| 376 | ;;;###autoload | ||
| 377 | (defun pcomplete/guix () | ||
| 378 | "Completion for `guix'." | ||
| 379 | (let ((commands (guix-pcomplete-commands))) | ||
| 380 | (pcomplete-here* (cons "--help" commands)) | ||
| 381 | (let ((command (pcomplete-arg 'first 1))) | ||
| 382 | (when (member command commands) | ||
| 383 | (guix-pcomplete-complete-options command) | ||
| 384 | (let ((subcommands (guix-pcomplete-commands command))) | ||
| 385 | (when subcommands | ||
| 386 | (pcomplete-here* subcommands))) | ||
| 387 | (guix-pcomplete-complete-options command) | ||
| 388 | (guix-pcomplete-complete-command-arg command))))) | ||
| 389 | |||
| 390 | (provide 'guix-pcomplete) | ||
| 391 | |||
| 392 | ;;; guix-pcomplete.el ends here | ||
diff --git a/emacs/guix-utils.el b/emacs/guix-utils.el index 823c6466106..dc0c58a114c 100644 --- a/emacs/guix-utils.el +++ b/emacs/guix-utils.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; guix-utils.el --- General utility functions | 1 | ;;; guix-utils.el --- General utility functions -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright © 2014 Alex Kost <alezost@gmail.com> | 3 | ;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com> |
| 4 | 4 | ||
| 5 | ;; This file is part of GNU Guix. | 5 | ;; This file is part of GNU Guix. |
| 6 | 6 | ||
| @@ -170,6 +170,35 @@ accessed with KEYS." | |||
| 170 | "Same as `diff', but use `guix-diff-switches' as default." | 170 | "Same as `diff', but use `guix-diff-switches' as default." |
| 171 | (diff old new (or switches guix-diff-switches) no-async)) | 171 | (diff old new (or switches guix-diff-switches) no-async)) |
| 172 | 172 | ||
| 173 | |||
| 174 | ;;; Memoizing | ||
| 175 | |||
| 176 | (defun guix-memoize (function) | ||
| 177 | "Return a memoized version of FUNCTION." | ||
| 178 | (let ((cache (make-hash-table :test 'equal))) | ||
| 179 | (lambda (&rest args) | ||
| 180 | (let ((result (gethash args cache 'not-found))) | ||
| 181 | (if (eq result 'not-found) | ||
| 182 | (let ((result (apply function args))) | ||
| 183 | (puthash args result cache) | ||
| 184 | result) | ||
| 185 | result))))) | ||
| 186 | |||
| 187 | (defmacro guix-memoized-defun (name arglist docstring &rest body) | ||
| 188 | "Define a memoized function NAME. | ||
| 189 | See `defun' for the meaning of arguments." | ||
| 190 | (declare (doc-string 3) (indent 2)) | ||
| 191 | `(defalias ',name | ||
| 192 | (guix-memoize (lambda ,arglist ,@body)) | ||
| 193 | ;; Add '(name args ...)' string with real arglist to the docstring, | ||
| 194 | ;; because *Help* will display '(name &rest ARGS)' for a defined | ||
| 195 | ;; function (since `guix-memoize' returns a lambda with '(&rest | ||
| 196 | ;; args)'). | ||
| 197 | ,(format "(%S %s)\n\n%s" | ||
| 198 | name | ||
| 199 | (mapconcat #'symbol-name arglist " ") | ||
| 200 | docstring))) | ||
| 201 | |||
| 173 | (provide 'guix-utils) | 202 | (provide 'guix-utils) |
| 174 | 203 | ||
| 175 | ;;; guix-utils.el ends here | 204 | ;;; guix-utils.el ends here |
diff --git a/gnu-system.am b/gnu-system.am index d4631d6c9ed..206c87680ee 100644 --- a/gnu-system.am +++ b/gnu-system.am | |||
| @@ -124,6 +124,7 @@ GNU_SYSTEM_MODULES = \ | |||
| 124 | gnu/packages/gl.scm \ | 124 | gnu/packages/gl.scm \ |
| 125 | gnu/packages/glib.scm \ | 125 | gnu/packages/glib.scm \ |
| 126 | gnu/packages/gnome.scm \ | 126 | gnu/packages/gnome.scm \ |
| 127 | gnu/packages/gnucash.scm \ | ||
| 127 | gnu/packages/gnunet.scm \ | 128 | gnu/packages/gnunet.scm \ |
| 128 | gnu/packages/gnupg.scm \ | 129 | gnu/packages/gnupg.scm \ |
| 129 | gnu/packages/gnustep.scm \ | 130 | gnu/packages/gnustep.scm \ |
| @@ -173,6 +174,7 @@ GNU_SYSTEM_MODULES = \ | |||
| 173 | gnu/packages/libffcall.scm \ | 174 | gnu/packages/libffcall.scm \ |
| 174 | gnu/packages/libffi.scm \ | 175 | gnu/packages/libffi.scm \ |
| 175 | gnu/packages/libftdi.scm \ | 176 | gnu/packages/libftdi.scm \ |
| 177 | gnu/packages/calendar.scm \ | ||
| 176 | gnu/packages/libidn.scm \ | 178 | gnu/packages/libidn.scm \ |
| 177 | gnu/packages/libphidget.scm \ | 179 | gnu/packages/libphidget.scm \ |
| 178 | gnu/packages/libreoffice.scm \ | 180 | gnu/packages/libreoffice.scm \ |
| @@ -217,6 +219,7 @@ GNU_SYSTEM_MODULES = \ | |||
| 217 | gnu/packages/ncurses.scm \ | 219 | gnu/packages/ncurses.scm \ |
| 218 | gnu/packages/netpbm.scm \ | 220 | gnu/packages/netpbm.scm \ |
| 219 | gnu/packages/nettle.scm \ | 221 | gnu/packages/nettle.scm \ |
| 222 | gnu/packages/networking.scm \ | ||
| 220 | gnu/packages/ninja.scm \ | 223 | gnu/packages/ninja.scm \ |
| 221 | gnu/packages/node.scm \ | 224 | gnu/packages/node.scm \ |
| 222 | gnu/packages/noweb.scm \ | 225 | gnu/packages/noweb.scm \ |
| @@ -273,13 +276,13 @@ GNU_SYSTEM_MODULES = \ | |||
| 273 | gnu/packages/slang.scm \ | 276 | gnu/packages/slang.scm \ |
| 274 | gnu/packages/slim.scm \ | 277 | gnu/packages/slim.scm \ |
| 275 | gnu/packages/smalltalk.scm \ | 278 | gnu/packages/smalltalk.scm \ |
| 276 | gnu/packages/socat.scm \ | ||
| 277 | gnu/packages/ssh.scm \ | 279 | gnu/packages/ssh.scm \ |
| 278 | gnu/packages/stalonetray.scm \ | 280 | gnu/packages/stalonetray.scm \ |
| 279 | gnu/packages/statistics.scm \ | 281 | gnu/packages/statistics.scm \ |
| 280 | gnu/packages/swig.scm \ | 282 | gnu/packages/swig.scm \ |
| 281 | gnu/packages/sxiv.scm \ | 283 | gnu/packages/sxiv.scm \ |
| 282 | gnu/packages/synergy.scm \ | 284 | gnu/packages/synergy.scm \ |
| 285 | gnu/packages/task-management.scm \ | ||
| 283 | gnu/packages/tbb.scm \ | 286 | gnu/packages/tbb.scm \ |
| 284 | gnu/packages/tcl.scm \ | 287 | gnu/packages/tcl.scm \ |
| 285 | gnu/packages/tcsh.scm \ | 288 | gnu/packages/tcsh.scm \ |
| @@ -291,6 +294,7 @@ GNU_SYSTEM_MODULES = \ | |||
| 291 | gnu/packages/tmux.scm \ | 294 | gnu/packages/tmux.scm \ |
| 292 | gnu/packages/tor.scm \ | 295 | gnu/packages/tor.scm \ |
| 293 | gnu/packages/tre.scm \ | 296 | gnu/packages/tre.scm \ |
| 297 | gnu/packages/tv.scm \ | ||
| 294 | gnu/packages/unrtf.scm \ | 298 | gnu/packages/unrtf.scm \ |
| 295 | gnu/packages/upnp.scm \ | 299 | gnu/packages/upnp.scm \ |
| 296 | gnu/packages/uucp.scm \ | 300 | gnu/packages/uucp.scm \ |
| @@ -327,13 +331,12 @@ GNU_SYSTEM_MODULES = \ | |||
| 327 | gnu/services.scm \ | 331 | gnu/services.scm \ |
| 328 | gnu/services/avahi.scm \ | 332 | gnu/services/avahi.scm \ |
| 329 | gnu/services/base.scm \ | 333 | gnu/services/base.scm \ |
| 330 | gnu/services/colord.scm \ | 334 | gnu/services/databases.scm \ |
| 331 | gnu/services/dbus.scm \ | 335 | gnu/services/desktop.scm \ |
| 332 | gnu/services/dmd.scm \ | 336 | gnu/services/dmd.scm \ |
| 333 | gnu/services/lirc.scm \ | 337 | gnu/services/lirc.scm \ |
| 334 | gnu/services/networking.scm \ | 338 | gnu/services/networking.scm \ |
| 335 | gnu/services/ssh.scm \ | 339 | gnu/services/ssh.scm \ |
| 336 | gnu/services/upower.scm \ | ||
| 337 | gnu/services/xorg.scm \ | 340 | gnu/services/xorg.scm \ |
| 338 | \ | 341 | \ |
| 339 | gnu/system.scm \ | 342 | gnu/system.scm \ |
| @@ -384,6 +387,7 @@ dist_patch_DATA = \ | |||
| 384 | gnu/packages/patches/bigloo-gc-shebangs.patch \ | 387 | gnu/packages/patches/bigloo-gc-shebangs.patch \ |
| 385 | gnu/packages/patches/binutils-ld-new-dtags.patch \ | 388 | gnu/packages/patches/binutils-ld-new-dtags.patch \ |
| 386 | gnu/packages/patches/binutils-loongson-workaround.patch \ | 389 | gnu/packages/patches/binutils-loongson-workaround.patch \ |
| 390 | gnu/packages/patches/bitlbee-configure-doc-fix.patch \ | ||
| 387 | gnu/packages/patches/calibre-drop-unrar.patch \ | 391 | gnu/packages/patches/calibre-drop-unrar.patch \ |
| 388 | gnu/packages/patches/calibre-no-updates-dialog.patch \ | 392 | gnu/packages/patches/calibre-no-updates-dialog.patch \ |
| 389 | gnu/packages/patches/cdparanoia-fpic.patch \ | 393 | gnu/packages/patches/cdparanoia-fpic.patch \ |
| @@ -403,8 +407,6 @@ dist_patch_DATA = \ | |||
| 403 | gnu/packages/patches/cssc-missing-include.patch \ | 407 | gnu/packages/patches/cssc-missing-include.patch \ |
| 404 | gnu/packages/patches/clucene-contribs-lib.patch \ | 408 | gnu/packages/patches/clucene-contribs-lib.patch \ |
| 405 | gnu/packages/patches/cursynth-wave-rand.patch \ | 409 | gnu/packages/patches/cursynth-wave-rand.patch \ |
| 406 | gnu/packages/patches/curl-support-capath-on-gnutls.patch \ | ||
| 407 | gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch \ | ||
| 408 | gnu/packages/patches/dbus-localstatedir.patch \ | 410 | gnu/packages/patches/dbus-localstatedir.patch \ |
| 409 | gnu/packages/patches/diffutils-gets-undeclared.patch \ | 411 | gnu/packages/patches/diffutils-gets-undeclared.patch \ |
| 410 | gnu/packages/patches/dfu-programmer-fix-libusb.patch \ | 412 | gnu/packages/patches/dfu-programmer-fix-libusb.patch \ |
| @@ -419,10 +421,13 @@ dist_patch_DATA = \ | |||
| 419 | gnu/packages/patches/findutils-localstatedir.patch \ | 421 | gnu/packages/patches/findutils-localstatedir.patch \ |
| 420 | gnu/packages/patches/flashrom-use-libftdi1.patch \ | 422 | gnu/packages/patches/flashrom-use-libftdi1.patch \ |
| 421 | gnu/packages/patches/flex-bison-tests.patch \ | 423 | gnu/packages/patches/flex-bison-tests.patch \ |
| 424 | gnu/packages/patches/fltk-shared-lib-defines.patch \ | ||
| 425 | gnu/packages/patches/fuse-CVE-2015-3202.patch \ | ||
| 422 | gnu/packages/patches/gawk-shell.patch \ | 426 | gnu/packages/patches/gawk-shell.patch \ |
| 423 | gnu/packages/patches/gcc-arm-link-spec-fix.patch \ | 427 | gnu/packages/patches/gcc-arm-link-spec-fix.patch \ |
| 424 | gnu/packages/patches/gcc-cross-environment-variables.patch \ | 428 | gnu/packages/patches/gcc-cross-environment-variables.patch \ |
| 425 | gnu/packages/patches/gcc-libvtv-runpath.patch \ | 429 | gnu/packages/patches/gcc-libvtv-runpath.patch \ |
| 430 | gnu/packages/patches/gcc-5.0-libvtv-runpath.patch \ | ||
| 426 | gnu/packages/patches/geoclue-config.patch \ | 431 | gnu/packages/patches/geoclue-config.patch \ |
| 427 | gnu/packages/patches/ghostscript-runpath.patch \ | 432 | gnu/packages/patches/ghostscript-runpath.patch \ |
| 428 | gnu/packages/patches/gitolite-openssh-6.8-compat.patch \ | 433 | gnu/packages/patches/gitolite-openssh-6.8-compat.patch \ |
| @@ -435,7 +440,6 @@ dist_patch_DATA = \ | |||
| 435 | gnu/packages/patches/glibc-ldd-x86_64.patch \ | 440 | gnu/packages/patches/glibc-ldd-x86_64.patch \ |
| 436 | gnu/packages/patches/glibc-locales.patch \ | 441 | gnu/packages/patches/glibc-locales.patch \ |
| 437 | gnu/packages/patches/gmp-arm-asm-nothumb.patch \ | 442 | gnu/packages/patches/gmp-arm-asm-nothumb.patch \ |
| 438 | gnu/packages/patches/gnutls-fix-duplicate-manpages.patch \ | ||
| 439 | gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \ | 443 | gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \ |
| 440 | gnu/packages/patches/gobject-introspection-cc.patch \ | 444 | gnu/packages/patches/gobject-introspection-cc.patch \ |
| 441 | gnu/packages/patches/gobject-introspection-girepository.patch \ | 445 | gnu/packages/patches/gobject-introspection-girepository.patch \ |
| @@ -447,10 +451,9 @@ dist_patch_DATA = \ | |||
| 447 | gnu/packages/patches/guile-default-utf8.patch \ | 451 | gnu/packages/patches/guile-default-utf8.patch \ |
| 448 | gnu/packages/patches/guile-linux-syscalls.patch \ | 452 | gnu/packages/patches/guile-linux-syscalls.patch \ |
| 449 | gnu/packages/patches/guile-relocatable.patch \ | 453 | gnu/packages/patches/guile-relocatable.patch \ |
| 450 | gnu/packages/patches/guix-test-networking.patch \ | ||
| 451 | gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ | 454 | gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ |
| 452 | gnu/packages/patches/hop-bigloo-4.0b.patch \ | 455 | gnu/packages/patches/hop-bigloo-4.0b.patch \ |
| 453 | gnu/packages/patches/inetutils-syslogd.patch \ | 456 | gnu/packages/patches/hop-linker-flags.patch \ |
| 454 | gnu/packages/patches/irrlicht-mesa-10.patch \ | 457 | gnu/packages/patches/irrlicht-mesa-10.patch \ |
| 455 | gnu/packages/patches/jbig2dec-ignore-testtest.patch \ | 458 | gnu/packages/patches/jbig2dec-ignore-testtest.patch \ |
| 456 | gnu/packages/patches/kmod-module-directory.patch \ | 459 | gnu/packages/patches/kmod-module-directory.patch \ |
| @@ -464,13 +467,11 @@ dist_patch_DATA = \ | |||
| 464 | gnu/packages/patches/liboop-mips64-deplibs-fix.patch \ | 467 | gnu/packages/patches/liboop-mips64-deplibs-fix.patch \ |
| 465 | gnu/packages/patches/libmad-mips-newgcc.patch \ | 468 | gnu/packages/patches/libmad-mips-newgcc.patch \ |
| 466 | gnu/packages/patches/libtheora-config-guess.patch \ | 469 | gnu/packages/patches/libtheora-config-guess.patch \ |
| 467 | gnu/packages/patches/libtool-skip-tests.patch \ | ||
| 468 | gnu/packages/patches/libtool-skip-tests2.patch \ | 470 | gnu/packages/patches/libtool-skip-tests2.patch \ |
| 469 | gnu/packages/patches/libssh-CVE-2014-0017.patch \ | 471 | gnu/packages/patches/libssh-CVE-2014-0017.patch \ |
| 470 | gnu/packages/patches/libvpx-fix-armhf-link.patch \ | 472 | gnu/packages/patches/libvpx-fix-armhf-link.patch \ |
| 471 | gnu/packages/patches/libvpx-fix-ssse3-quantize.patch \ | 473 | gnu/packages/patches/libvpx-fix-ssse3-quantize.patch \ |
| 472 | gnu/packages/patches/libvpx-vp9-out-of-bounds-access.patch \ | 474 | gnu/packages/patches/libvpx-vp9-out-of-bounds-access.patch \ |
| 473 | gnu/packages/patches/linux-libre-libreboot-fix.patch \ | ||
| 474 | gnu/packages/patches/lirc-localstatedir.patch \ | 475 | gnu/packages/patches/lirc-localstatedir.patch \ |
| 475 | gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ | 476 | gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ |
| 476 | gnu/packages/patches/lua51-liblua-so.patch \ | 477 | gnu/packages/patches/lua51-liblua-so.patch \ |
| @@ -479,6 +480,7 @@ dist_patch_DATA = \ | |||
| 479 | gnu/packages/patches/luit-posix.patch \ | 480 | gnu/packages/patches/luit-posix.patch \ |
| 480 | gnu/packages/patches/m4-gets-undeclared.patch \ | 481 | gnu/packages/patches/m4-gets-undeclared.patch \ |
| 481 | gnu/packages/patches/make-impure-dirs.patch \ | 482 | gnu/packages/patches/make-impure-dirs.patch \ |
| 483 | gnu/packages/patches/maxima-defsystem-mkdir.patch \ | ||
| 482 | gnu/packages/patches/mc-fix-ncurses-build.patch \ | 484 | gnu/packages/patches/mc-fix-ncurses-build.patch \ |
| 483 | gnu/packages/patches/mcron-install.patch \ | 485 | gnu/packages/patches/mcron-install.patch \ |
| 484 | gnu/packages/patches/mhash-keygen-test-segfault.patch \ | 486 | gnu/packages/patches/mhash-keygen-test-segfault.patch \ |
| @@ -523,14 +525,16 @@ dist_patch_DATA = \ | |||
| 523 | gnu/packages/patches/pyqt-configure.patch \ | 525 | gnu/packages/patches/pyqt-configure.patch \ |
| 524 | gnu/packages/patches/python-fix-tests.patch \ | 526 | gnu/packages/patches/python-fix-tests.patch \ |
| 525 | gnu/packages/patches/python-libffi-mips-n32-fix.patch \ | 527 | gnu/packages/patches/python-libffi-mips-n32-fix.patch \ |
| 526 | gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch \ | ||
| 527 | gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ | 528 | gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ |
| 528 | gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch \ | 529 | gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch \ |
| 529 | gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ | 530 | gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ |
| 531 | gnu/packages/patches/qemu-CVE-2015-3209.patch \ | ||
| 532 | gnu/packages/patches/qemu-CVE-2015-3456.patch \ | ||
| 530 | gnu/packages/patches/qt4-ldflags.patch \ | 533 | gnu/packages/patches/qt4-ldflags.patch \ |
| 531 | gnu/packages/patches/qt4-tests.patch \ | 534 | gnu/packages/patches/qt4-tests.patch \ |
| 532 | gnu/packages/patches/qt5-conflicting-typedefs.patch \ | 535 | gnu/packages/patches/qt5-conflicting-typedefs.patch \ |
| 533 | gnu/packages/patches/qt5-runpath.patch \ | 536 | gnu/packages/patches/qt5-runpath.patch \ |
| 537 | gnu/packages/patches/r-fix-15899.patch \ | ||
| 534 | gnu/packages/patches/ratpoison-shell.patch \ | 538 | gnu/packages/patches/ratpoison-shell.patch \ |
| 535 | gnu/packages/patches/readline-link-ncurses.patch \ | 539 | gnu/packages/patches/readline-link-ncurses.patch \ |
| 536 | gnu/packages/patches/ripperx-libm.patch \ | 540 | gnu/packages/patches/ripperx-libm.patch \ |
| @@ -538,17 +542,23 @@ dist_patch_DATA = \ | |||
| 538 | gnu/packages/patches/scheme48-tests.patch \ | 542 | gnu/packages/patches/scheme48-tests.patch \ |
| 539 | gnu/packages/patches/scotch-test-threading.patch \ | 543 | gnu/packages/patches/scotch-test-threading.patch \ |
| 540 | gnu/packages/patches/sdl-libx11-1.6.patch \ | 544 | gnu/packages/patches/sdl-libx11-1.6.patch \ |
| 545 | gnu/packages/patches/serf-comment-style-fix.patch \ | ||
| 546 | gnu/packages/patches/serf-deflate-buckets-test-fix.patch \ | ||
| 541 | gnu/packages/patches/slim-session.patch \ | 547 | gnu/packages/patches/slim-session.patch \ |
| 542 | gnu/packages/patches/slim-config.patch \ | 548 | gnu/packages/patches/slim-config.patch \ |
| 543 | gnu/packages/patches/slim-sigusr1.patch \ | 549 | gnu/packages/patches/slim-sigusr1.patch \ |
| 544 | gnu/packages/patches/soprano-find-clucene.patch \ | 550 | gnu/packages/patches/soprano-find-clucene.patch \ |
| 551 | gnu/packages/patches/subversion-sqlite-3.8.9-fix.patch \ | ||
| 545 | gnu/packages/patches/superlu-dist-scotchmetis.patch \ | 552 | gnu/packages/patches/superlu-dist-scotchmetis.patch \ |
| 546 | gnu/packages/patches/tar-d_ino_in_dirent-fix.patch \ | 553 | gnu/packages/patches/tar-d_ino_in_dirent-fix.patch \ |
| 547 | gnu/packages/patches/tcsh-fix-autotest.patch \ | 554 | gnu/packages/patches/tcsh-fix-autotest.patch \ |
| 548 | gnu/packages/patches/teckit-cstdio.patch \ | 555 | gnu/packages/patches/teckit-cstdio.patch \ |
| 549 | gnu/packages/patches/texi2html-document-encoding.patch \ | 556 | gnu/packages/patches/texi2html-document-encoding.patch \ |
| 550 | gnu/packages/patches/texi2html-i18n.patch \ | 557 | gnu/packages/patches/texi2html-i18n.patch \ |
| 551 | gnu/packages/patches/udev-gir-libtool.patch \ | 558 | gnu/packages/patches/tvtime-gcc41.patch \ |
| 559 | gnu/packages/patches/tvtime-pngoutput.patch \ | ||
| 560 | gnu/packages/patches/tvtime-videodev2.patch \ | ||
| 561 | gnu/packages/patches/tvtime-xmltv.patch \ | ||
| 552 | gnu/packages/patches/unzip-CVE-2014-8139.patch \ | 562 | gnu/packages/patches/unzip-CVE-2014-8139.patch \ |
| 553 | gnu/packages/patches/unzip-CVE-2014-8140.patch \ | 563 | gnu/packages/patches/unzip-CVE-2014-8140.patch \ |
| 554 | gnu/packages/patches/unzip-CVE-2014-8141.patch \ | 564 | gnu/packages/patches/unzip-CVE-2014-8141.patch \ |
| @@ -559,9 +569,17 @@ dist_patch_DATA = \ | |||
| 559 | gnu/packages/patches/vtk-mesa-10.patch \ | 569 | gnu/packages/patches/vtk-mesa-10.patch \ |
| 560 | gnu/packages/patches/w3m-fix-compile.patch \ | 570 | gnu/packages/patches/w3m-fix-compile.patch \ |
| 561 | gnu/packages/patches/weex-vacopy.patch \ | 571 | gnu/packages/patches/weex-vacopy.patch \ |
| 572 | gnu/packages/patches/wicd-template-instantiation.patch \ | ||
| 562 | gnu/packages/patches/wicd-urwid-1.3.patch \ | 573 | gnu/packages/patches/wicd-urwid-1.3.patch \ |
| 563 | gnu/packages/patches/wmctrl-64-fix.patch \ | 574 | gnu/packages/patches/wmctrl-64-fix.patch \ |
| 564 | gnu/packages/patches/wpa-supplicant-CVE-2015-1863.patch \ | 575 | gnu/packages/patches/wpa-supplicant-CVE-2015-1863.patch \ |
| 576 | gnu/packages/patches/wpa-supplicant-2015-2-fix.patch \ | ||
| 577 | gnu/packages/patches/wpa-supplicant-2015-3-fix.patch \ | ||
| 578 | gnu/packages/patches/wpa-supplicant-2015-4-fix-pt1.patch \ | ||
| 579 | gnu/packages/patches/wpa-supplicant-2015-4-fix-pt2.patch \ | ||
| 580 | gnu/packages/patches/wpa-supplicant-2015-4-fix-pt3.patch \ | ||
| 581 | gnu/packages/patches/wpa-supplicant-2015-4-fix-pt4.patch \ | ||
| 582 | gnu/packages/patches/wpa-supplicant-2015-4-fix-pt5.patch \ | ||
| 565 | gnu/packages/patches/xf86-video-ark-remove-mibstore.patch \ | 583 | gnu/packages/patches/xf86-video-ark-remove-mibstore.patch \ |
| 566 | gnu/packages/patches/xf86-video-ast-remove-mibstore.patch \ | 584 | gnu/packages/patches/xf86-video-ast-remove-mibstore.patch \ |
| 567 | gnu/packages/patches/xf86-video-geode-glibc-2.20.patch \ | 585 | gnu/packages/patches/xf86-video-geode-glibc-2.20.patch \ |
diff --git a/gnu/artwork.scm b/gnu/artwork.scm index c3b1695ba72..94c89143a65 100644 --- a/gnu/artwork.scm +++ b/gnu/artwork.scm | |||
| @@ -32,9 +32,9 @@ | |||
| 32 | (method git-fetch) | 32 | (method git-fetch) |
| 33 | (uri (git-reference | 33 | (uri (git-reference |
| 34 | (url "git://git.savannah.gnu.org/guix/guix-artwork.git") | 34 | (url "git://git.savannah.gnu.org/guix/guix-artwork.git") |
| 35 | (commit "61ae7c8"))) | 35 | (commit "6998d30"))) |
| 36 | (sha256 | 36 | (sha256 |
| 37 | (base32 | 37 | (base32 |
| 38 | "102fxk2l6b0ibry3n430q8ljhwrnbml9qgalzkz6v09r7sx6a532")))) | 38 | "0k7j3pj9s3zqiqmfkapypssvzx3f12yr0cc2rbzxqfii0b4clp1j")))) |
| 39 | 39 | ||
| 40 | ;;; artwork.scm ends here | 40 | ;;; artwork.scm ends here |
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 0c60355a1ce..352e7360504 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm | |||
| @@ -78,6 +78,11 @@ | |||
| 78 | (define (dot-or-dot-dot? file) | 78 | (define (dot-or-dot-dot? file) |
| 79 | (member file '("." ".."))) | 79 | (member file '("." ".."))) |
| 80 | 80 | ||
| 81 | (define (make-file-writable file) | ||
| 82 | "Make FILE writable for its owner.." | ||
| 83 | (let ((stat (lstat file))) ;XXX: symlinks | ||
| 84 | (chmod file (logior #o600 (stat:perms stat))))) | ||
| 85 | |||
| 81 | (define* (copy-account-skeletons home | 86 | (define* (copy-account-skeletons home |
| 82 | #:optional (directory %skeleton-directory)) | 87 | #:optional (directory %skeleton-directory)) |
| 83 | "Copy the account skeletons from DIRECTORY to HOME." | 88 | "Copy the account skeletons from DIRECTORY to HOME." |
| @@ -85,8 +90,21 @@ | |||
| 85 | string<?))) | 90 | string<?))) |
| 86 | (mkdir-p home) | 91 | (mkdir-p home) |
| 87 | (for-each (lambda (file) | 92 | (for-each (lambda (file) |
| 88 | (copy-file (string-append directory "/" file) | 93 | (let ((target (string-append home "/" file))) |
| 89 | (string-append home "/" file))) | 94 | (copy-file (string-append directory "/" file) target) |
| 95 | (make-file-writable target))) | ||
| 96 | files))) | ||
| 97 | |||
| 98 | (define* (make-skeletons-writable home | ||
| 99 | #:optional (directory %skeleton-directory)) | ||
| 100 | "Make sure that the files that have been copied from DIRECTORY to HOME are | ||
| 101 | owner-writable in HOME." | ||
| 102 | (let ((files (scandir directory (negate dot-or-dot-dot?) | ||
| 103 | string<?))) | ||
| 104 | (for-each (lambda (file) | ||
| 105 | (let ((target (string-append home "/" file))) | ||
| 106 | (when (file-exists? target) | ||
| 107 | (make-file-writable target)))) | ||
| 90 | files))) | 108 | files))) |
| 91 | 109 | ||
| 92 | (define* (add-user name group | 110 | (define* (add-user name group |
| @@ -128,7 +146,14 @@ properties. Return #t on success." | |||
| 128 | ,@(if password `("-p" ,password) '()) | 146 | ,@(if password `("-p" ,password) '()) |
| 129 | ,@(if system? '("--system") '()) | 147 | ,@(if system? '("--system") '()) |
| 130 | ,name))) | 148 | ,name))) |
| 131 | (zero? (apply system* "useradd" args))))) | 149 | (and (zero? (apply system* "useradd" args)) |
| 150 | (begin | ||
| 151 | ;; Since /etc/skel is a link to a directory in the store where | ||
| 152 | ;; all files have the writable bit cleared, and since 'useradd' | ||
| 153 | ;; preserves permissions when it copies them, explicitly make | ||
| 154 | ;; them writable. | ||
| 155 | (make-skeletons-writable home) | ||
| 156 | #t))))) | ||
| 132 | 157 | ||
| 133 | (define* (modify-user name group | 158 | (define* (modify-user name group |
| 134 | #:key uid comment home shell password system? | 159 | #:key uid comment home shell password system? |
| @@ -344,9 +369,11 @@ found in Linux 3.4 onward that prevents users from attaching to their own | |||
| 344 | processes--see Yama.txt in the Linux source tree for the rationale. This | 369 | processes--see Yama.txt in the Linux source tree for the rationale. This |
| 345 | sounds like an unacceptable restriction for little or no security | 370 | sounds like an unacceptable restriction for little or no security |
| 346 | improvement." | 371 | improvement." |
| 347 | (call-with-output-file "/proc/sys/kernel/yama/ptrace_scope" | 372 | (let ((file "/proc/sys/kernel/yama/ptrace_scope")) |
| 348 | (lambda (port) | 373 | (when (file-exists? file) |
| 349 | (display 0 port)))) | 374 | (call-with-output-file file |
| 375 | (lambda (port) | ||
| 376 | (display 0 port)))))) | ||
| 350 | 377 | ||
| 351 | 378 | ||
| 352 | (define %current-system | 379 | (define %current-system |
diff --git a/gnu/build/install.scm b/gnu/build/install.scm index 76536daf499..32fbe8efbc4 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm | |||
| @@ -133,9 +133,19 @@ includes /etc, /var, /run, /bin/sh, etc., and all the symlinks to SYSTEM." | |||
| 133 | (directives (%store-directory))) | 133 | (directives (%store-directory))) |
| 134 | 134 | ||
| 135 | ;; Add system generation 1. | 135 | ;; Add system generation 1. |
| 136 | (false-if-exception (delete-file "/var/guix/profiles/system-1-link")) | 136 | (let ((generation-1 (string-append target |
| 137 | (symlink system | 137 | "/var/guix/profiles/system-1-link"))) |
| 138 | (string-append target "/var/guix/profiles/system-1-link"))) | 138 | (let try () |
| 139 | (catch 'system-error | ||
| 140 | (lambda () | ||
| 141 | (symlink system generation-1)) | ||
| 142 | (lambda args | ||
| 143 | ;; If GENERATION-1 already exists, overwrite it. | ||
| 144 | (if (= EEXIST (system-error-errno args)) | ||
| 145 | (begin | ||
| 146 | (delete-file generation-1) | ||
| 147 | (try)) | ||
| 148 | (apply throw args))))))) | ||
| 139 | 149 | ||
| 140 | (define (reset-timestamps directory) | 150 | (define (reset-timestamps directory) |
| 141 | "Reset the timestamps of all the files under DIRECTORY, so that they appear | 151 | "Reset the timestamps of all the files under DIRECTORY, so that they appear |
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index f54e3d3a358..3081a93a975 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm | |||
| @@ -418,7 +418,6 @@ to it are lost." | |||
| 418 | (switch-root "/root") | 418 | (switch-root "/root") |
| 419 | (format #t "loading '~a'...\n" to-load) | 419 | (format #t "loading '~a'...\n" to-load) |
| 420 | 420 | ||
| 421 | ;; TODO: Remove /lib, /share, and /loader.go. | ||
| 422 | (primitive-load to-load) | 421 | (primitive-load to-load) |
| 423 | 422 | ||
| 424 | (format (current-error-port) | 423 | (format (current-error-port) |
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index ffaf6b4fc78..a96ce9cdfbf 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm | |||
| @@ -152,25 +152,20 @@ re-executing them as necessary.") | |||
| 152 | (define-public inetutils | 152 | (define-public inetutils |
| 153 | (package | 153 | (package |
| 154 | (name "inetutils") | 154 | (name "inetutils") |
| 155 | (version "1.9.2") | 155 | (version "1.9.3") |
| 156 | (source (origin | 156 | (source (origin |
| 157 | (method url-fetch) | 157 | (method url-fetch) |
| 158 | (uri (string-append "mirror://gnu/inetutils/inetutils-" | 158 | (uri (string-append "mirror://gnu/inetutils/inetutils-" |
| 159 | version ".tar.gz")) | 159 | version ".tar.gz")) |
| 160 | (sha256 | 160 | (sha256 |
| 161 | (base32 | 161 | (base32 |
| 162 | "04wrm0v7l4890mmbaawd6wjwdv08bkglgqhpz0q4dkb0l50fl8q4")) | 162 | "06dshajjpyi9sxi7qfki9gnp5r3nxvyvf81r81gx0x2qkqzqcxlj")))) |
| 163 | (patches (list (search-patch "inetutils-syslogd.patch"))))) | ||
| 164 | (build-system gnu-build-system) | 163 | (build-system gnu-build-system) |
| 165 | (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux, | 164 | (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux, |
| 166 | ;; which is currently missing. | 165 | ;; which is currently missing. |
| 167 | #:tests? #f)) | 166 | #:tests? #f)) |
| 168 | (inputs `(("ncurses" ,ncurses) | 167 | (inputs `(("ncurses" ,ncurses) |
| 169 | ("readline" ,readline))) ; for 'ftp' | 168 | ("readline" ,readline))) ; for 'ftp' |
| 170 | |||
| 171 | ;; Help2man is needed because of the patch that modifies syslogd.c. | ||
| 172 | (native-inputs `(("help2man" ,help2man))) | ||
| 173 | |||
| 174 | (home-page "http://www.gnu.org/software/inetutils/") | 169 | (home-page "http://www.gnu.org/software/inetutils/") |
| 175 | (synopsis "Basic networking utilities") | 170 | (synopsis "Basic networking utilities") |
| 176 | (description | 171 | (description |
| @@ -693,7 +688,7 @@ commands and their arguments.") | |||
| 693 | (define-public wpa-supplicant-light | 688 | (define-public wpa-supplicant-light |
| 694 | (package | 689 | (package |
| 695 | (name "wpa-supplicant-light") | 690 | (name "wpa-supplicant-light") |
| 696 | (version "2.3") | 691 | (version "2.4") |
| 697 | (source (origin | 692 | (source (origin |
| 698 | (method url-fetch) | 693 | (method url-fetch) |
| 699 | (uri (string-append | 694 | (uri (string-append |
| @@ -702,9 +697,16 @@ commands and their arguments.") | |||
| 702 | ".tar.gz")) | 697 | ".tar.gz")) |
| 703 | (sha256 | 698 | (sha256 |
| 704 | (base32 | 699 | (base32 |
| 705 | "0skvkl6c10ls4s48b2wmf47h9j1y40nlzxnzn8hyaw2j0prmpapa")) | 700 | "08li21q1wjn5chrv289w666il9ah1w419y3dkq2rl4wnq0rci385")) |
| 706 | (patches | 701 | (patches |
| 707 | (list (search-patch "wpa-supplicant-CVE-2015-1863.patch"))))) | 702 | (map search-patch '("wpa-supplicant-CVE-2015-1863.patch" |
| 703 | "wpa-supplicant-2015-2-fix.patch" | ||
| 704 | "wpa-supplicant-2015-3-fix.patch" | ||
| 705 | "wpa-supplicant-2015-4-fix-pt1.patch" | ||
| 706 | "wpa-supplicant-2015-4-fix-pt2.patch" | ||
| 707 | "wpa-supplicant-2015-4-fix-pt3.patch" | ||
| 708 | "wpa-supplicant-2015-4-fix-pt4.patch" | ||
| 709 | "wpa-supplicant-2015-4-fix-pt5.patch"))))) | ||
| 708 | (build-system gnu-build-system) | 710 | (build-system gnu-build-system) |
| 709 | (arguments | 711 | (arguments |
| 710 | '(#:phases (alist-replace | 712 | '(#:phases (alist-replace |
| @@ -872,7 +874,7 @@ module slots, and the list of I/O ports (e.g. serial, parallel, USB).") | |||
| 872 | (define-public acpica | 874 | (define-public acpica |
| 873 | (package | 875 | (package |
| 874 | (name "acpica") | 876 | (name "acpica") |
| 875 | (version "20140724") | 877 | (version "20150410") |
| 876 | (source (origin | 878 | (source (origin |
| 877 | (method url-fetch) | 879 | (method url-fetch) |
| 878 | (uri (string-append | 880 | (uri (string-append |
| @@ -880,7 +882,7 @@ module slots, and the list of I/O ports (e.g. serial, parallel, USB).") | |||
| 880 | version ".tar.gz")) | 882 | version ".tar.gz")) |
| 881 | (sha256 | 883 | (sha256 |
| 882 | (base32 | 884 | (base32 |
| 883 | "01vdgrh7dsxrrvg5yd8sxm63cw8210pnsi5qg9g15ac53gn243ac")))) | 885 | "0q1fjwkyw9x6gsva6fd0zbn7ly4fx0ha4853f416np9kf2irillw")))) |
| 884 | (build-system gnu-build-system) | 886 | (build-system gnu-build-system) |
| 885 | (native-inputs `(("flex" ,flex) | 887 | (native-inputs `(("flex" ,flex) |
| 886 | ("bison" ,bison))) | 888 | ("bison" ,bison))) |
diff --git a/gnu/packages/apr.scm b/gnu/packages/apr.scm index ed9c62819dc..8c57ee3ab29 100644 --- a/gnu/packages/apr.scm +++ b/gnu/packages/apr.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> | 2 | ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> |
| 3 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 6 | ;;; |
| @@ -18,25 +18,26 @@ | |||
| 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 19 | ||
| 20 | (define-module (gnu packages apr) | 20 | (define-module (gnu packages apr) |
| 21 | #:use-module (guix licenses) | 21 | #:use-module ((guix licenses) #:prefix l:) |
| 22 | #:use-module (guix packages) | 22 | #:use-module (guix packages) |
| 23 | #:use-module (guix download) | 23 | #:use-module (guix download) |
| 24 | #:use-module (guix build-system gnu) | 24 | #:use-module (guix build-system gnu) |
| 25 | #:use-module (gnu packages) | 25 | #:use-module (gnu packages) |
| 26 | #:use-module (gnu packages perl) | 26 | #:use-module (gnu packages perl) |
| 27 | #:use-module (gnu packages xml) | ||
| 27 | #:use-module (gnu packages autotools)) | 28 | #:use-module (gnu packages autotools)) |
| 28 | 29 | ||
| 29 | (define-public apr | 30 | (define-public apr |
| 30 | (package | 31 | (package |
| 31 | (name "apr") | 32 | (name "apr") |
| 32 | (version "1.5.1") | 33 | (version "1.5.2") |
| 33 | (source (origin | 34 | (source (origin |
| 34 | (method url-fetch) | 35 | (method url-fetch) |
| 35 | (uri (string-append "mirror://apache/apr/apr-" | 36 | (uri (string-append "mirror://apache/apr/apr-" |
| 36 | version ".tar.bz2")) | 37 | version ".tar.bz2")) |
| 37 | (sha256 | 38 | (sha256 |
| 38 | (base32 | 39 | (base32 |
| 39 | "1b4qw686bwjn19iyb0lg918q23xxd6s2gnyczhjq992d3m1vwjp9")) | 40 | "0ypn51xblix5ys9xy7da3ngdydip0qqh9rdq8nz54w9aq8lys0vx")) |
| 40 | (patches | 41 | (patches |
| 41 | (list (search-patch "apr-skip-getservbyname-test.patch"))) | 42 | (list (search-patch "apr-skip-getservbyname-test.patch"))) |
| 42 | (patch-flags '("-p0")))) | 43 | (patch-flags '("-p0")))) |
| @@ -59,7 +60,7 @@ an API to which software developers may code and be assured of predictable if | |||
| 59 | not identical behaviour regardless of the platform on which their software is | 60 | not identical behaviour regardless of the platform on which their software is |
| 60 | built, relieving them of the need to code special-case conditions to work | 61 | built, relieving them of the need to code special-case conditions to work |
| 61 | around or take advantage of platform-specific deficiencies or features.") | 62 | around or take advantage of platform-specific deficiencies or features.") |
| 62 | (license asl2.0))) | 63 | (license l:asl2.0))) |
| 63 | 64 | ||
| 64 | (define-public apr-util | 65 | (define-public apr-util |
| 65 | (package | 66 | (package |
| @@ -74,19 +75,23 @@ around or take advantage of platform-specific deficiencies or features.") | |||
| 74 | "0bn81pfscy9yjvbmyx442svf43s6dhrdfcsnkpxz43fai5qk5kx6")))) | 75 | "0bn81pfscy9yjvbmyx442svf43s6dhrdfcsnkpxz43fai5qk5kx6")))) |
| 75 | (build-system gnu-build-system) | 76 | (build-system gnu-build-system) |
| 76 | (inputs | 77 | (inputs |
| 77 | `(("apr" ,apr))) | 78 | `(("apr" ,apr))) |
| 79 | (propagated-inputs | ||
| 80 | `(("expat" ,expat))) | ||
| 78 | (arguments | 81 | (arguments |
| 79 | '(#:phases | 82 | '(#:phases |
| 80 | (alist-replace | 83 | (alist-replace |
| 81 | 'configure | 84 | 'configure |
| 82 | (lambda* (#:key inputs outputs #:allow-other-keys) | 85 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 83 | (let ((out (assoc-ref outputs "out")) | 86 | (let ((out (assoc-ref outputs "out")) |
| 84 | (apr (assoc-ref inputs "apr"))) | 87 | (apr (assoc-ref inputs "apr")) |
| 88 | (expat (assoc-ref inputs "expat"))) | ||
| 85 | (setenv "CONFIG_SHELL" (which "bash")) | 89 | (setenv "CONFIG_SHELL" (which "bash")) |
| 86 | (zero? | 90 | (zero? |
| 87 | (system* "./configure" | 91 | (system* "./configure" |
| 88 | (string-append "--prefix=" out) | 92 | (string-append "--prefix=" out) |
| 89 | (string-append "--with-apr=" apr))))) | 93 | (string-append "--with-apr=" apr) |
| 94 | (string-append "--with-expat=" expat))))) | ||
| 90 | %standard-phases) | 95 | %standard-phases) |
| 91 | 96 | ||
| 92 | ;; There are race conditions during 'make check'. Typically, the | 97 | ;; There are race conditions during 'make check'. Typically, the |
| @@ -98,4 +103,4 @@ around or take advantage of platform-specific deficiencies or features.") | |||
| 98 | (synopsis "One of the Apache Portable Runtime Library companions") | 103 | (synopsis "One of the Apache Portable Runtime Library companions") |
| 99 | (description | 104 | (description |
| 100 | "APR-util provides a number of helpful abstractions on top of APR.") | 105 | "APR-util provides a number of helpful abstractions on top of APR.") |
| 101 | (license asl2.0))) | 106 | (license l:asl2.0))) |
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 6cba704b6d5..fdc783a455b 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | 2 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
| 3 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> | 3 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
| 4 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | ||
| 4 | ;;; | 5 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 6 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 7 | ;;; |
| @@ -21,6 +22,7 @@ | |||
| 21 | #:use-module (guix packages) | 22 | #:use-module (guix packages) |
| 22 | #:use-module (guix download) | 23 | #:use-module (guix download) |
| 23 | #:use-module (guix git-download) | 24 | #:use-module (guix git-download) |
| 25 | #:use-module (guix utils) | ||
| 24 | #:use-module ((guix licenses) #:prefix license:) | 26 | #:use-module ((guix licenses) #:prefix license:) |
| 25 | #:use-module (guix build-system gnu) | 27 | #:use-module (guix build-system gnu) |
| 26 | #:use-module (guix build-system waf) | 28 | #:use-module (guix build-system waf) |
| @@ -128,7 +130,23 @@ attacks, performing pitch detection, tapping the beat and producing MIDI | |||
| 128 | streams from live audio.") | 130 | streams from live audio.") |
| 129 | (license license:gpl3+))) | 131 | (license license:gpl3+))) |
| 130 | 132 | ||
| 131 | (define-public ardour | 133 | (define (ardour-rpath-phase major-version) |
| 134 | `(lambda* (#:key outputs #:allow-other-keys) | ||
| 135 | (let ((libdir (string-append (assoc-ref outputs "out") | ||
| 136 | "/lib/ardour" ,major-version))) | ||
| 137 | (substitute* "wscript" | ||
| 138 | (("linker_flags = \\[\\]") | ||
| 139 | (string-append "linker_flags = [\"" | ||
| 140 | "-Wl,-rpath=" | ||
| 141 | libdir ":" | ||
| 142 | libdir "/backends" ":" | ||
| 143 | libdir "/engines" ":" | ||
| 144 | libdir "/panners" ":" | ||
| 145 | libdir "/surfaces" ":" | ||
| 146 | libdir "/vamp" "\"]")))) | ||
| 147 | #t)) | ||
| 148 | |||
| 149 | (define-public ardour-3 | ||
| 132 | (package | 150 | (package |
| 133 | (name "ardour") | 151 | (name "ardour") |
| 134 | (version "3.5.403") | 152 | (version "3.5.403") |
| @@ -140,6 +158,9 @@ streams from live audio.") | |||
| 140 | (url "git://git.ardour.org/ardour/ardour.git") | 158 | (url "git://git.ardour.org/ardour/ardour.git") |
| 141 | (commit version))) | 159 | (commit version))) |
| 142 | (snippet | 160 | (snippet |
| 161 | ;; Ardour expects this file to exist at build time. It can be | ||
| 162 | ;; created from a git checkout with: | ||
| 163 | ;; ./waf create_stored_revision | ||
| 143 | '(call-with-output-file | 164 | '(call-with-output-file |
| 144 | "libs/ardour/revision.cc" | 165 | "libs/ardour/revision.cc" |
| 145 | (lambda (port) | 166 | (lambda (port) |
| @@ -151,7 +172,12 @@ namespace ARDOUR { const char* revision = \"3.5-403-gec2cb31\" ; }")))) | |||
| 151 | (file-name (string-append name "-" version)))) | 172 | (file-name (string-append name "-" version)))) |
| 152 | (build-system waf-build-system) | 173 | (build-system waf-build-system) |
| 153 | (arguments | 174 | (arguments |
| 154 | `(#:tests? #f ; no check target | 175 | `(#:phases |
| 176 | (modify-phases %standard-phases | ||
| 177 | (add-after | ||
| 178 | 'unpack 'set-rpath-in-LDFLAGS | ||
| 179 | ,(ardour-rpath-phase (version-prefix version 1)))) | ||
| 180 | #:tests? #f ; no check target | ||
| 155 | #:python ,python-2)) | 181 | #:python ,python-2)) |
| 156 | (inputs | 182 | (inputs |
| 157 | `(("alsa-lib" ,alsa-lib) | 183 | `(("alsa-lib" ,alsa-lib) |
| @@ -183,8 +209,6 @@ namespace ARDOUR { const char* revision = \"3.5-403-gec2cb31\" ; }")))) | |||
| 183 | ("sratom" ,sratom) | 209 | ("sratom" ,sratom) |
| 184 | ("suil" ,suil) | 210 | ("suil" ,suil) |
| 185 | ("lilv" ,lilv) | 211 | ("lilv" ,lilv) |
| 186 | ("rasqal" ,rasqal) | ||
| 187 | ("raptor2" ,raptor2) | ||
| 188 | ("redland" ,redland) | 212 | ("redland" ,redland) |
| 189 | ("rubberband" ,rubberband) | 213 | ("rubberband" ,rubberband) |
| 190 | ("taglib" ,taglib) | 214 | ("taglib" ,taglib) |
| @@ -200,6 +224,35 @@ record, edit, mix and master audio and MIDI projects. It is targeted at audio | |||
| 200 | engineers, musicians, soundtrack editors and composers.") | 224 | engineers, musicians, soundtrack editors and composers.") |
| 201 | (license license:gpl2+))) | 225 | (license license:gpl2+))) |
| 202 | 226 | ||
| 227 | (define-public ardour | ||
| 228 | (package (inherit ardour-3) | ||
| 229 | (name "ardour") | ||
| 230 | (version "4.0") | ||
| 231 | (source (origin | ||
| 232 | (method git-fetch) | ||
| 233 | (uri (git-reference | ||
| 234 | (url "git://git.ardour.org/ardour/ardour.git") | ||
| 235 | (commit version))) | ||
| 236 | (snippet | ||
| 237 | ;; Ardour expects this file to exist at build time. It can be | ||
| 238 | ;; created from a git checkout with: | ||
| 239 | ;; ./waf create_stored_revision | ||
| 240 | '(call-with-output-file | ||
| 241 | "libs/ardour/revision.cc" | ||
| 242 | (lambda (port) | ||
| 243 | (format port "#include \"ardour/revision.h\" | ||
| 244 | namespace ARDOUR { const char* revision = \"4.0\" ; }")))) | ||
| 245 | (sha256 | ||
| 246 | (base32 | ||
| 247 | "0a8bydc24xv0cahdqfaxdmi1f43cyr9psiyshxpbrkdqw2c7a4xi")) | ||
| 248 | (file-name (string-append name "-" version)))) | ||
| 249 | (arguments | ||
| 250 | (substitute-keyword-arguments (package-arguments ardour-3) | ||
| 251 | ((#:phases phases) | ||
| 252 | `(modify-phases ,phases | ||
| 253 | (replace 'set-rpath-in-LDFLAGS | ||
| 254 | ,(ardour-rpath-phase (version-prefix version 1))))))))) | ||
| 255 | |||
| 203 | (define-public azr3 | 256 | (define-public azr3 |
| 204 | (package | 257 | (package |
| 205 | (name "azr3") | 258 | (name "azr3") |
| @@ -466,6 +519,46 @@ patches that can be used with softsynths such as Timidity and WildMidi.") | |||
| 466 | ;; GPLv2+ with exception for compositions using these patches. | 519 | ;; GPLv2+ with exception for compositions using these patches. |
| 467 | (license license:gpl2+))) | 520 | (license license:gpl2+))) |
| 468 | 521 | ||
| 522 | (define-public ir | ||
| 523 | (package | ||
| 524 | (name "ir") | ||
| 525 | (version "1.3.2") | ||
| 526 | (source (origin | ||
| 527 | (method url-fetch) | ||
| 528 | (uri (string-append | ||
| 529 | "http://factorial.hu/system/files/ir.lv2-" | ||
| 530 | version ".tar.gz")) | ||
| 531 | (sha256 | ||
| 532 | (base32 | ||
| 533 | "1jh2z01l9m4ar7yz0n911df07dygc7n4cl59p7qdjbh0nvkm747g")))) | ||
| 534 | (build-system gnu-build-system) | ||
| 535 | (arguments | ||
| 536 | `(#:tests? #f ;no "check" target | ||
| 537 | #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) | ||
| 538 | #:phases | ||
| 539 | ;; no configure script | ||
| 540 | (alist-delete 'configure %standard-phases))) | ||
| 541 | (inputs | ||
| 542 | `(("libsndfile" ,libsndfile) | ||
| 543 | ("libsamplerate" ,libsamplerate) | ||
| 544 | ("lv2" ,lv2) | ||
| 545 | ("glib" ,glib) | ||
| 546 | ("gtk+" ,gtk+-2) | ||
| 547 | ("zita-convolver" ,zita-convolver))) | ||
| 548 | (native-inputs | ||
| 549 | `(("pkg-config" ,pkg-config))) | ||
| 550 | (native-search-paths | ||
| 551 | (list (search-path-specification | ||
| 552 | (variable "LV2_PATH") | ||
| 553 | (files '("lib/lv2"))))) | ||
| 554 | (home-page "http://factorial.hu/plugins/lv2/ir") | ||
| 555 | (synopsis "LV2 convolution reverb") | ||
| 556 | (description | ||
| 557 | "IR is a low-latency, real-time, high performance signal convolver | ||
| 558 | especially for creating reverb effects. It supports impulse responses with 1, | ||
| 559 | 2 or 4 channels, in any soundfile format supported by libsndfile.") | ||
| 560 | (license license:gpl2+))) | ||
| 561 | |||
| 469 | (define-public jack-1 | 562 | (define-public jack-1 |
| 470 | (package | 563 | (package |
| 471 | (name "jack") | 564 | (name "jack") |
| @@ -898,10 +991,8 @@ buffers, and audio capture.") | |||
| 898 | ("boost" ,boost) | 991 | ("boost" ,boost) |
| 899 | ("jack" ,jack-1) | 992 | ("jack" ,jack-1) |
| 900 | ("ganv" ,ganv) | 993 | ("ganv" ,ganv) |
| 901 | ("glib" ,glib) | ||
| 902 | ("glibmm" ,glibmm) | 994 | ("glibmm" ,glibmm) |
| 903 | ("gtkmm" ,gtkmm-2) | 995 | ("gtkmm" ,gtkmm-2) |
| 904 | ("dbus" ,dbus) | ||
| 905 | ("dbus-glib" ,dbus-glib))) | 996 | ("dbus-glib" ,dbus-glib))) |
| 906 | (native-inputs | 997 | (native-inputs |
| 907 | `(("pkg-config" ,pkg-config))) | 998 | `(("pkg-config" ,pkg-config))) |
| @@ -1386,6 +1477,48 @@ directly to a different computer on your LAN network. It is an audio daemon | |||
| 1386 | with a much different focus than most other audio daemons.") | 1477 | with a much different focus than most other audio daemons.") |
| 1387 | (license license:gpl3+))) | 1478 | (license license:gpl3+))) |
| 1388 | 1479 | ||
| 1480 | (define-public zita-convolver | ||
| 1481 | (package | ||
| 1482 | (name "zita-convolver") | ||
| 1483 | (version "3.1.0") | ||
| 1484 | (source (origin | ||
| 1485 | (method url-fetch) | ||
| 1486 | (uri (string-append | ||
| 1487 | "http://kokkinizita.linuxaudio.org" | ||
| 1488 | "/linuxaudio/downloads/zita-convolver-" | ||
| 1489 | version ".tar.bz2")) | ||
| 1490 | (sha256 | ||
| 1491 | (base32 | ||
| 1492 | "14qrnczhp5mbwhky64il7kxc4hl1mmh495v60va7i2qnhasr6zmz")))) | ||
| 1493 | (build-system gnu-build-system) | ||
| 1494 | (arguments | ||
| 1495 | `(#:tests? #f ; no "check" target | ||
| 1496 | #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) | ||
| 1497 | #:phases | ||
| 1498 | (alist-cons-after | ||
| 1499 | 'unpack 'patch-makefile-and-enter-directory | ||
| 1500 | (lambda _ | ||
| 1501 | (substitute* "libs/Makefile" | ||
| 1502 | (("ldconfig") "true") | ||
| 1503 | (("^LIBDIR =.*") "LIBDIR = lib\n")) | ||
| 1504 | (chdir "libs") #t) | ||
| 1505 | (alist-cons-after | ||
| 1506 | 'install | ||
| 1507 | 'install-symlink | ||
| 1508 | (lambda _ | ||
| 1509 | (symlink "libzita-convolver.so" | ||
| 1510 | (string-append (assoc-ref %outputs "out") | ||
| 1511 | "/lib/libzita-convolver.so.3"))) | ||
| 1512 | ;; no configure script | ||
| 1513 | (alist-delete 'configure %standard-phases))))) | ||
| 1514 | (inputs `(("fftwf" ,fftwf))) | ||
| 1515 | (home-page "http://kokkinizita.linuxaudio.org") | ||
| 1516 | (synopsis "Fast, partitioned convolution engine library") | ||
| 1517 | (description | ||
| 1518 | "Zita convolver is a C++ library providing a real-time convolution | ||
| 1519 | engine.") | ||
| 1520 | (license license:gpl3+))) | ||
| 1521 | |||
| 1389 | (define-public zita-alsa-pcmi | 1522 | (define-public zita-alsa-pcmi |
| 1390 | (package | 1523 | (package |
| 1391 | (name "zita-alsa-pcmi") | 1524 | (name "zita-alsa-pcmi") |
diff --git a/gnu/packages/autogen.scm b/gnu/packages/autogen.scm index c27ea15e703..45b7cb81cc3 100644 --- a/gnu/packages/autogen.scm +++ b/gnu/packages/autogen.scm | |||
| @@ -23,13 +23,14 @@ | |||
| 23 | #:use-module (guix build-system gnu) | 23 | #:use-module (guix build-system gnu) |
| 24 | #:use-module (gnu packages) | 24 | #:use-module (gnu packages) |
| 25 | #:use-module (gnu packages perl) | 25 | #:use-module (gnu packages perl) |
| 26 | #:use-module (gnu packages pkg-config) | ||
| 26 | #:use-module (gnu packages base) | 27 | #:use-module (gnu packages base) |
| 27 | #:use-module (gnu packages guile)) | 28 | #:use-module (gnu packages guile)) |
| 28 | 29 | ||
| 29 | (define-public autogen | 30 | (define-public autogen |
| 30 | (package | 31 | (package |
| 31 | (name "autogen") | 32 | (name "autogen") |
| 32 | (version "5.18.4") | 33 | (version "5.18.5") |
| 33 | (source | 34 | (source |
| 34 | (origin | 35 | (origin |
| 35 | (method url-fetch) | 36 | (method url-fetch) |
| @@ -38,9 +39,10 @@ | |||
| 38 | version ".tar.gz")) | 39 | version ".tar.gz")) |
| 39 | (sha256 | 40 | (sha256 |
| 40 | (base32 | 41 | (base32 |
| 41 | "0pbjzwgvmjvi6nl1bcyhfc9kl93s6321dgmvp5dqdip7i8dgin9w")))) | 42 | "1flnbnmkbqmbfgammkl8m36wrlk6rhpgnf9pdm6gdfhqalxvggbv")))) |
| 42 | (build-system gnu-build-system) | 43 | (build-system gnu-build-system) |
| 43 | (native-inputs `(("perl" ,perl))) ;for doc generator mdoc | 44 | (native-inputs `(("perl" ,perl) ;for doc generator mdoc |
| 45 | ("pkg-config" ,pkg-config))) | ||
| 44 | (inputs `(("which" ,which) | 46 | (inputs `(("which" ,which) |
| 45 | ("guile" ,guile-2.0))) | 47 | ("guile" ,guile-2.0))) |
| 46 | (arguments | 48 | (arguments |
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index bcb7eba48fe..c7836f173e3 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #:use-module (guix git-download) | 24 | #:use-module (guix git-download) |
| 25 | #:use-module (guix build-system gnu) | 25 | #:use-module (guix build-system gnu) |
| 26 | #:use-module (guix build-system cmake) | 26 | #:use-module (guix build-system cmake) |
| 27 | #:use-module (guix build-system perl) | ||
| 27 | #:use-module (guix build-system python) | 28 | #:use-module (guix build-system python) |
| 28 | #:use-module (guix build-system trivial) | 29 | #:use-module (guix build-system trivial) |
| 29 | #:use-module (gnu packages) | 30 | #:use-module (gnu packages) |
| @@ -45,6 +46,7 @@ | |||
| 45 | #:use-module (gnu packages tbb) | 46 | #:use-module (gnu packages tbb) |
| 46 | #:use-module (gnu packages textutils) | 47 | #:use-module (gnu packages textutils) |
| 47 | #:use-module (gnu packages vim) | 48 | #:use-module (gnu packages vim) |
| 49 | #:use-module (gnu packages web) | ||
| 48 | #:use-module (gnu packages xml) | 50 | #:use-module (gnu packages xml) |
| 49 | #:use-module (gnu packages zip)) | 51 | #:use-module (gnu packages zip)) |
| 50 | 52 | ||
| @@ -62,7 +64,17 @@ | |||
| 62 | (base32 | 64 | (base32 |
| 63 | "1brry29bw2xr2l9pqn240rkqwayg85b8qq78zk2zs6nlspk4d018")))) | 65 | "1brry29bw2xr2l9pqn240rkqwayg85b8qq78zk2zs6nlspk4d018")))) |
| 64 | (build-system cmake-build-system) | 66 | (build-system cmake-build-system) |
| 65 | (arguments `(#:tests? #f)) ;no "check" target | 67 | (arguments |
| 68 | `(#:tests? #f ;no "check" target | ||
| 69 | #:phases | ||
| 70 | (modify-phases %standard-phases | ||
| 71 | (add-before | ||
| 72 | 'configure 'set-ldflags | ||
| 73 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 74 | (setenv "LDFLAGS" | ||
| 75 | (string-append | ||
| 76 | "-Wl,-rpath=" | ||
| 77 | (assoc-ref outputs "out") "/lib/bamtools"))))))) | ||
| 66 | (inputs `(("zlib" ,zlib))) | 78 | (inputs `(("zlib" ,zlib))) |
| 67 | (home-page "https://github.com/pezmaster31/bamtools") | 79 | (home-page "https://github.com/pezmaster31/bamtools") |
| 68 | (synopsis "C++ API and command-line toolkit for working with BAM data") | 80 | (synopsis "C++ API and command-line toolkit for working with BAM data") |
| @@ -532,6 +544,74 @@ file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.") | |||
| 532 | other types of unwanted sequence from high-throughput sequencing reads.") | 544 | other types of unwanted sequence from high-throughput sequencing reads.") |
| 533 | (license license:expat))) | 545 | (license license:expat))) |
| 534 | 546 | ||
| 547 | (define-public edirect | ||
| 548 | (package | ||
| 549 | (name "edirect") | ||
| 550 | (version "2.50") | ||
| 551 | (source (origin | ||
| 552 | (method url-fetch) | ||
| 553 | ;; Note: older versions are not retained. | ||
| 554 | (uri "ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.zip") | ||
| 555 | (sha256 | ||
| 556 | (base32 | ||
| 557 | "08afhz2ph66h8h381hl1mqyxkdi5nbvzsyj9gfw3jfbdijnpi4qj")))) | ||
| 558 | (build-system perl-build-system) | ||
| 559 | (arguments | ||
| 560 | `(#:tests? #f ;no "check" target | ||
| 561 | #:phases | ||
| 562 | (modify-phases %standard-phases | ||
| 563 | (delete 'configure) | ||
| 564 | (delete 'build) | ||
| 565 | (replace 'install | ||
| 566 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 567 | (let ((target (string-append (assoc-ref outputs "out") | ||
| 568 | "/bin"))) | ||
| 569 | (mkdir-p target) | ||
| 570 | (copy-file "edirect.pl" | ||
| 571 | (string-append target "/edirect.pl")) | ||
| 572 | #t))) | ||
| 573 | (add-after | ||
| 574 | 'install 'wrap-program | ||
| 575 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 576 | ;; Make sure 'edirect.pl' finds all perl inputs at runtime. | ||
| 577 | (let* ((out (assoc-ref outputs "out")) | ||
| 578 | (path (getenv "PERL5LIB"))) | ||
| 579 | (wrap-program (string-append out "/bin/edirect.pl") | ||
| 580 | `("PERL5LIB" ":" prefix (,path))))))))) | ||
| 581 | (inputs | ||
| 582 | `(("perl-html-parser" ,perl-html-parser) | ||
| 583 | ("perl-encode-locale" ,perl-encode-locale) | ||
| 584 | ("perl-file-listing" ,perl-file-listing) | ||
| 585 | ("perl-html-tagset" ,perl-html-tagset) | ||
| 586 | ("perl-html-tree" ,perl-html-tree) | ||
| 587 | ("perl-http-cookies" ,perl-http-cookies) | ||
| 588 | ("perl-http-date" ,perl-http-date) | ||
| 589 | ("perl-http-message" ,perl-http-message) | ||
| 590 | ("perl-http-negotiate" ,perl-http-negotiate) | ||
| 591 | ("perl-lwp-mediatypes" ,perl-lwp-mediatypes) | ||
| 592 | ("perl-lwp-protocol-https" ,perl-lwp-protocol-https) | ||
| 593 | ("perl-net-http" ,perl-net-http) | ||
| 594 | ("perl-uri" ,perl-uri) | ||
| 595 | ("perl-www-robotrules" ,perl-www-robotrules) | ||
| 596 | ("perl" ,perl))) | ||
| 597 | (native-inputs | ||
| 598 | `(("unzip" ,unzip))) | ||
| 599 | (home-page "http://www.ncbi.nlm.nih.gov/books/NBK179288") | ||
| 600 | (synopsis "Tools for accessing the NCBI's set of databases") | ||
| 601 | (description | ||
| 602 | "Entrez Direct (EDirect) is a method for accessing the National Center | ||
| 603 | for Biotechnology Information's (NCBI) set of interconnected | ||
| 604 | databases (publication, sequence, structure, gene, variation, expression, | ||
| 605 | etc.) from a terminal. Functions take search terms from command-line | ||
| 606 | arguments. Individual operations are combined to build multi-step queries. | ||
| 607 | Record retrieval and formatting normally complete the process. | ||
| 608 | |||
| 609 | EDirect also provides an argument-driven function that simplifies the | ||
| 610 | extraction of data from document summaries or other results that are returned | ||
| 611 | in structured XML format. This can eliminate the need for writing custom | ||
| 612 | software to answer ad hoc questions.") | ||
| 613 | (license license:public-domain))) | ||
| 614 | |||
| 535 | (define-public express | 615 | (define-public express |
| 536 | (package | 616 | (package |
| 537 | (name "express") | 617 | (name "express") |
| @@ -839,6 +919,41 @@ sequencing (HTS) data. There are also an number of useful utilities for | |||
| 839 | manipulating HTS data.") | 919 | manipulating HTS data.") |
| 840 | (license license:expat))) | 920 | (license license:expat))) |
| 841 | 921 | ||
| 922 | (define-public htslib | ||
| 923 | (package | ||
| 924 | (name "htslib") | ||
| 925 | (version "1.2.1") | ||
| 926 | (source (origin | ||
| 927 | (method url-fetch) | ||
| 928 | (uri (string-append | ||
| 929 | "https://github.com/samtools/htslib/releases/download/" | ||
| 930 | version "/htslib-" version ".tar.bz2")) | ||
| 931 | (sha256 | ||
| 932 | (base32 | ||
| 933 | "1c32ssscbnjwfw3dra140fq7riarp2x990qxybh34nr1p5r17nxx")))) | ||
| 934 | (build-system gnu-build-system) | ||
| 935 | (arguments | ||
| 936 | `(#:phases | ||
| 937 | (modify-phases %standard-phases | ||
| 938 | (add-after | ||
| 939 | 'unpack 'patch-tests | ||
| 940 | (lambda _ | ||
| 941 | (substitute* "test/test.pl" | ||
| 942 | (("/bin/bash") (which "bash"))) | ||
| 943 | #t))))) | ||
| 944 | (inputs | ||
| 945 | `(("zlib" ,zlib))) | ||
| 946 | (native-inputs | ||
| 947 | `(("perl" ,perl))) | ||
| 948 | (home-page "http://www.htslib.org") | ||
| 949 | (synopsis "C library for reading/writing high-throughput sequencing data") | ||
| 950 | (description | ||
| 951 | "HTSlib is a C library for reading/writing high-throughput sequencing | ||
| 952 | data. It also provides the bgzip, htsfile, and tabix utilities.") | ||
| 953 | ;; Files under cram/ are released under the modified BSD license; | ||
| 954 | ;; the rest is released under the Expat license | ||
| 955 | (license (list license:expat license:bsd-3)))) | ||
| 956 | |||
| 842 | (define-public macs | 957 | (define-public macs |
| 843 | (package | 958 | (package |
| 844 | (name "macs") | 959 | (name "macs") |
| @@ -1003,6 +1118,84 @@ files and writing bioinformatics applications.") | |||
| 1003 | generated using the PacBio Iso-Seq protocol.") | 1118 | generated using the PacBio Iso-Seq protocol.") |
| 1004 | (license license:bsd-3)))) | 1119 | (license license:bsd-3)))) |
| 1005 | 1120 | ||
| 1121 | (define-public rsem | ||
| 1122 | (package | ||
| 1123 | (name "rsem") | ||
| 1124 | (version "1.2.20") | ||
| 1125 | (source | ||
| 1126 | (origin | ||
| 1127 | (method url-fetch) | ||
| 1128 | (uri | ||
| 1129 | (string-append "http://deweylab.biostat.wisc.edu/rsem/src/rsem-" | ||
| 1130 | version ".tar.gz")) | ||
| 1131 | (sha256 | ||
| 1132 | (base32 "0nzdc0j0hjllhsd5f2xli95dafm3nawskigs140xzvjk67xh0r9q")) | ||
| 1133 | (patches (list (search-patch "rsem-makefile.patch"))) | ||
| 1134 | (modules '((guix build utils))) | ||
| 1135 | (snippet | ||
| 1136 | '(begin | ||
| 1137 | ;; remove bundled copy of boost | ||
| 1138 | (delete-file-recursively "boost") | ||
| 1139 | #t)))) | ||
| 1140 | (build-system gnu-build-system) | ||
| 1141 | (arguments | ||
| 1142 | `(#:tests? #f ;no "check" target | ||
| 1143 | #:phases | ||
| 1144 | (modify-phases %standard-phases | ||
| 1145 | ;; No "configure" script. | ||
| 1146 | ;; Do not build bundled samtools library. | ||
| 1147 | (replace 'configure | ||
| 1148 | (lambda _ | ||
| 1149 | (substitute* "Makefile" | ||
| 1150 | (("^all : sam/libbam.a") "all : ")) | ||
| 1151 | #t)) | ||
| 1152 | (replace 'install | ||
| 1153 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 1154 | (let* ((out (string-append (assoc-ref outputs "out"))) | ||
| 1155 | (bin (string-append out "/bin/")) | ||
| 1156 | (perl (string-append out "/lib/perl5/site_perl"))) | ||
| 1157 | (mkdir-p bin) | ||
| 1158 | (mkdir-p perl) | ||
| 1159 | (for-each (lambda (file) | ||
| 1160 | (copy-file file | ||
| 1161 | (string-append bin (basename file)))) | ||
| 1162 | (find-files "." "rsem-.*")) | ||
| 1163 | (copy-file "rsem_perl_utils.pm" | ||
| 1164 | (string-append perl "/rsem_perl_utils.pm"))) | ||
| 1165 | #t)) | ||
| 1166 | (add-after | ||
| 1167 | 'install 'wrap-program | ||
| 1168 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 1169 | (let ((out (assoc-ref outputs "out"))) | ||
| 1170 | (for-each (lambda (prog) | ||
| 1171 | (wrap-program (string-append out "/bin/" prog) | ||
| 1172 | `("PERL5LIB" ":" prefix | ||
| 1173 | (,(string-append out "/lib/perl5/site_perl"))))) | ||
| 1174 | '("rsem-plot-transcript-wiggles" | ||
| 1175 | "rsem-calculate-expression" | ||
| 1176 | "rsem-generate-ngvector" | ||
| 1177 | "rsem-run-ebseq" | ||
| 1178 | "rsem-prepare-reference"))) | ||
| 1179 | #t))))) | ||
| 1180 | (inputs | ||
| 1181 | `(("boost" ,boost) | ||
| 1182 | ("ncurses" ,ncurses) | ||
| 1183 | ("r" ,r) | ||
| 1184 | ("perl" ,perl) | ||
| 1185 | ("samtools" ,samtools-0.1) | ||
| 1186 | ("zlib" ,zlib))) | ||
| 1187 | (home-page "http://deweylab.biostat.wisc.edu/rsem/") | ||
| 1188 | (synopsis "Estimate gene expression levels from RNA-Seq data") | ||
| 1189 | (description | ||
| 1190 | "RSEM is a software package for estimating gene and isoform expression | ||
| 1191 | levels from RNA-Seq data. The RSEM package provides a user-friendly | ||
| 1192 | interface, supports threads for parallel computation of the EM algorithm, | ||
| 1193 | single-end and paired-end read data, quality scores, variable-length reads and | ||
| 1194 | RSPD estimation. In addition, it provides posterior mean and 95% credibility | ||
| 1195 | interval estimates for expression levels. For visualization, it can generate | ||
| 1196 | BAM and Wiggle files in both transcript-coordinate and genomic-coordinate.") | ||
| 1197 | (license license:gpl3+))) | ||
| 1198 | |||
| 1006 | (define-public rseqc | 1199 | (define-public rseqc |
| 1007 | (package | 1200 | (package |
| 1008 | (name "rseqc") | 1201 | (name "rseqc") |
| @@ -1068,32 +1261,31 @@ distribution, coverage uniformity, strand specificity, etc.") | |||
| 1068 | ;; systems. | 1261 | ;; systems. |
| 1069 | #:tests? ,(string=? (or (%current-system) (%current-target-system)) | 1262 | #:tests? ,(string=? (or (%current-system) (%current-target-system)) |
| 1070 | "x86_64-linux") | 1263 | "x86_64-linux") |
| 1071 | #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))) | 1264 | #:make-flags (list "LIBCURSES=-lncurses" |
| 1265 | (string-append "prefix=" (assoc-ref %outputs "out"))) | ||
| 1072 | #:phases | 1266 | #:phases |
| 1073 | (alist-cons-after | 1267 | (alist-cons-after |
| 1074 | 'unpack | 1268 | 'unpack |
| 1075 | 'patch-makefile-curses | 1269 | 'patch-tests |
| 1076 | (lambda _ | 1270 | (lambda* (#:key inputs #:allow-other-keys) |
| 1077 | (substitute* "Makefile" | 1271 | (let ((bash (assoc-ref inputs "bash"))) |
| 1078 | (("-lcurses") "-lncurses"))) | 1272 | (substitute* "test/test.pl" |
| 1273 | ;; The test script calls out to /bin/bash | ||
| 1274 | (("/bin/bash") | ||
| 1275 | (string-append bash "/bin/bash")) | ||
| 1276 | ;; There are two failing tests upstream relating to the "stats" | ||
| 1277 | ;; subcommand in test_usage_subcommand ("did not have Usage" | ||
| 1278 | ;; and "usage did not mention samtools stats"), so we disable | ||
| 1279 | ;; them. | ||
| 1280 | (("(test_usage_subcommand\\(.*\\);)" cmd) | ||
| 1281 | (string-append "unless ($subcommand eq 'stats') {" cmd "};"))))) | ||
| 1079 | (alist-cons-after | 1282 | (alist-cons-after |
| 1080 | 'unpack | 1283 | 'install 'install-library |
| 1081 | 'patch-tests | 1284 | (lambda* (#:key outputs #:allow-other-keys) |
| 1082 | (lambda* (#:key inputs #:allow-other-keys) | 1285 | (let ((lib (string-append (assoc-ref outputs "out") "/lib"))) |
| 1083 | (let ((bash (assoc-ref inputs "bash"))) | 1286 | (mkdir-p lib) |
| 1084 | (substitute* "test/test.pl" | 1287 | (copy-file "libbam.a" (string-append lib "/libbam.a")))) |
| 1085 | ;; The test script calls out to /bin/bash | 1288 | (alist-delete 'configure %standard-phases))))) |
| 1086 | (("/bin/bash") | ||
| 1087 | (string-append bash "/bin/bash")) | ||
| 1088 | ;; There are two failing tests upstream relating to the "stats" | ||
| 1089 | ;; subcommand in test_usage_subcommand ("did not have Usage" | ||
| 1090 | ;; and "usage did not mention samtools stats"), so we disable | ||
| 1091 | ;; them. | ||
| 1092 | (("(test_usage_subcommand\\(.*\\);)" cmd) | ||
| 1093 | (string-append "unless ($subcommand eq 'stats') {" cmd "};"))))) | ||
| 1094 | (alist-delete | ||
| 1095 | 'configure | ||
| 1096 | %standard-phases))))) | ||
| 1097 | (native-inputs `(("pkg-config" ,pkg-config))) | 1289 | (native-inputs `(("pkg-config" ,pkg-config))) |
| 1098 | (inputs `(("ncurses" ,ncurses) | 1290 | (inputs `(("ncurses" ,ncurses) |
| 1099 | ("perl" ,perl) | 1291 | ("perl" ,perl) |
| @@ -1108,6 +1300,34 @@ variant calling (in conjunction with bcftools), and a simple alignment | |||
| 1108 | viewer.") | 1300 | viewer.") |
| 1109 | (license license:expat))) | 1301 | (license license:expat))) |
| 1110 | 1302 | ||
| 1303 | (define-public samtools-0.1 | ||
| 1304 | ;; This is the most recent version of the 0.1 line of samtools. The input | ||
| 1305 | ;; and output formats differ greatly from that used and produced by samtools | ||
| 1306 | ;; 1.x and is still used in many bioinformatics pipelines. | ||
| 1307 | (package (inherit samtools) | ||
| 1308 | (version "0.1.19") | ||
| 1309 | (source | ||
| 1310 | (origin | ||
| 1311 | (method url-fetch) | ||
| 1312 | (uri | ||
| 1313 | (string-append "mirror://sourceforge/samtools/" | ||
| 1314 | version "/samtools-" version ".tar.bz2")) | ||
| 1315 | (sha256 | ||
| 1316 | (base32 "1m33xsfwz0s8qi45lylagfllqg7fphf4dr0780rsvw75av9wk06h")))) | ||
| 1317 | (arguments | ||
| 1318 | (substitute-keyword-arguments (package-arguments samtools) | ||
| 1319 | ((#:tests? tests) #f) ;no "check" target | ||
| 1320 | ((#:phases phases) | ||
| 1321 | `(modify-phases ,phases | ||
| 1322 | (replace 'install | ||
| 1323 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 1324 | (let ((bin (string-append | ||
| 1325 | (assoc-ref outputs "out") "/bin"))) | ||
| 1326 | (mkdir-p bin) | ||
| 1327 | (copy-file "samtools" | ||
| 1328 | (string-append bin "/samtools"))))) | ||
| 1329 | (delete 'patch-tests))))))) | ||
| 1330 | |||
| 1111 | (define-public ngs-sdk | 1331 | (define-public ngs-sdk |
| 1112 | (package | 1332 | (package |
| 1113 | (name "ngs-sdk") | 1333 | (name "ngs-sdk") |
| @@ -1266,11 +1486,16 @@ simultaneously.") | |||
| 1266 | (assoc-ref inputs "hdf5")))))) | 1486 | (assoc-ref inputs "hdf5")))))) |
| 1267 | (alist-cons-after | 1487 | (alist-cons-after |
| 1268 | 'install 'install-interfaces | 1488 | 'install 'install-interfaces |
| 1269 | (lambda* (#:key system outputs #:allow-other-keys) | 1489 | (lambda* (#:key outputs #:allow-other-keys) |
| 1270 | ;; Install interface libraries | 1490 | ;; Install interface libraries. On i686 the interface libraries |
| 1491 | ;; are installed to "linux/gcc/i386", so we need to use the Linux | ||
| 1492 | ;; architecture name ("i386") instead of the target system prefix | ||
| 1493 | ;; ("i686"). | ||
| 1271 | (mkdir (string-append (assoc-ref outputs "out") "/ilib")) | 1494 | (mkdir (string-append (assoc-ref outputs "out") "/ilib")) |
| 1272 | (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/" | 1495 | (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/" |
| 1273 | (car (string-split system #\-)) | 1496 | ,(system->linux-architecture |
| 1497 | (or (%current-target-system) | ||
| 1498 | (%current-system))) | ||
| 1274 | "/rel/ilib") | 1499 | "/rel/ilib") |
| 1275 | (string-append (assoc-ref outputs "out") | 1500 | (string-append (assoc-ref outputs "out") |
| 1276 | "/ilib")) | 1501 | "/ilib")) |
| @@ -1513,7 +1738,40 @@ against local background noises.") | |||
| 1513 | "/sources/shogun-" version ".tar.bz2")) | 1738 | "/sources/shogun-" version ".tar.bz2")) |
| 1514 | (sha256 | 1739 | (sha256 |
| 1515 | (base32 | 1740 | (base32 |
| 1516 | "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb")))) | 1741 | "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb")) |
| 1742 | (modules '((guix build utils) | ||
| 1743 | (ice-9 rdelim))) | ||
| 1744 | (snippet | ||
| 1745 | '(begin | ||
| 1746 | ;; Remove non-free sources and files referencing them | ||
| 1747 | (for-each delete-file | ||
| 1748 | (find-files "src/shogun/classifier/svm/" | ||
| 1749 | "SVMLight\\.(cpp|h)")) | ||
| 1750 | (for-each delete-file | ||
| 1751 | (find-files "examples/undocumented/libshogun/" | ||
| 1752 | (string-append | ||
| 1753 | "(classifier_.*svmlight.*|" | ||
| 1754 | "evaluation_cross_validation_locked_comparison).cpp"))) | ||
| 1755 | ;; Remove non-free functions. | ||
| 1756 | (define (delete-ifdefs file) | ||
| 1757 | (with-atomic-file-replacement file | ||
| 1758 | (lambda (in out) | ||
| 1759 | (let loop ((line (read-line in 'concat)) | ||
| 1760 | (skipping? #f)) | ||
| 1761 | (if (eof-object? line) | ||
| 1762 | #t | ||
| 1763 | (let ((skip-next? | ||
| 1764 | (or (and skipping? | ||
| 1765 | (not (string-prefix? | ||
| 1766 | "#endif //USE_SVMLIGHT" line))) | ||
| 1767 | (string-prefix? | ||
| 1768 | "#ifdef USE_SVMLIGHT" line)))) | ||
| 1769 | (when (or (not skipping?) | ||
| 1770 | (and skipping? (not skip-next?))) | ||
| 1771 | (display line out)) | ||
| 1772 | (loop (read-line in 'concat) skip-next?))))))) | ||
| 1773 | (for-each delete-ifdefs (find-files "src/shogun/kernel/" | ||
| 1774 | "^Kernel\\.(cpp|h)")))))) | ||
| 1517 | (build-system cmake-build-system) | 1775 | (build-system cmake-build-system) |
| 1518 | (arguments | 1776 | (arguments |
| 1519 | '(#:tests? #f ;no check target | 1777 | '(#:tests? #f ;no check target |
| @@ -1621,6 +1879,7 @@ in terms of new algorithms.") | |||
| 1621 | (arguments | 1879 | (arguments |
| 1622 | `(#:tests? #f ; no "check" target | 1880 | `(#:tests? #f ; no "check" target |
| 1623 | #:make-flags (list | 1881 | #:make-flags (list |
| 1882 | "CFLAGS=-O2" ; override "-m64" flag | ||
| 1624 | (string-append "PREFIX=" (assoc-ref %outputs "out")) | 1883 | (string-append "PREFIX=" (assoc-ref %outputs "out")) |
| 1625 | (string-append "MANDIR=" (assoc-ref %outputs "out") | 1884 | (string-append "MANDIR=" (assoc-ref %outputs "out") |
| 1626 | "/share/man/man1")) | 1885 | "/share/man/man1")) |
diff --git a/gnu/packages/busybox.scm b/gnu/packages/busybox.scm index d200cd7ad59..13630b39dc9 100644 --- a/gnu/packages/busybox.scm +++ b/gnu/packages/busybox.scm | |||
| @@ -53,8 +53,9 @@ | |||
| 53 | 53 | ||
| 54 | ;; There is no /usr/bin or /bin - replace it with /gnu/store | 54 | ;; There is no /usr/bin or /bin - replace it with /gnu/store |
| 55 | (substitute* "testsuite/cpio.tests" | 55 | (substitute* "testsuite/cpio.tests" |
| 56 | (("/usr/bin") "/gnu/store") | 56 | (("/usr/bin") (%store-directory)) |
| 57 | (("usr") "gnu")) | 57 | (("usr") (car (filter (negate string-null?) |
| 58 | (string-split (%store-directory) #\/))))) | ||
| 58 | 59 | ||
| 59 | (substitute* "testsuite/date/date-works-1" | 60 | (substitute* "testsuite/date/date-works-1" |
| 60 | (("/bin/date") (which "date"))) | 61 | (("/bin/date") (which "date"))) |
diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm new file mode 100644 index 00000000000..7e87fbbfe4c --- /dev/null +++ b/gnu/packages/calendar.scm | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 David Thompson <davet@gnu.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu packages calendar) | ||
| 20 | #:use-module (gnu packages) | ||
| 21 | #:use-module (guix licenses) | ||
| 22 | #:use-module (guix packages) | ||
| 23 | #:use-module (guix download) | ||
| 24 | #:use-module (guix build-system cmake) | ||
| 25 | #:use-module (gnu packages icu4c) | ||
| 26 | #:use-module (gnu packages perl)) | ||
| 27 | |||
| 28 | (define-public libical | ||
| 29 | (package | ||
| 30 | (name "libical") | ||
| 31 | (version "1.0.1") | ||
| 32 | (source (origin | ||
| 33 | (method url-fetch) | ||
| 34 | (uri (string-append | ||
| 35 | "https://github.com/libical/libical/releases/download/v" | ||
| 36 | version "/libical-" version ".tar.gz")) | ||
| 37 | (sha256 | ||
| 38 | (base32 | ||
| 39 | "14lmjj63zyx88rf1z71l0v9ms4c2vpdhmixksjjxgywp5p2f7708")))) | ||
| 40 | (build-system cmake-build-system) | ||
| 41 | (arguments | ||
| 42 | '(#:tests? #f)) ; test suite appears broken | ||
| 43 | (native-inputs | ||
| 44 | `(("perl" ,perl))) | ||
| 45 | (inputs | ||
| 46 | `(("icu4c" ,icu4c))) | ||
| 47 | (home-page "https://libical.github.io/libical/") | ||
| 48 | (synopsis "iCalendar protocols and data formats implementation") | ||
| 49 | (description | ||
| 50 | "Libical is an implementation of the iCalendar protocols and protocol | ||
| 51 | data units.") | ||
| 52 | (license lgpl2.1))) | ||
diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm index 3383fb653de..8ecc909c795 100644 --- a/gnu/packages/cdrom.scm +++ b/gnu/packages/cdrom.scm | |||
| @@ -95,7 +95,9 @@ caching facility provided by the library.") | |||
| 95 | for CD-ROM and CD image file access. It allows the developer to add CD | 95 | for CD-ROM and CD image file access. It allows the developer to add CD |
| 96 | access to an application without having to worry about the OS- and | 96 | access to an application without having to worry about the OS- and |
| 97 | device-dependent properties of CD-ROM or the specific details of CD image | 97 | device-dependent properties of CD-ROM or the specific details of CD image |
| 98 | formats.") | 98 | formats. It includes pycdio, a Python interface to libcdio, and |
| 99 | libcdio-paranoia, a library providing jitter-free and error-free audio | ||
| 100 | extraction from CDs.") | ||
| 99 | (license gpl3+))) | 101 | (license gpl3+))) |
| 100 | 102 | ||
| 101 | (define-public libcdio-paranoia | 103 | (define-public libcdio-paranoia |
| @@ -122,14 +124,14 @@ libcdio.") | |||
| 122 | (define-public xorriso | 124 | (define-public xorriso |
| 123 | (package | 125 | (package |
| 124 | (name "xorriso") | 126 | (name "xorriso") |
| 125 | (version "1.3.8") | 127 | (version "1.4.0") |
| 126 | (source (origin | 128 | (source (origin |
| 127 | (method url-fetch) | 129 | (method url-fetch) |
| 128 | (uri (string-append "mirror://gnu/xorriso/xorriso-" | 130 | (uri (string-append "mirror://gnu/xorriso/xorriso-" |
| 129 | version ".tar.gz")) | 131 | version ".tar.gz")) |
| 130 | (sha256 | 132 | (sha256 |
| 131 | (base32 | 133 | (base32 |
| 132 | "0zhhj9lr9z7hnb2alac54mc28w1l0mbanphhpmy3ylsi8rih84lh")))) | 134 | "0mhfxn2idkrw1i65a5y4gnb1fig85zpnszb9ax7w4a2v062y1l8b")))) |
| 133 | (build-system gnu-build-system) | 135 | (build-system gnu-build-system) |
| 134 | (inputs | 136 | (inputs |
| 135 | `(("acl" ,acl) | 137 | `(("acl" ,acl) |
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 3e686cc7431..5349ede0faa 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> | 2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
| 3 | ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> | 3 | ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> |
| 4 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> | 4 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> |
| 5 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | ||
| 5 | ;;; | 6 | ;;; |
| 6 | ;;; This file is part of GNU Guix. | 7 | ;;; This file is part of GNU Guix. |
| 7 | ;;; | 8 | ;;; |
| @@ -89,12 +90,18 @@ with a flexible variety of user interfaces.") | |||
| 89 | (version "1.12.1") | 90 | (version "1.12.1") |
| 90 | (source (origin | 91 | (source (origin |
| 91 | (method url-fetch) | 92 | (method url-fetch) |
| 92 | (uri (string-append "mirror://sourceforge/cppunit/" name "/" | 93 | (uri (string-append "mirror://sourceforge/cppunit/" name "/" |
| 93 | name "-" | 94 | name "-" |
| 94 | version ".tar.gz")) | 95 | version ".tar.gz")) |
| 95 | (sha256 | 96 | (sha256 |
| 96 | (base32 | 97 | (base32 |
| 97 | "0jm49v5rmc5qw34vqs56gy8xja1dhci73bmh23cig4kcir6a0a5c")))) | 98 | "0jm49v5rmc5qw34vqs56gy8xja1dhci73bmh23cig4kcir6a0a5c")))) |
| 99 | ;; Explicitly link with libdl. This is expected to be done by packages | ||
| 100 | ;; relying on cppunit for their tests. However, not all of them do. | ||
| 101 | ;; If we added the linker flag to such packages, we would pollute all | ||
| 102 | ;; binaries, not only those used for testing. | ||
| 103 | (arguments | ||
| 104 | `(#:make-flags '("LDFLAGS=-ldl"))) | ||
| 98 | (build-system gnu-build-system) | 105 | (build-system gnu-build-system) |
| 99 | (home-page "http://sourceforge.net/projects/cppunit/") | 106 | (home-page "http://sourceforge.net/projects/cppunit/") |
| 100 | (synopsis "Unit testing framework for C++") | 107 | (synopsis "Unit testing framework for C++") |
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 6a48fb640b5..14af09395ae 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm | |||
| @@ -783,16 +783,26 @@ COREUTILS-FINAL vs. COREUTILS, etc." | |||
| 783 | '(#:modules ((guix build union)) | 783 | '(#:modules ((guix build union)) |
| 784 | #:builder (begin | 784 | #:builder (begin |
| 785 | (use-modules (ice-9 match) | 785 | (use-modules (ice-9 match) |
| 786 | (srfi srfi-26) | ||
| 786 | (guix build union)) | 787 | (guix build union)) |
| 787 | 788 | ||
| 788 | (match %build-inputs | 789 | (let ((out (assoc-ref %outputs "out"))) |
| 789 | (((names . directories) ...) | ||
| 790 | (union-build (assoc-ref %outputs "out") | ||
| 791 | directories))) | ||
| 792 | 790 | ||
| 793 | (union-build (assoc-ref %outputs "debug") | 791 | (match %build-inputs |
| 794 | (list (assoc-ref %build-inputs | 792 | (((names . directories) ...) |
| 795 | "libc-debug")))))) | 793 | (union-build out directories))) |
| 794 | |||
| 795 | ;; Remove the 'sh' and 'bash' binaries that come with | ||
| 796 | ;; libc to avoid polluting the user's profile (these are | ||
| 797 | ;; statically-linked binaries with no locale support and | ||
| 798 | ;; so on.) | ||
| 799 | (for-each (lambda (file) | ||
| 800 | (delete-file (string-append out "/bin/" file))) | ||
| 801 | '("sh" "bash")) | ||
| 802 | |||
| 803 | (union-build (assoc-ref %outputs "debug") | ||
| 804 | (list (assoc-ref %build-inputs | ||
| 805 | "libc-debug"))))))) | ||
| 796 | 806 | ||
| 797 | (native-search-paths (package-native-search-paths gcc)) | 807 | (native-search-paths (package-native-search-paths gcc)) |
| 798 | (search-paths (package-search-paths gcc)) | 808 | (search-paths (package-search-paths gcc)) |
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index 4684fce1303..78f967c3cb1 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm | |||
| @@ -297,7 +297,7 @@ archiving. Lzip is a clean implementation of the LZMA algorithm.") | |||
| 297 | (define-public sharutils | 297 | (define-public sharutils |
| 298 | (package | 298 | (package |
| 299 | (name "sharutils") | 299 | (name "sharutils") |
| 300 | (version "4.15") | 300 | (version "4.15.2") |
| 301 | (source | 301 | (source |
| 302 | (origin | 302 | (origin |
| 303 | (method url-fetch) | 303 | (method url-fetch) |
| @@ -305,7 +305,7 @@ archiving. Lzip is a clean implementation of the LZMA algorithm.") | |||
| 305 | version ".tar.xz")) | 305 | version ".tar.xz")) |
| 306 | (sha256 | 306 | (sha256 |
| 307 | (base32 | 307 | (base32 |
| 308 | "19gqb6qbqmpgh6xlpgpj0ayw2nshllxg9d01qb5z8bnkhfcla8ka")))) | 308 | "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b")))) |
| 309 | (build-system gnu-build-system) | 309 | (build-system gnu-build-system) |
| 310 | (inputs | 310 | (inputs |
| 311 | `(("which" ,which))) | 311 | `(("which" ,which))) |
diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm index 3acf9dfd460..05b129d6a91 100644 --- a/gnu/packages/cups.scm +++ b/gnu/packages/cups.scm | |||
| @@ -106,14 +106,14 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.") | |||
| 106 | (define-public cups-minimal | 106 | (define-public cups-minimal |
| 107 | (package | 107 | (package |
| 108 | (name "cups-minimal") | 108 | (name "cups-minimal") |
| 109 | (version "2.0.1") | 109 | (version "2.0.3") |
| 110 | (source (origin | 110 | (source (origin |
| 111 | (method url-fetch) | 111 | (method url-fetch) |
| 112 | (uri (string-append "http://www.cups.org/software/" | 112 | (uri (string-append "http://www.cups.org/software/" |
| 113 | version "/cups-" version "-source.tar.gz")) | 113 | version "/cups-" version "-source.tar.gz")) |
| 114 | (sha256 | 114 | (sha256 |
| 115 | (base32 | 115 | (base32 |
| 116 | "1kbc85kwhm1vyzahblrg3qih9yypggs91d13gdrbnaac8q7jd9jr")))) | 116 | "1kq1kpny0hghqgbjvashlv6qw1xn0c1p3d4r3cx8qxdzd2ifk4lf")))) |
| 117 | (build-system gnu-build-system) | 117 | (build-system gnu-build-system) |
| 118 | (arguments | 118 | (arguments |
| 119 | `(#:configure-flags | 119 | `(#:configure-flags |
diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm index 526514b8150..ab22645971a 100644 --- a/gnu/packages/curl.scm +++ b/gnu/packages/curl.scm | |||
| @@ -38,17 +38,14 @@ | |||
| 38 | (define-public curl | 38 | (define-public curl |
| 39 | (package | 39 | (package |
| 40 | (name "curl") | 40 | (name "curl") |
| 41 | (version "7.41.0") | 41 | (version "7.42.1") |
| 42 | (source (origin | 42 | (source (origin |
| 43 | (method url-fetch) | 43 | (method url-fetch) |
| 44 | (uri (string-append "http://curl.haxx.se/download/curl-" | 44 | (uri (string-append "http://curl.haxx.se/download/curl-" |
| 45 | version ".tar.lzma")) | 45 | version ".tar.lzma")) |
| 46 | (sha256 | 46 | (sha256 |
| 47 | (base32 | 47 | (base32 |
| 48 | "08n7vrhdfzziy3a7n93r7qjhzk8p26q464hxg8w9irdk3v60pi62")) | 48 | "0ircrhi4i9iviq0d9044rq288sdrww19d0ci6vmb4fh8nmm1jv1x")))) |
| 49 | (patches | ||
| 50 | (list (search-patch "curl-support-capath-on-gnutls.patch") | ||
| 51 | (search-patch "curl-support-capath-on-gnutls-conf.patch"))))) | ||
| 52 | (build-system gnu-build-system) | 49 | (build-system gnu-build-system) |
| 53 | (inputs `(("gnutls" ,gnutls) | 50 | (inputs `(("gnutls" ,gnutls) |
| 54 | ("gss" ,gss) | 51 | ("gss" ,gss) |
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 5daf7ecba1e..3e3fd1a560f 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | #:use-module (guix build-system gnu) | 49 | #:use-module (guix build-system gnu) |
| 50 | #:use-module (guix build-system perl) | 50 | #:use-module (guix build-system perl) |
| 51 | #:use-module (guix build-system cmake) | 51 | #:use-module (guix build-system cmake) |
| 52 | #:use-module (guix utils) | ||
| 52 | #:use-module (srfi srfi-26) | 53 | #:use-module (srfi srfi-26) |
| 53 | #:use-module (ice-9 match)) | 54 | #:use-module (ice-9 match)) |
| 54 | 55 | ||
| @@ -100,53 +101,47 @@ SQL, Key/Value, XML/XQuery or Java Object storage for their data model.") | |||
| 100 | (define-public mysql | 101 | (define-public mysql |
| 101 | (package | 102 | (package |
| 102 | (name "mysql") | 103 | (name "mysql") |
| 103 | (version "5.1.73") | 104 | (version "5.6.25") |
| 104 | (source (origin | 105 | (source (origin |
| 105 | (method url-fetch) | 106 | (method url-fetch) |
| 106 | (uri (string-append | 107 | (uri (string-append |
| 107 | "http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-" | 108 | "http://dev.mysql.com/get/Downloads/MySQL-" |
| 108 | version ".tar.gz")) | 109 | (version-major+minor version) "/" |
| 110 | name "-" version ".tar.gz")) | ||
| 109 | (sha256 | 111 | (sha256 |
| 110 | (base32 | 112 | (base32 |
| 111 | "1dfwi4ck0vq6sdci6gz0031s7zz5lc3pddqlgm0292s00l9y5sq5")))) | 113 | "1gbz5i1z3nswpq3q8f477vrx7g15j8n41pyb94k0jfnkhc5rq1qm")))) |
| 112 | (build-system gnu-build-system) | 114 | (build-system cmake-build-system) |
| 115 | (arguments | ||
| 116 | '(#:configure-flags | ||
| 117 | '("-DBUILD_CONFIG=mysql_release" | ||
| 118 | "-DWITH_SSL=system" | ||
| 119 | "-DWITH_ZLIB=system" | ||
| 120 | "-DDEFAULT_CHARSET=utf8" | ||
| 121 | "-DDEFAULT_COLLATION=utf8_general_ci" | ||
| 122 | "-DMYSQL_DATADIR=/var/lib/mysql" | ||
| 123 | "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" | ||
| 124 | "-DINSTALL_INFODIR=share/mysql/docs" | ||
| 125 | "-DINSTALL_MANDIR=share/man" | ||
| 126 | "-DINSTALL_PLUGINDIR=lib/mysql/plugin" | ||
| 127 | "-DINSTALL_SCRIPTDIR=bin" | ||
| 128 | "-DINSTALL_INCLUDEDIR=include/mysql" | ||
| 129 | "-DINSTALL_DOCREADMEDIR=share/mysql/docs" | ||
| 130 | "-DINSTALL_SUPPORTFILESDIR=share/mysql" | ||
| 131 | "-DINSTALL_MYSQLSHAREDIR=share/mysql" | ||
| 132 | "-DINSTALL_DOCDIR=share/mysql/docs" | ||
| 133 | "-DINSTALL_SHAREDIR=share/mysql" | ||
| 134 | ;; Get rid of test data. | ||
| 135 | "-DINSTALL_MYSQLTESTDIR=" | ||
| 136 | "-DINSTALL_SQLBENCHDIR="))) | ||
| 137 | (native-inputs | ||
| 138 | `(("bison" ,bison) | ||
| 139 | ("perl" ,perl))) | ||
| 113 | (inputs | 140 | (inputs |
| 114 | `(("procps" ,procps) | 141 | `(("libaio" ,libaio) |
| 115 | ("openssl" ,openssl) | 142 | ("openssl" ,openssl) |
| 116 | ("perl" ,perl) | ||
| 117 | ("zlib" ,zlib) | 143 | ("zlib" ,zlib) |
| 118 | ("ncurses" ,ncurses))) | 144 | ("ncurses" ,ncurses))) |
| 119 | (arguments | ||
| 120 | '(#:modules ((guix build gnu-build-system) | ||
| 121 | (guix build utils) | ||
| 122 | (ice-9 ftw)) ; for "rm -rf" | ||
| 123 | #:phases (alist-cons-after | ||
| 124 | 'install 'clean-up | ||
| 125 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 126 | ;; Remove the 112 MiB of tests that get installed. | ||
| 127 | (let ((out (assoc-ref outputs "out"))) | ||
| 128 | (define (rm-rf dir) | ||
| 129 | (file-system-fold (const #t) ; enter? | ||
| 130 | (lambda (file stat result) ; leaf | ||
| 131 | (delete-file file)) | ||
| 132 | (const #t) ; down | ||
| 133 | (lambda (dir stat result) ; up | ||
| 134 | (rmdir dir)) | ||
| 135 | (const #t) | ||
| 136 | (lambda (file stat errno result) | ||
| 137 | (format (current-error-port) | ||
| 138 | "error: ~a: ~a~%" | ||
| 139 | file (strerror errno))) | ||
| 140 | #t | ||
| 141 | (string-append out "/" dir))) | ||
| 142 | (rm-rf "mysql-test") | ||
| 143 | (rm-rf "sql-bench") | ||
| 144 | |||
| 145 | ;; Compress the 14 MiB Info file. | ||
| 146 | (zero? | ||
| 147 | (system* "gzip" "--best" | ||
| 148 | (string-append out "/share/info/mysql.info"))))) | ||
| 149 | %standard-phases))) | ||
| 150 | (home-page "http://www.mysql.com/") | 145 | (home-page "http://www.mysql.com/") |
| 151 | (synopsis "Fast, easy to use, and popular database") | 146 | (synopsis "Fast, easy to use, and popular database") |
| 152 | (description | 147 | (description |
| @@ -158,7 +153,7 @@ Language.") | |||
| 158 | (define-public mariadb | 153 | (define-public mariadb |
| 159 | (package | 154 | (package |
| 160 | (name "mariadb") | 155 | (name "mariadb") |
| 161 | (version "10.0.17") | 156 | (version "10.0.18") |
| 162 | (source (origin | 157 | (source (origin |
| 163 | (method url-fetch) | 158 | (method url-fetch) |
| 164 | (uri (string-append "https://downloads.mariadb.org/f/" | 159 | (uri (string-append "https://downloads.mariadb.org/f/" |
| @@ -166,7 +161,7 @@ Language.") | |||
| 166 | name "-" version ".tar.gz")) | 161 | name "-" version ".tar.gz")) |
| 167 | (sha256 | 162 | (sha256 |
| 168 | (base32 | 163 | (base32 |
| 169 | "04ckq67qgkghh7yzrbzwidk7wn7yjml15gzj2c5p1hs2k7lr9lww")))) | 164 | "1xcs391cm0vnl9bvx1470v8z4d77zqv16n6iaqi12jm0ma8fwvv8")))) |
| 170 | (build-system cmake-build-system) | 165 | (build-system cmake-build-system) |
| 171 | (arguments | 166 | (arguments |
| 172 | '(#:configure-flags | 167 | '(#:configure-flags |
| @@ -226,14 +221,14 @@ as a drop-in replacement of MySQL.") | |||
| 226 | (define-public postgresql | 221 | (define-public postgresql |
| 227 | (package | 222 | (package |
| 228 | (name "postgresql") | 223 | (name "postgresql") |
| 229 | (version "9.3.6") | 224 | (version "9.3.7") |
| 230 | (source (origin | 225 | (source (origin |
| 231 | (method url-fetch) | 226 | (method url-fetch) |
| 232 | (uri (string-append "http://ftp.postgresql.org/pub/source/v" | 227 | (uri (string-append "http://ftp.postgresql.org/pub/source/v" |
| 233 | version "/postgresql-" version ".tar.bz2")) | 228 | version "/postgresql-" version ".tar.bz2")) |
| 234 | (sha256 | 229 | (sha256 |
| 235 | (base32 | 230 | (base32 |
| 236 | "056ass7nnfyv7blv02anv795kgpz77gipdpxggd835cdwrhwns13")))) | 231 | "0ggz0i91znv053zx9qas7pjf93s5by3dk84z1jxbjkg8yyrnlx4b")))) |
| 237 | (build-system gnu-build-system) | 232 | (build-system gnu-build-system) |
| 238 | (inputs | 233 | (inputs |
| 239 | `(("readline" ,readline) | 234 | `(("readline" ,readline) |
| @@ -289,7 +284,7 @@ types are supported, as is encryption.") | |||
| 289 | (define-public sqlite | 284 | (define-public sqlite |
| 290 | (package | 285 | (package |
| 291 | (name "sqlite") | 286 | (name "sqlite") |
| 292 | (version "3.8.8.3") | 287 | (version "3.8.9") |
| 293 | (source (origin | 288 | (source (origin |
| 294 | (method url-fetch) | 289 | (method url-fetch) |
| 295 | ;; TODO: Download from sqlite.org once this bug : | 290 | ;; TODO: Download from sqlite.org once this bug : |
| @@ -309,7 +304,7 @@ types are supported, as is encryption.") | |||
| 309 | "/sqlite-autoconf-" numeric-version ".tar.gz"))) | 304 | "/sqlite-autoconf-" numeric-version ".tar.gz"))) |
| 310 | (sha256 | 305 | (sha256 |
| 311 | (base32 | 306 | (base32 |
| 312 | "04dl53iv5q0srv4jcgjfzsrdzkq6dg1sgmlmpw9lrd4xrmj6jmvl")))) | 307 | "18k90bbfvvgc5204nm1hzw0vsj9ygzv7zbq3z6zrya6j5hwvdsvn")))) |
| 313 | (build-system gnu-build-system) | 308 | (build-system gnu-build-system) |
| 314 | (inputs `(("readline" ,readline))) | 309 | (inputs `(("readline" ,readline))) |
| 315 | (arguments | 310 | (arguments |
diff --git a/gnu/packages/dejagnu.scm b/gnu/packages/dejagnu.scm index 203bd6ea2c9..60fd2124f00 100644 --- a/gnu/packages/dejagnu.scm +++ b/gnu/packages/dejagnu.scm | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | (define-public dejagnu | 26 | (define-public dejagnu |
| 27 | (package | 27 | (package |
| 28 | (name "dejagnu") | 28 | (name "dejagnu") |
| 29 | (version "1.5.2") | 29 | (version "1.5.3") |
| 30 | (source | 30 | (source |
| 31 | (origin | 31 | (origin |
| 32 | (method url-fetch) | 32 | (method url-fetch) |
| @@ -34,7 +34,7 @@ | |||
| 34 | version ".tar.gz")) | 34 | version ".tar.gz")) |
| 35 | (sha256 | 35 | (sha256 |
| 36 | (base32 | 36 | (base32 |
| 37 | "18ikblg4x4y5fkw8sg0c2zmqgxdqqycswmws17sxx8m4sz6g7dch")))) | 37 | "069z3qrdv35cm2sbnfr5yjzplrqj9f61cchxis7j9mm19hv8x6q9")))) |
| 38 | (build-system gnu-build-system) | 38 | (build-system gnu-build-system) |
| 39 | (inputs `(("expect" ,expect))) | 39 | (inputs `(("expect" ,expect))) |
| 40 | (arguments | 40 | (arguments |
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm index 6a7fdcfb198..22fdd290a06 100644 --- a/gnu/packages/disk.scm +++ b/gnu/packages/disk.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org> | 2 | ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org> |
| 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -119,3 +120,30 @@ from one file to another, working to rescue data in case of read errors. The | |||
| 119 | program also includes a tool for manipulating its log files, which are used | 120 | program also includes a tool for manipulating its log files, which are used |
| 120 | to recover data more efficiently by only reading the necessary blocks.") | 121 | to recover data more efficiently by only reading the necessary blocks.") |
| 121 | (license gpl3+))) | 122 | (license gpl3+))) |
| 123 | |||
| 124 | (define-public dosfstools | ||
| 125 | (package | ||
| 126 | (name "dosfstools") | ||
| 127 | (version "3.0.27") | ||
| 128 | (source | ||
| 129 | (origin | ||
| 130 | (method url-fetch) | ||
| 131 | (uri (string-append "https://github.com/" name "/" name | ||
| 132 | "/releases/download/v" version "/" | ||
| 133 | name "-" version ".tar.xz")) | ||
| 134 | (sha256 | ||
| 135 | (base32 | ||
| 136 | "1a2qs5g2zqbk1gzaaf4v3fw3yny6jgbzddpgcamkp3fjifn8wxl5")))) | ||
| 137 | (build-system gnu-build-system) | ||
| 138 | (arguments | ||
| 139 | `(#:make-flags (list (string-append "PREFIX=" %output) | ||
| 140 | "CC=gcc") | ||
| 141 | #:tests? #f ;no tests | ||
| 142 | #:phases (modify-phases %standard-phases | ||
| 143 | (delete 'configure)))) | ||
| 144 | (home-page "https://github.com/dosfstools/dosfstools") | ||
| 145 | (synopsis "Utilities for making and checking MS-DOS FAT filesystems") | ||
| 146 | (description | ||
| 147 | "The dosfstools package includes the mkfs.fat and fsck.fat utilities, | ||
| 148 | which respectively make and check MS-DOS FAT filesystems.") | ||
| 149 | (license gpl3+))) | ||
diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm index 101c5bad377..2be5ea351a5 100644 --- a/gnu/packages/ebook.scm +++ b/gnu/packages/ebook.scm | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #:use-module (guix build-system python) | 25 | #:use-module (guix build-system python) |
| 26 | #:use-module (gnu packages) | 26 | #:use-module (gnu packages) |
| 27 | #:use-module (gnu packages databases) | 27 | #:use-module (gnu packages databases) |
| 28 | #:use-module (gnu packages ebook) | ||
| 29 | #:use-module (gnu packages fontutils) | 28 | #:use-module (gnu packages fontutils) |
| 30 | #:use-module (gnu packages freedesktop) | 29 | #:use-module (gnu packages freedesktop) |
| 31 | #:use-module (gnu packages glib) | 30 | #:use-module (gnu packages glib) |
| @@ -33,6 +32,7 @@ | |||
| 33 | #:use-module (gnu packages image) | 32 | #:use-module (gnu packages image) |
| 34 | #:use-module (gnu packages imagemagick) | 33 | #:use-module (gnu packages imagemagick) |
| 35 | #:use-module (gnu packages libusb) | 34 | #:use-module (gnu packages libusb) |
| 35 | #:use-module (gnu packages openssl) | ||
| 36 | #:use-module (gnu packages pdf) | 36 | #:use-module (gnu packages pdf) |
| 37 | #:use-module (gnu packages pkg-config) | 37 | #:use-module (gnu packages pkg-config) |
| 38 | #:use-module (gnu packages python) | 38 | #:use-module (gnu packages python) |
| @@ -60,7 +60,7 @@ | |||
| 60 | (define-public calibre | 60 | (define-public calibre |
| 61 | (package | 61 | (package |
| 62 | (name "calibre") | 62 | (name "calibre") |
| 63 | (version "2.25.0") | 63 | (version "2.29.0") |
| 64 | (source | 64 | (source |
| 65 | (origin | 65 | (origin |
| 66 | (method url-fetch) | 66 | (method url-fetch) |
| @@ -69,7 +69,7 @@ | |||
| 69 | version ".tar.xz")) | 69 | version ".tar.xz")) |
| 70 | (sha256 | 70 | (sha256 |
| 71 | (base32 | 71 | (base32 |
| 72 | "0h7cnwdd9phk4n5hl6xggkn7szvqsds5847mnk2wg2j2j1lzp2r0")) | 72 | "1n3cfnjnghhhsgzcbcvbr0gh191lhl6az09q1s68jhlcc2lski6l")) |
| 73 | ;; Remove non-free or doubtful code, see | 73 | ;; Remove non-free or doubtful code, see |
| 74 | ;; https://lists.gnu.org/archive/html/guix-devel/2015-02/msg00478.html | 74 | ;; https://lists.gnu.org/archive/html/guix-devel/2015-02/msg00478.html |
| 75 | (modules '((guix build utils))) | 75 | (modules '((guix build utils))) |
| @@ -106,6 +106,7 @@ | |||
| 106 | ("libpng" ,libpng) | 106 | ("libpng" ,libpng) |
| 107 | ("libusb" ,libusb) | 107 | ("libusb" ,libusb) |
| 108 | ("libxrender" ,libxrender) | 108 | ("libxrender" ,libxrender) |
| 109 | ("openssl" ,openssl) | ||
| 109 | ("podofo" ,podofo) | 110 | ("podofo" ,podofo) |
| 110 | ("python" ,python-2) | 111 | ("python" ,python-2) |
| 111 | ("python2-apsw" ,python2-apsw) | 112 | ("python2-apsw" ,python2-apsw) |
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 8d3df368b16..fbddff1cf62 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm | |||
| @@ -23,10 +23,12 @@ | |||
| 23 | #:use-module ((guix licenses) #:prefix license:) | 23 | #:use-module ((guix licenses) #:prefix license:) |
| 24 | #:use-module (guix packages) | 24 | #:use-module (guix packages) |
| 25 | #:use-module (guix download) | 25 | #:use-module (guix download) |
| 26 | #:use-module (guix git-download) | ||
| 26 | #:use-module (guix build-system gnu) | 27 | #:use-module (guix build-system gnu) |
| 27 | #:use-module (guix build-system glib-or-gtk) | 28 | #:use-module (guix build-system glib-or-gtk) |
| 28 | #:use-module (guix build-system trivial) | 29 | #:use-module (guix build-system trivial) |
| 29 | #:use-module (gnu packages) | 30 | #:use-module (gnu packages) |
| 31 | #:use-module (gnu packages guile) | ||
| 30 | #:use-module (gnu packages gtk) | 32 | #:use-module (gnu packages gtk) |
| 31 | #:use-module (gnu packages gnome) | 33 | #:use-module (gnu packages gnome) |
| 32 | #:use-module (gnu packages ncurses) | 34 | #:use-module (gnu packages ncurses) |
| @@ -146,6 +148,35 @@ editor (without an X toolkit)" ) | |||
| 146 | (arguments (append '(#:configure-flags '("--with-x-toolkit=no")) | 148 | (arguments (append '(#:configure-flags '("--with-x-toolkit=no")) |
| 147 | (package-arguments emacs))))) | 149 | (package-arguments emacs))))) |
| 148 | 150 | ||
| 151 | (define-public guile-emacs | ||
| 152 | (package (inherit emacs) | ||
| 153 | (name "guile-emacs") | ||
| 154 | (version "20150512.41120e0") | ||
| 155 | (source (origin | ||
| 156 | (method git-fetch) | ||
| 157 | (uri (git-reference | ||
| 158 | (url "git://git.hcoop.net/git/bpt/emacs.git") | ||
| 159 | (commit "41120e0f595b16387eebfbf731fff70481de1b4b"))) | ||
| 160 | (sha256 | ||
| 161 | (base32 | ||
| 162 | "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6")))) | ||
| 163 | (native-inputs | ||
| 164 | `(("autoconf" ,autoconf) | ||
| 165 | ("automake" ,automake) | ||
| 166 | ("guile" ,guile-for-guile-emacs) | ||
| 167 | ,@(package-native-inputs emacs))) | ||
| 168 | (arguments | ||
| 169 | (substitute-keyword-arguments `(;; Build fails if we allow parallel build. | ||
| 170 | #:parallel-build? #f | ||
| 171 | ;; Tests aren't passing for now. | ||
| 172 | #:tests? #f | ||
| 173 | ,@(package-arguments emacs)) | ||
| 174 | ((#:phases phases) | ||
| 175 | `(modify-phases ,phases | ||
| 176 | (add-after 'unpack 'autogen | ||
| 177 | (lambda _ | ||
| 178 | (zero? (system* "sh" "autogen.sh")))))))))) | ||
| 179 | |||
| 149 | 180 | ||
| 150 | ;;; | 181 | ;;; |
| 151 | ;;; Emacs hacking. | 182 | ;;; Emacs hacking. |
| @@ -230,52 +261,115 @@ for those who may want transient periods of unbalanced parentheses, such as | |||
| 230 | when typing parentheses directly or commenting out code line by line.") | 261 | when typing parentheses directly or commenting out code line by line.") |
| 231 | (license license:gpl3+))) | 262 | (license license:gpl3+))) |
| 232 | 263 | ||
| 264 | (define-public git-modes | ||
| 265 | (package | ||
| 266 | (name "git-modes") | ||
| 267 | (version "1.0.0") | ||
| 268 | (source (origin | ||
| 269 | (method url-fetch) | ||
| 270 | (uri (string-append | ||
| 271 | "https://github.com/magit/git-modes/archive/" | ||
| 272 | version ".tar.gz")) | ||
| 273 | (sha256 | ||
| 274 | (base32 | ||
| 275 | "1biiss75bswx4alk85k3g9p0a3q3sc9i74h4mnrxc2rsk2iwhws0")))) | ||
| 276 | (build-system gnu-build-system) | ||
| 277 | (arguments | ||
| 278 | `(#:modules ((guix build gnu-build-system) | ||
| 279 | (guix build emacs-utils) | ||
| 280 | (guix build utils)) | ||
| 281 | #:imported-modules (,@%gnu-build-system-modules | ||
| 282 | (guix build emacs-utils)) | ||
| 283 | |||
| 284 | #:make-flags (list (string-append "PREFIX=" | ||
| 285 | (assoc-ref %outputs "out")) | ||
| 286 | ;; Don't put .el files in a 'git-modes' | ||
| 287 | ;; sub-directory. | ||
| 288 | (string-append "LISPDIR=" | ||
| 289 | (assoc-ref %outputs "out") | ||
| 290 | "/share/emacs/site-lisp")) | ||
| 291 | #:test-target "test" | ||
| 292 | #:phases (modify-phases %standard-phases | ||
| 293 | (delete 'configure) | ||
| 294 | (add-after 'install 'emacs-autoloads | ||
| 295 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 296 | (let* ((out (assoc-ref outputs "out")) | ||
| 297 | (lisp (string-append | ||
| 298 | out "/share/emacs/site-lisp/"))) | ||
| 299 | (emacs-generate-autoloads ,name lisp))))))) | ||
| 300 | (native-inputs `(("emacs" ,emacs-no-x))) | ||
| 301 | (home-page "https://github.com/magit/git-modes") | ||
| 302 | (synopsis "Emacs major modes for Git configuration files") | ||
| 303 | (description | ||
| 304 | "This package provides Emacs major modes for editing various Git | ||
| 305 | configuration files, such as .gitattributes, .gitignore, and .git/config.") | ||
| 306 | (license license:gpl3+))) | ||
| 307 | |||
| 233 | (define-public magit | 308 | (define-public magit |
| 234 | (package | 309 | (package |
| 235 | (name "magit") | 310 | (name "magit") |
| 236 | (version "1.2.1") | 311 | (version "1.4.1") |
| 237 | (source (origin | 312 | (source (origin |
| 238 | (method url-fetch) | 313 | (method url-fetch) |
| 239 | (uri (string-append | 314 | (uri (string-append |
| 240 | "https://github.com/magit/magit/releases/download/" | 315 | "https://github.com/magit/magit/releases/download/" |
| 241 | version "/" name "-" version ".tar.gz")) | 316 | version "/" name "-" version ".tar.gz")) |
| 242 | (sha256 | 317 | (sha256 |
| 243 | (base32 "1in48g5l5xdc9cf2apnpgx73mqlz2njrpi1w52dgql4qxv3kg6gr")))) | 318 | (base32 |
| 319 | "0bbvz6cma5vj6qxx9v2m60zqkjwgwjrdf9kp04iacybvrcm8vcg7")))) | ||
| 244 | (build-system gnu-build-system) | 320 | (build-system gnu-build-system) |
| 245 | (native-inputs `(("texinfo" ,texinfo))) | 321 | (native-inputs `(("texinfo" ,texinfo) |
| 246 | (inputs `(("emacs" ,emacs-no-x) | 322 | ("emacs" ,emacs-no-x))) |
| 247 | ("git" ,git) | 323 | (inputs `(("git" ,git) |
| 248 | ("git:gui" ,git "gui"))) | 324 | ("git:gui" ,git "gui"))) |
| 325 | (propagated-inputs `(("git-modes" ,git-modes))) | ||
| 249 | (arguments | 326 | (arguments |
| 250 | `(#:modules ((guix build gnu-build-system) | 327 | `(#:modules ((guix build gnu-build-system) |
| 251 | (guix build utils) | 328 | (guix build utils) |
| 252 | (guix build emacs-utils)) | 329 | (guix build emacs-utils)) |
| 253 | #:imported-modules (,@%gnu-build-system-modules | 330 | #:imported-modules (,@%gnu-build-system-modules |
| 254 | (guix build emacs-utils)) | 331 | (guix build emacs-utils)) |
| 255 | #:tests? #f ; no check target | 332 | |
| 333 | #:test-target "test" | ||
| 334 | #:tests? #f ;'tests/magit-tests.el' is missing | ||
| 335 | |||
| 336 | #:make-flags (list | ||
| 337 | ;; Don't put .el files in a sub-directory. | ||
| 338 | (string-append "lispdir=" (assoc-ref %outputs "out") | ||
| 339 | "/share/emacs/site-lisp")) | ||
| 340 | |||
| 256 | #:phases | 341 | #:phases |
| 257 | (alist-replace | 342 | (modify-phases %standard-phases |
| 258 | 'configure | 343 | (replace |
| 259 | (lambda* (#:key outputs #:allow-other-keys) | 344 | 'configure |
| 260 | (let ((out (assoc-ref outputs "out"))) | 345 | (lambda* (#:key outputs #:allow-other-keys) |
| 261 | (substitute* "Makefile" | 346 | (let ((out (assoc-ref outputs "out"))) |
| 262 | (("/usr/local") out) | 347 | (substitute* "Makefile" |
| 263 | (("/etc") (string-append out "/etc"))))) | 348 | (("/usr/local") out) |
| 264 | (alist-cons-before | 349 | (("/etc") (string-append out "/etc")))))) |
| 265 | 'build 'patch-exec-paths | 350 | (add-before |
| 266 | (lambda* (#:key inputs #:allow-other-keys) | 351 | 'build 'patch-exec-paths |
| 267 | (let ((git (assoc-ref inputs "git")) | 352 | (lambda* (#:key inputs #:allow-other-keys) |
| 268 | (git:gui (assoc-ref inputs "git:gui"))) | 353 | (let ((git (assoc-ref inputs "git")) |
| 269 | (emacs-substitute-variables "magit.el" | 354 | (git:gui (assoc-ref inputs "git:gui"))) |
| 270 | ("magit-git-executable" (string-append git "/bin/git")) | 355 | (emacs-substitute-variables "magit.el" |
| 271 | ("magit-gitk-executable" (string-append git:gui "/bin/gitk"))))) | 356 | ("magit-git-executable" (string-append git "/bin/git")) |
| 272 | (alist-cons-after | 357 | ("magit-gitk-executable" (string-append git:gui |
| 358 | "/bin/gitk")))))) | ||
| 359 | (add-before | ||
| 360 | 'build 'augment-load-path | ||
| 361 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 362 | ;; Allow git-commit-mode.el & co. to be found. | ||
| 363 | (let ((git-modes (assoc-ref inputs "git-modes"))) | ||
| 364 | (setenv "EMACSLOADPATH" | ||
| 365 | (string-append ":" git-modes "/share/emacs/site-lisp")) | ||
| 366 | #t))) | ||
| 367 | (add-after | ||
| 273 | 'install 'post-install | 368 | 'install 'post-install |
| 274 | (lambda* (#:key outputs #:allow-other-keys) | 369 | (lambda* (#:key outputs #:allow-other-keys) |
| 275 | (emacs-generate-autoloads | 370 | (emacs-generate-autoloads |
| 276 | ,name (string-append (assoc-ref outputs "out") | 371 | ,name (string-append (assoc-ref outputs "out") |
| 277 | "/share/emacs/site-lisp/"))) | 372 | "/share/emacs/site-lisp/"))))))) |
| 278 | %standard-phases))))) | ||
| 279 | (home-page "http://magit.github.io/") | 373 | (home-page "http://magit.github.io/") |
| 280 | (synopsis "Emacs interface for the Git version control system") | 374 | (synopsis "Emacs interface for the Git version control system") |
| 281 | (description | 375 | (description |
| @@ -286,6 +380,56 @@ cherry picking, reverting, merging, rebasing, and other common Git | |||
| 286 | operations.") | 380 | operations.") |
| 287 | (license license:gpl3+))) | 381 | (license license:gpl3+))) |
| 288 | 382 | ||
| 383 | (define-public magit-svn | ||
| 384 | (package | ||
| 385 | (name "magit-svn") | ||
| 386 | (version "b69b79") | ||
| 387 | (source (origin | ||
| 388 | (method git-fetch) | ||
| 389 | (uri (git-reference | ||
| 390 | (commit version) | ||
| 391 | (url "https://github.com/magit/magit-svn.git"))) | ||
| 392 | (sha256 | ||
| 393 | (base32 | ||
| 394 | "07xxszd12r38s46sz8fn2qz26b7s88i022cqp3gmkmmj3j57kqv6")))) | ||
| 395 | (build-system trivial-build-system) | ||
| 396 | (inputs `(("emacs" ,emacs-no-x) | ||
| 397 | ("magit" ,magit))) | ||
| 398 | (arguments | ||
| 399 | `(#:modules ((guix build utils) | ||
| 400 | (guix build emacs-utils)) | ||
| 401 | |||
| 402 | #:builder | ||
| 403 | (begin | ||
| 404 | (use-modules (guix build utils) | ||
| 405 | (guix build emacs-utils)) | ||
| 406 | |||
| 407 | (let* ((emacs (string-append (assoc-ref %build-inputs "emacs") | ||
| 408 | "/bin/emacs")) | ||
| 409 | (magit (string-append (assoc-ref %build-inputs "magit") | ||
| 410 | "/share/emacs/site-lisp")) | ||
| 411 | (commit (string-append (assoc-ref %build-inputs | ||
| 412 | "magit/git-modes") | ||
| 413 | "/share/emacs/site-lisp")) | ||
| 414 | (source (assoc-ref %build-inputs "source")) | ||
| 415 | (lisp-dir (string-append %output "/share/emacs/site-lisp"))) | ||
| 416 | (mkdir-p lisp-dir) | ||
| 417 | (copy-file (string-append source "/magit-svn.el") | ||
| 418 | (string-append lisp-dir "/magit-svn.el")) | ||
| 419 | |||
| 420 | (with-directory-excursion lisp-dir | ||
| 421 | (parameterize ((%emacs emacs)) | ||
| 422 | (emacs-generate-autoloads ,name lisp-dir) | ||
| 423 | (setenv "EMACSLOADPATH" | ||
| 424 | (string-append ":" magit ":" commit)) | ||
| 425 | (emacs-batch-eval '(byte-compile-file "magit-svn.el")))))))) | ||
| 426 | (home-page "https://github.com/magit/magit-svn") | ||
| 427 | (synopsis "Git-SVN extension to Magit") | ||
| 428 | (description | ||
| 429 | "This package is an extension to Magit, the Git Emacs mode, providing | ||
| 430 | support for Git-SVN.") | ||
| 431 | (license license:gpl3+))) | ||
| 432 | |||
| 289 | 433 | ||
| 290 | ;;; | 434 | ;;; |
| 291 | ;;; Web browsing. | 435 | ;;; Web browsing. |
diff --git a/gnu/packages/feh.scm b/gnu/packages/feh.scm index 84edad419e7..ae7c8200114 100644 --- a/gnu/packages/feh.scm +++ b/gnu/packages/feh.scm | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | (define-public feh | 29 | (define-public feh |
| 30 | (package | 30 | (package |
| 31 | (name "feh") | 31 | (name "feh") |
| 32 | (version "2.12") | 32 | (version "2.13") |
| 33 | (home-page "https://feh.finalrewind.org/") | 33 | (home-page "https://feh.finalrewind.org/") |
| 34 | (source (origin | 34 | (source (origin |
| 35 | (method url-fetch) | 35 | (method url-fetch) |
| @@ -37,7 +37,7 @@ | |||
| 37 | name "-" version ".tar.bz2")) | 37 | name "-" version ".tar.bz2")) |
| 38 | (sha256 | 38 | (sha256 |
| 39 | (base32 | 39 | (base32 |
| 40 | "0ckhidmsms2l5jycp0qf71jzmb3bpbhjq3bcgfpvfvszah7pmq30")))) | 40 | "06fa9zh1zpi63l90kw3l9a0sfavf424j7ksi396ifg9669gx35gn")))) |
| 41 | (build-system gnu-build-system) | 41 | (build-system gnu-build-system) |
| 42 | (arguments | 42 | (arguments |
| 43 | '(#:phases (alist-delete 'configure %standard-phases) | 43 | '(#:phases (alist-delete 'configure %standard-phases) |
diff --git a/gnu/packages/fltk.scm b/gnu/packages/fltk.scm index 1ac1f2507e3..7a414603256 100644 --- a/gnu/packages/fltk.scm +++ b/gnu/packages/fltk.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014 John Darrington <jmd@gnu.org> | 2 | ;;; Copyright © 2014 John Darrington <jmd@gnu.org> |
| 3 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -17,7 +18,10 @@ | |||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | 19 | ||
| 19 | (define-module (gnu packages fltk) | 20 | (define-module (gnu packages fltk) |
| 20 | #:use-module (guix licenses) | 21 | #:use-module ((guix licenses) #:select (lgpl2.0)) |
| 22 | #:use-module (gnu packages) | ||
| 23 | #:use-module (gnu packages compression) | ||
| 24 | #:use-module (gnu packages image) | ||
| 21 | #:use-module (gnu packages xorg) | 25 | #:use-module (gnu packages xorg) |
| 22 | #:use-module (gnu packages gl) | 26 | #:use-module (gnu packages gl) |
| 23 | #:use-module (guix packages) | 27 | #:use-module (guix packages) |
| @@ -35,11 +39,15 @@ | |||
| 35 | "/fltk-" version "-source.tar.gz")) | 39 | "/fltk-" version "-source.tar.gz")) |
| 36 | (sha256 | 40 | (sha256 |
| 37 | (base32 | 41 | (base32 |
| 38 | "15qd7lkz5d5ynz70xhxhigpz3wns39v9xcf7ggkl0792syc8sfgq")))) | 42 | "15qd7lkz5d5ynz70xhxhigpz3wns39v9xcf7ggkl0792syc8sfgq")) |
| 43 | (patches (list (search-patch "fltk-shared-lib-defines.patch"))))) | ||
| 39 | (build-system gnu-build-system) | 44 | (build-system gnu-build-system) |
| 40 | (inputs | 45 | (inputs |
| 41 | `(("libx11" ,libx11) | 46 | `(("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9 |
| 42 | ("mesa" ,mesa))) | 47 | ("libpng" ,libpng) |
| 48 | ("libx11" ,libx11) | ||
| 49 | ("mesa" ,mesa) | ||
| 50 | ("zlib" ,zlib))) | ||
| 43 | (arguments | 51 | (arguments |
| 44 | `(#:tests? #f ;TODO: compile programs in "test" dir | 52 | `(#:tests? #f ;TODO: compile programs in "test" dir |
| 45 | #:configure-flags | 53 | #:configure-flags |
| @@ -51,7 +59,22 @@ | |||
| 51 | (lambda _ | 59 | (lambda _ |
| 52 | (substitute* "makeinclude.in" | 60 | (substitute* "makeinclude.in" |
| 53 | (("/bin/sh") (which "sh")))) | 61 | (("/bin/sh") (which "sh")))) |
| 54 | %standard-phases))) | 62 | (alist-cons-after |
| 63 | 'install 'patch-config | ||
| 64 | ;; Provide -L flags for image libraries when querying fltk-config to | ||
| 65 | ;; avoid propagating inputs. | ||
| 66 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 67 | (use-modules (srfi srfi-26)) | ||
| 68 | (let* ((conf (string-append (assoc-ref outputs "out") | ||
| 69 | "/bin/fltk-config")) | ||
| 70 | (jpeg (assoc-ref inputs "libjpeg")) | ||
| 71 | (png (assoc-ref inputs "libpng")) | ||
| 72 | (zlib (assoc-ref inputs "zlib"))) | ||
| 73 | (substitute* conf | ||
| 74 | (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg")) | ||
| 75 | (("-lpng") (string-append "-L" png "/lib -lpng")) | ||
| 76 | (("-lz") (string-append "-L" zlib "/lib -lz"))))) | ||
| 77 | %standard-phases)))) | ||
| 55 | (home-page "http://www.fltk.org") | 78 | (home-page "http://www.fltk.org") |
| 56 | (synopsis "3D C++ GUI library") | 79 | (synopsis "3D C++ GUI library") |
| 57 | (description "FLTK is a C++ GUI toolkit providing modern GUI functionality | 80 | (description "FLTK is a C++ GUI toolkit providing modern GUI functionality |
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 386f4c59722..c5b55f30a2b 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | 2 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
| 3 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> | 3 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
| 4 | ;;; Copyright © 2015 Andy Wingo <wingo@pobox.com> | ||
| 5 | ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> | ||
| 6 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | ||
| 4 | ;;; | 7 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 8 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 9 | ;;; |
| @@ -18,12 +21,22 @@ | |||
| 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 22 | ||
| 20 | (define-module (gnu packages freedesktop) | 23 | (define-module (gnu packages freedesktop) |
| 21 | #:use-module ((guix licenses) #:select (expat x11)) | 24 | #:use-module ((guix licenses) #:prefix license:) |
| 22 | #:use-module (guix packages) | 25 | #:use-module (guix packages) |
| 23 | #:use-module (guix download) | 26 | #:use-module (guix download) |
| 27 | #:use-module (guix git-download) | ||
| 24 | #:use-module (guix build-system gnu) | 28 | #:use-module (guix build-system gnu) |
| 29 | #:use-module (guix build-system python) | ||
| 30 | #:use-module (gnu packages gnome) | ||
| 31 | #:use-module (gnu packages python) | ||
| 25 | #:use-module (gnu packages linux) | 32 | #:use-module (gnu packages linux) |
| 26 | #:use-module (gnu packages pkg-config) | 33 | #:use-module (gnu packages pkg-config) |
| 34 | #:use-module (gnu packages autotools) | ||
| 35 | #:use-module (gnu packages gettext) | ||
| 36 | #:use-module (gnu packages gperf) | ||
| 37 | #:use-module (gnu packages xml) | ||
| 38 | #:use-module (gnu packages docbook) | ||
| 39 | #:use-module (gnu packages glib) ;intltool | ||
| 27 | #:use-module (gnu packages xdisorg) | 40 | #:use-module (gnu packages xdisorg) |
| 28 | #:use-module (gnu packages xorg)) | 41 | #:use-module (gnu packages xorg)) |
| 29 | 42 | ||
| @@ -48,7 +61,7 @@ | |||
| 48 | (description "The xdg-utils package is a set of simple scripts that | 61 | (description "The xdg-utils package is a set of simple scripts that |
| 49 | provide basic desktop integration functions in the framework of the | 62 | provide basic desktop integration functions in the framework of the |
| 50 | freedesktop.org project.") | 63 | freedesktop.org project.") |
| 51 | (license expat))) | 64 | (license license:expat))) |
| 52 | 65 | ||
| 53 | (define-public libinput | 66 | (define-public libinput |
| 54 | (package | 67 | (package |
| @@ -74,4 +87,113 @@ freedesktop.org project.") | |||
| 74 | (description | 87 | (description |
| 75 | "Libinput is a library to handle input devices for display servers and | 88 | "Libinput is a library to handle input devices for display servers and |
| 76 | other applications that need to directly deal with input devices.") | 89 | other applications that need to directly deal with input devices.") |
| 77 | (license x11))) | 90 | (license license:x11))) |
| 91 | |||
| 92 | (define-public elogind | ||
| 93 | (let ((commit "14405a9")) | ||
| 94 | (package | ||
| 95 | (name "elogind") | ||
| 96 | (version (string-append "219." commit)) | ||
| 97 | (source (origin | ||
| 98 | (method git-fetch) | ||
| 99 | (uri (git-reference | ||
| 100 | (url "http://git.elephly.net/software/elogind.git") | ||
| 101 | (commit commit))) | ||
| 102 | (sha256 | ||
| 103 | (base32 | ||
| 104 | "1wz5lxj95qg64x2q5hf4zcb35hpxlw3wfswx6sb2srvsg50y3y72")) | ||
| 105 | (file-name (string-append name "-checkout-" commit)) | ||
| 106 | (modules '((guix build utils))) | ||
| 107 | (snippet | ||
| 108 | '(begin | ||
| 109 | (use-modules (guix build utils)) | ||
| 110 | (substitute* "Makefile.am" | ||
| 111 | ;; Avoid validation against DTD because the DTDs for | ||
| 112 | ;; both doctype 4.2 and 4.5 are needed. | ||
| 113 | (("XSLTPROC_FLAGS = ") "XSLTPROC_FLAGS = --novalid")))))) | ||
| 114 | (build-system gnu-build-system) | ||
| 115 | (arguments | ||
| 116 | `(#:configure-flags | ||
| 117 | (list | ||
| 118 | ;; pam_elogind fails because of bus-error.c hackery | ||
| 119 | "--disable-pam" | ||
| 120 | (string-append "--with-rootprefix=" (assoc-ref %outputs "out"))) | ||
| 121 | #:phases | ||
| 122 | (modify-phases %standard-phases | ||
| 123 | (add-after 'unpack 'autogen | ||
| 124 | (lambda _ | ||
| 125 | (and (zero? (system* "intltoolize" "--force" "--automake")) | ||
| 126 | (zero? (system* "autoreconf" "-vif")))))))) | ||
| 127 | (native-inputs | ||
| 128 | `(("intltool" ,intltool) | ||
| 129 | ("gettext" ,gnu-gettext) | ||
| 130 | ("docbook-xsl" ,docbook-xsl) | ||
| 131 | ("docbook-xml" ,docbook-xml) | ||
| 132 | ("xsltproc" ,libxslt) | ||
| 133 | ("libxml2" ,libxml2) ;for XML_CATALOG_FILES | ||
| 134 | ("pkg-config", pkg-config) | ||
| 135 | ("autoconf" ,autoconf) | ||
| 136 | ("automake" ,automake) | ||
| 137 | ("libtool" ,libtool) | ||
| 138 | ("gperf" ,gperf))) | ||
| 139 | (inputs | ||
| 140 | `(("linux-pam" ,linux-pam) | ||
| 141 | ("linux-libre-headers" ,linux-libre-headers) | ||
| 142 | ("libcap" ,libcap) | ||
| 143 | ("dbus" ,dbus) | ||
| 144 | ("eudev" ,eudev))) | ||
| 145 | (home-page "https://github.com/andywingo/elogind") | ||
| 146 | (synopsis "User, seat, and session management service") | ||
| 147 | (description "Elogind is the systemd project's \"logind\" service, | ||
| 148 | extracted out as a separate project. Elogind integrates with PAM to provide | ||
| 149 | the org.freedesktop.login1 interface over the system bus, allowing other parts | ||
| 150 | of a the system to know what users are logged in, and where.") | ||
| 151 | (license license:lgpl2.1+)))) | ||
| 152 | |||
| 153 | (define-public python-pyxdg | ||
| 154 | (package | ||
| 155 | (name "python-pyxdg") | ||
| 156 | (version "0.25") | ||
| 157 | (source | ||
| 158 | (origin | ||
| 159 | (method url-fetch) | ||
| 160 | (uri (string-append | ||
| 161 | "https://pypi.python.org/packages/source/p/pyxdg/pyxdg-" | ||
| 162 | version ".tar.gz")) | ||
| 163 | (sha256 | ||
| 164 | (base32 | ||
| 165 | "179767h8m634ydlm4v8lnz01ba42gckfp684id764zaip7h87s41")))) | ||
| 166 | (build-system python-build-system) | ||
| 167 | (arguments | ||
| 168 | '(#:phases | ||
| 169 | (alist-replace | ||
| 170 | 'check | ||
| 171 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 172 | (setenv "XDG_DATA_DIRS" | ||
| 173 | (string-append (assoc-ref inputs "shared-mime-info") | ||
| 174 | "/share/")) | ||
| 175 | (substitute* "test/test-icon.py" | ||
| 176 | (("/usr/share/icons/hicolor/index.theme") | ||
| 177 | (string-append (assoc-ref inputs "hicolor-icon-theme") | ||
| 178 | "/share/icons/hicolor/index.theme"))) | ||
| 179 | |||
| 180 | ;; One test fails with: | ||
| 181 | ;; AssertionError: 'x-apple-ios-png' != 'png' | ||
| 182 | (substitute* "test/test-mime.py" | ||
| 183 | (("self.check_mimetype\\(imgpng, 'image', 'png'\\)") "#")) | ||
| 184 | (zero? (system* "nosetests" "-v"))) | ||
| 185 | %standard-phases))) | ||
| 186 | (native-inputs | ||
| 187 | `(("shared-mime-info" ,shared-mime-info) ;for tests | ||
| 188 | ("hicolor-icon-theme" ,hicolor-icon-theme) ;for tests | ||
| 189 | ("python-nose" ,python-nose) | ||
| 190 | ("python-setuptools" ,python-setuptools))) | ||
| 191 | (home-page "http://freedesktop.org/wiki/Software/pyxdg") | ||
| 192 | (synopsis "Implementations of freedesktop.org standards in Python") | ||
| 193 | (description | ||
| 194 | "PyXDG is a collection of implementations of freedesktop.org standards in | ||
| 195 | Python") | ||
| 196 | (license license:lgpl2.0))) | ||
| 197 | |||
| 198 | (define-public python2-pyxdg | ||
| 199 | (package-with-python2 python-pyxdg)) | ||
diff --git a/gnu/packages/ftp.scm b/gnu/packages/ftp.scm index 22ea1af9653..790ffc66c2d 100644 --- a/gnu/packages/ftp.scm +++ b/gnu/packages/ftp.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | 3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
| 4 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | 4 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
| 5 | ;;; | 5 | ;;; |
| @@ -36,8 +36,10 @@ | |||
| 36 | (version "4.6.1") | 36 | (version "4.6.1") |
| 37 | (source (origin | 37 | (source (origin |
| 38 | (method url-fetch) | 38 | (method url-fetch) |
| 39 | (uri (string-append "http://lftp.yar.ru/ftp/lftp-" | 39 | (uri (list (string-append "http://lftp.yar.ru/ftp/lftp-" |
| 40 | version ".tar.xz")) | 40 | version ".tar.xz") |
| 41 | (string-append "http://lftp.yar.ru/ftp/old/lftp-" | ||
| 42 | version ".tar.xz"))) | ||
| 41 | (sha256 | 43 | (sha256 |
| 42 | (base32 | 44 | (base32 |
| 43 | "1grmp8zg7cjgjinz66mrh53whigkqzl90nlxj05hapnhk3ns3vni")) | 45 | "1grmp8zg7cjgjinz66mrh53whigkqzl90nlxj05hapnhk3ns3vni")) |
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 219176722ad..14209f4b7e0 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm | |||
| @@ -33,7 +33,11 @@ | |||
| 33 | #:use-module (gnu packages fontutils) | 33 | #:use-module (gnu packages fontutils) |
| 34 | #:use-module (gnu packages image) | 34 | #:use-module (gnu packages image) |
| 35 | #:use-module (gnu packages audio) | 35 | #:use-module (gnu packages audio) |
| 36 | #:use-module (gnu packages pulseaudio)) | 36 | #:use-module (gnu packages pulseaudio) |
| 37 | #:use-module (gnu packages gnome) | ||
| 38 | #:use-module (gnu packages gtk) | ||
| 39 | #:use-module (gnu packages sdl) | ||
| 40 | #:use-module (gnu packages pkg-config)) | ||
| 37 | 41 | ||
| 38 | (define-public bullet | 42 | (define-public bullet |
| 39 | (package | 43 | (package |
| @@ -127,3 +131,40 @@ clone.") | |||
| 127 | to ease the development of games and multimedia applications. It is composed | 131 | to ease the development of games and multimedia applications. It is composed |
| 128 | of five modules: system, window, graphics, audio and network.") | 132 | of five modules: system, window, graphics, audio and network.") |
| 129 | (license license:zlib))) | 133 | (license license:zlib))) |
| 134 | |||
| 135 | (define-public sfxr | ||
| 136 | (package | ||
| 137 | (name "sfxr") | ||
| 138 | (version "1.2.1") | ||
| 139 | (source (origin | ||
| 140 | (method url-fetch) | ||
| 141 | (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz")) | ||
| 142 | (sha256 | ||
| 143 | (base32 | ||
| 144 | "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya")))) | ||
| 145 | (build-system gnu-build-system) | ||
| 146 | (arguments | ||
| 147 | `(#:phases (modify-phases %standard-phases | ||
| 148 | (delete 'configure) ; no configure script | ||
| 149 | (add-before 'build 'patch-makefile | ||
| 150 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 151 | (let ((out (assoc-ref outputs "out"))) | ||
| 152 | (substitute* "Makefile" | ||
| 153 | (("\\$\\(DESTDIR\\)/usr") out)) | ||
| 154 | (substitute* "main.cpp" | ||
| 155 | (("/usr/share") | ||
| 156 | (string-append out "/share"))) | ||
| 157 | #t)))) | ||
| 158 | #:tests? #f)) ; no tests | ||
| 159 | (native-inputs | ||
| 160 | `(("pkg-config" ,pkg-config) | ||
| 161 | ("desktop-file-utils" ,desktop-file-utils))) | ||
| 162 | (inputs | ||
| 163 | `(("sdl" ,sdl) | ||
| 164 | ("gtk+" ,gtk+))) | ||
| 165 | (synopsis "Simple sound effect generator") | ||
| 166 | (description "Sfxr is a tool for quickly generating simple sound effects. | ||
| 167 | Originally created for use in video game prototypes, it can generate random | ||
| 168 | sounds from presets such as \"explosion\" or \"powerup\".") | ||
| 169 | (home-page "http://www.drpetter.se/project_sfxr.html") | ||
| 170 | (license license:expat))) | ||
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index d86e151a853..8f495f7b32b 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm | |||
| @@ -108,7 +108,7 @@ representation of the playing board.") | |||
| 108 | (define-public gnubik | 108 | (define-public gnubik |
| 109 | (package | 109 | (package |
| 110 | (name "gnubik") | 110 | (name "gnubik") |
| 111 | (version "2.4.1") | 111 | (version "2.4.2") |
| 112 | (source | 112 | (source |
| 113 | (origin | 113 | (origin |
| 114 | (method url-fetch) | 114 | (method url-fetch) |
| @@ -116,7 +116,7 @@ representation of the playing board.") | |||
| 116 | version ".tar.gz")) | 116 | version ".tar.gz")) |
| 117 | (sha256 | 117 | (sha256 |
| 118 | (base32 | 118 | (base32 |
| 119 | "0mfpwz341i1qpzi2qgslpc5i7d4fv7i01kv392m11pczqdc7i7m5")))) | 119 | "0mhpfnxzbns0wfrsjv5vafqr34770rbvkmdzxk0x0aq67hb3zyl5")))) |
| 120 | (build-system gnu-build-system) | 120 | (build-system gnu-build-system) |
| 121 | (inputs `(("gtk+" ,gtk+-2) | 121 | (inputs `(("gtk+" ,gtk+-2) |
| 122 | ("mesa" ,mesa) | 122 | ("mesa" ,mesa) |
| @@ -748,6 +748,43 @@ some of the restrictions in the venerable Z-machine format. This is the | |||
| 748 | reference interpreter, using Glk API.") | 748 | reference interpreter, using Glk API.") |
| 749 | (license (license:fsf-free "file://README")))) | 749 | (license (license:fsf-free "file://README")))) |
| 750 | 750 | ||
| 751 | (define-public fizmo | ||
| 752 | (package | ||
| 753 | (name "fizmo") | ||
| 754 | (version "0.7.9") | ||
| 755 | (source (origin | ||
| 756 | (method url-fetch) | ||
| 757 | (uri (string-append "https://christoph-ender.de/fizmo/source/" | ||
| 758 | name "-" version ".tar.gz")) | ||
| 759 | (sha256 | ||
| 760 | (base32 | ||
| 761 | "1w7cgyjrhgkadjrazijzhq7zh0pl5bfc6wl7mdpgh020y4kp46d7")))) | ||
| 762 | (build-system gnu-build-system) | ||
| 763 | (arguments | ||
| 764 | '(#:configure-flags | ||
| 765 | (let ((libjpeg (assoc-ref %build-inputs "libjpeg")) | ||
| 766 | (ncurses (assoc-ref %build-inputs "ncurses"))) | ||
| 767 | (list (string-append "jpeg_CFLAGS=-I" libjpeg "/include") | ||
| 768 | (string-append "jpeg_LIBS=-ljpeg") | ||
| 769 | (string-append "ncursesw_CFLAGS=-I" ncurses "/include") | ||
| 770 | (string-append "ncursesw_LIBS=-lncursesw"))))) | ||
| 771 | (native-inputs | ||
| 772 | `(("pkg-config" ,pkg-config))) | ||
| 773 | (inputs | ||
| 774 | `(("libjpeg" ,libjpeg) | ||
| 775 | ("libpng" ,libpng) | ||
| 776 | ("libsndfile" ,libsndfile) | ||
| 777 | ("libxml2" ,libxml2) | ||
| 778 | ("ncurses" ,ncurses) | ||
| 779 | ("sdl" ,sdl))) | ||
| 780 | (home-page "https://christoph-ender.de/fizmo/") | ||
| 781 | (synopsis "Z-machine interpreter") | ||
| 782 | (description | ||
| 783 | "Fizmo is a console-based Z-machine interpreter. It is used to play | ||
| 784 | interactive ficiton, also known as textadventures, which were implemented | ||
| 785 | either by Infocom or created using the Inform compiler.") | ||
| 786 | (license license:bsd-3))) | ||
| 787 | |||
| 751 | (define-public retroarch | 788 | (define-public retroarch |
| 752 | (package | 789 | (package |
| 753 | (name "retroarch") | 790 | (name "retroarch") |
| @@ -879,3 +916,37 @@ bones. | |||
| 879 | This game is based on the GPL version of the famous game TuxRacer.") | 916 | This game is based on the GPL version of the famous game TuxRacer.") |
| 880 | (home-page "http://sourceforge.net/projects/extremetuxracer/") | 917 | (home-page "http://sourceforge.net/projects/extremetuxracer/") |
| 881 | (license license:gpl2+))) | 918 | (license license:gpl2+))) |
| 919 | |||
| 920 | (define-public gnujump | ||
| 921 | (package | ||
| 922 | (name "gnujump") | ||
| 923 | (version "1.0.8") | ||
| 924 | (source (origin | ||
| 925 | (method url-fetch) | ||
| 926 | (uri (string-append "mirror://gnu/gnujump/gnujump-" | ||
| 927 | version ".tar.gz")) | ||
| 928 | (sha256 | ||
| 929 | (base32 | ||
| 930 | "05syy9mzbyqcfnm0hrswlmhwlwx54f0l6zhcaq8c1c0f8dgzxhqk")))) | ||
| 931 | (build-system gnu-build-system) | ||
| 932 | (arguments | ||
| 933 | '(#:phases | ||
| 934 | (modify-phases %standard-phases | ||
| 935 | (add-before | ||
| 936 | 'configure 'link-libm | ||
| 937 | (lambda _ (setenv "LIBS" "-lm")))))) | ||
| 938 | (inputs | ||
| 939 | `(("glu" ,glu) | ||
| 940 | ("mesa", mesa) | ||
| 941 | ("sdl" ,sdl) | ||
| 942 | ("sdl-image" ,sdl-image) | ||
| 943 | ("sdl-mixer" ,sdl-mixer))) | ||
| 944 | (home-page "http://gnujump.es.gnu.org/") | ||
| 945 | (synopsis | ||
| 946 | "Game of jumping to the next floor, trying not to fall") | ||
| 947 | (description | ||
| 948 | "GNUjump is a simple, yet addictive game in which you must jump from | ||
| 949 | platform to platform to avoid falling, while the platforms drop at faster rates | ||
| 950 | the higher you go. The game features multiplayer, unlimited FPS, smooth floor | ||
| 951 | falling, themeable graphics and sounds, and replays.") | ||
| 952 | (license license:gpl3+))) | ||
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 48ef72933dd..414f31cb3cb 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm | |||
| @@ -335,7 +335,9 @@ Go. It also includes runtime support libraries for these languages.") | |||
| 335 | (sha256 | 335 | (sha256 |
| 336 | (base32 | 336 | (base32 |
| 337 | "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp")) | 337 | "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp")) |
| 338 | (patches (origin-patches (package-source gcc-4.9))))))) | 338 | (patches (map search-patch |
| 339 | '("gcc-arm-link-spec-fix.patch" | ||
| 340 | "gcc-5.0-libvtv-runpath.patch"))))))) | ||
| 339 | 341 | ||
| 340 | (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t)) | 342 | (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t)) |
| 341 | "Return a custom version of GCC that supports LANGUAGES." | 343 | "Return a custom version of GCC that supports LANGUAGES." |
| @@ -405,38 +407,57 @@ Go. It also includes runtime support libraries for these languages.") | |||
| 405 | "--enable-languages=java" | 407 | "--enable-languages=java" |
| 406 | ,@(remove (cut string-match "--enable-languages.*" <>) | 408 | ,@(remove (cut string-match "--enable-languages.*" <>) |
| 407 | ,flags)))) | 409 | ,flags)))) |
| 408 | ((#:phases phases) | 410 | ((#:phases phases) |
| 409 | `(alist-cons-after | 411 | `(modify-phases ,phases |
| 410 | 'install 'install-javac-and-javap-wrappers | 412 | (add-after |
| 411 | (lambda _ | 413 | 'unpack 'add-lib-output-to-rpath |
| 412 | (let* ((javac (assoc-ref %build-inputs "javac.in")) | 414 | (lambda _ |
| 413 | (ecj (assoc-ref %build-inputs "ecj-bootstrap")) | 415 | (substitute* "libjava/Makefile.in" |
| 414 | (gcj (assoc-ref %outputs "out")) | 416 | (("libgcj_bc_dummy_LINK = .* -shared" line) |
| 415 | (gcjbin (string-append gcj "/bin/")) | 417 | (string-append line " -Wl,-rpath=$(libdir)")) |
| 416 | (jvm (string-append gcj "/lib/jvm/")) | 418 | (("libgcj(_bc)?_la_LDFLAGS =" ldflags _) |
| 417 | (target (string-append jvm "/bin/javac"))) | 419 | (string-append ldflags " -Wl,-rpath=$(libdir)"))))) |
| 418 | 420 | (add-after | |
| 419 | (symlink (string-append gcjbin "jcf-dump") | 421 | 'install 'install-javac-and-javap-wrappers |
| 420 | (string-append jvm "/bin/javap")) | 422 | (lambda _ |
| 421 | 423 | (let* ((javac (assoc-ref %build-inputs "javac.in")) | |
| 422 | (copy-file ecj (string-append gcj "/share/java/ecj.jar")) | 424 | (ecj (assoc-ref %build-inputs "ecj-bootstrap")) |
| 423 | 425 | (gcj (assoc-ref %outputs "out")) | |
| 424 | ;; Create javac wrapper from the template javac.in by | 426 | (gcjbin (string-append gcj "/bin/")) |
| 425 | ;; replacing the @VARIABLES@ with paths. | 427 | (jvm (string-append gcj "/lib/jvm/")) |
| 426 | (copy-file javac target) | 428 | (target (string-append jvm "/bin/javac"))) |
| 427 | (patch-shebang target) | 429 | |
| 428 | (substitute* target | 430 | (symlink (string-append gcjbin "jcf-dump") |
| 429 | (("@JAVA@") | 431 | (string-append jvm "/bin/javap")) |
| 430 | (string-append jvm "/bin/java")) | 432 | |
| 431 | (("@ECJ_JAR@") | 433 | (copy-file ecj (string-append gcj "/share/java/ecj.jar")) |
| 432 | (string-append gcj "/share/java/ecj.jar")) | 434 | |
| 433 | (("@RT_JAR@") | 435 | ;; Create javac wrapper from the template javac.in by |
| 434 | (string-append jvm "/jre/lib/rt.jar")) | 436 | ;; replacing the @VARIABLES@ with paths. |
| 435 | (("@TOOLS_JAR@") | 437 | (copy-file javac target) |
| 436 | (string-append jvm "/lib/tools.jar"))) | 438 | (patch-shebang target) |
| 437 | (chmod target #o755) | 439 | (substitute* target |
| 438 | #t)) | 440 | (("@JAVA@") |
| 439 | ,phases)))))) | 441 | (string-append jvm "/bin/java")) |
| 442 | (("@ECJ_JAR@") | ||
| 443 | (string-append gcj "/share/java/ecj.jar")) | ||
| 444 | (("@RT_JAR@") | ||
| 445 | (string-append jvm "/jre/lib/rt.jar")) | ||
| 446 | (("@TOOLS_JAR@") | ||
| 447 | (string-append jvm "/lib/tools.jar"))) | ||
| 448 | (chmod target #o755) | ||
| 449 | #t))) | ||
| 450 | (add-after | ||
| 451 | 'install 'remove-broken-or-conflicting-files | ||
| 452 | (lambda _ | ||
| 453 | (let ((out (assoc-ref %outputs "out"))) | ||
| 454 | (for-each | ||
| 455 | delete-file | ||
| 456 | (append (find-files (string-append out "/lib/jvm/jre/lib") | ||
| 457 | "libjawt.so") | ||
| 458 | (find-files (string-append out "/bin") | ||
| 459 | ".*(c\\+\\+|cpp|g\\+\\+|gcc.*)")))) | ||
| 460 | #t)))))))) | ||
| 440 | 461 | ||
| 441 | (define ecj-bootstrap-4.8 | 462 | (define ecj-bootstrap-4.8 |
| 442 | (origin | 463 | (origin |
diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm index 018f564e67a..9c0b3ea3075 100644 --- a/gnu/packages/gdb.scm +++ b/gnu/packages/gdb.scm | |||
| @@ -36,14 +36,14 @@ | |||
| 36 | (define-public gdb | 36 | (define-public gdb |
| 37 | (package | 37 | (package |
| 38 | (name "gdb") | 38 | (name "gdb") |
| 39 | (version "7.9") | 39 | (version "7.9.1") |
| 40 | (source (origin | 40 | (source (origin |
| 41 | (method url-fetch) | 41 | (method url-fetch) |
| 42 | (uri (string-append "mirror://gnu/gdb/gdb-" | 42 | (uri (string-append "mirror://gnu/gdb/gdb-" |
| 43 | version ".tar.xz")) | 43 | version ".tar.xz")) |
| 44 | (sha256 | 44 | (sha256 |
| 45 | (base32 | 45 | (base32 |
| 46 | "14l3hhsy7fmpn2dk7ivc67gnbjdhkxlq90kxijpzfa35l58mcccv")))) | 46 | "0h5sfg4ndhb8q4fxbq0hdxfjp35n6ih96f6x8yvb418s84x5976d")))) |
| 47 | (build-system gnu-build-system) | 47 | (build-system gnu-build-system) |
| 48 | (arguments | 48 | (arguments |
| 49 | '(#:tests? #f ; FIXME "make check" fails on single-processor systems. | 49 | '(#:tests? #f ; FIXME "make check" fails on single-processor systems. |
diff --git a/gnu/packages/gimp.scm b/gnu/packages/gimp.scm index 25a41690dd8..35c55dc2f9b 100644 --- a/gnu/packages/gimp.scm +++ b/gnu/packages/gimp.scm | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #:use-module (gnu packages compression) | 32 | #:use-module (gnu packages compression) |
| 33 | #:use-module (gnu packages xml) | 33 | #:use-module (gnu packages xml) |
| 34 | #:use-module (gnu packages photo) | 34 | #:use-module (gnu packages photo) |
| 35 | #:use-module (gnu packages python) | ||
| 35 | #:use-module (gnu packages xorg) | 36 | #:use-module (gnu packages xorg) |
| 36 | #:use-module (gnu packages imagemagick)) | 37 | #:use-module (gnu packages imagemagick)) |
| 37 | 38 | ||
| @@ -127,10 +128,6 @@ buffers.") | |||
| 127 | (base32 | 128 | (base32 |
| 128 | "0bdj0l7a94jqhjnj40m9rqaf622wj905iximivb55iy98639aanq")))) | 129 | "0bdj0l7a94jqhjnj40m9rqaf622wj905iximivb55iy98639aanq")))) |
| 129 | (build-system gnu-build-system) | 130 | (build-system gnu-build-system) |
| 130 | (arguments | ||
| 131 | `(#:configure-flags | ||
| 132 | ;; We don't have pygtk which seems to be needed for this feature | ||
| 133 | `("--disable-python"))) | ||
| 134 | (inputs | 131 | (inputs |
| 135 | `(("babl" ,babl) | 132 | `(("babl" ,babl) |
| 136 | ("glib" ,glib) | 133 | ("glib" ,glib) |
| @@ -141,6 +138,8 @@ buffers.") | |||
| 141 | ("exif" ,libexif) ;optional, EXIF + XMP support | 138 | ("exif" ,libexif) ;optional, EXIF + XMP support |
| 142 | ("lcms" ,lcms) ;optional, color management | 139 | ("lcms" ,lcms) ;optional, color management |
| 143 | ("librsvg" ,librsvg) ;optional, SVG support | 140 | ("librsvg" ,librsvg) ;optional, SVG support |
| 141 | ("python" ,python-2) ;optional, Python support | ||
| 142 | ("python2-pygtk" ,python2-pygtk) ;optional, Python support | ||
| 144 | ("gegl" ,gegl))) | 143 | ("gegl" ,gegl))) |
| 145 | (native-inputs | 144 | (native-inputs |
| 146 | `(("pkg-config" ,pkg-config) | 145 | `(("pkg-config" ,pkg-config) |
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index afda76d792b..d1503e17307 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> | 2 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
| 3 | ;;; Copyright © 2013 Joshua Grant <tadni@riseup.net> | 3 | ;;; Copyright © 2013 Joshua Grant <tadni@riseup.net> |
| 4 | ;;; Copyright © 2014 David Thompson <davet@gnu.org> | 4 | ;;; Copyright © 2014 David Thompson <davet@gnu.org> |
| 5 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> | 5 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
| @@ -40,7 +40,8 @@ | |||
| 40 | #:use-module (gnu packages fontutils) | 40 | #:use-module (gnu packages fontutils) |
| 41 | #:use-module (gnu packages guile) | 41 | #:use-module (gnu packages guile) |
| 42 | #:use-module (gnu packages video) | 42 | #:use-module (gnu packages video) |
| 43 | #:use-module (gnu packages xdisorg)) | 43 | #:use-module (gnu packages xdisorg) |
| 44 | #:use-module (gnu packages zip)) | ||
| 44 | 45 | ||
| 45 | (define-public glu | 46 | (define-public glu |
| 46 | (package | 47 | (package |
| @@ -53,7 +54,8 @@ | |||
| 53 | (sha256 | 54 | (sha256 |
| 54 | (base32 "0r72yyhj09x3krn3kn629jqbwyq50ji8w5ri2pn6zwrk35m4g1s3")))) | 55 | (base32 "0r72yyhj09x3krn3kn629jqbwyq50ji8w5ri2pn6zwrk35m4g1s3")))) |
| 55 | (build-system gnu-build-system) | 56 | (build-system gnu-build-system) |
| 56 | (inputs `(("mesa" ,mesa))) | 57 | (propagated-inputs |
| 58 | `(("mesa" ,mesa))) ; according to glu.pc | ||
| 57 | (home-page "http://www.opengl.org/archives/resources/faq/technical/glu.htm") | 59 | (home-page "http://www.opengl.org/archives/resources/faq/technical/glu.htm") |
| 58 | (synopsis "Mesa OpenGL Utility library") | 60 | (synopsis "Mesa OpenGL Utility library") |
| 59 | (description | 61 | (description |
| @@ -219,7 +221,7 @@ also known as DXTn or DXTC) for Mesa.") | |||
| 219 | (arguments | 221 | (arguments |
| 220 | `(#:configure-flags | 222 | `(#:configure-flags |
| 221 | '(;; drop r300 from default gallium drivers, as it requires llvm | 223 | '(;; drop r300 from default gallium drivers, as it requires llvm |
| 222 | "--with-gallium-drivers=r600,svga,swrast" | 224 | "--with-gallium-drivers=r600,svga,swrast,nouveau" |
| 223 | ;; Enable various optional features. TODO: opencl requires libclc, | 225 | ;; Enable various optional features. TODO: opencl requires libclc, |
| 224 | ;; omx requires libomxil-bellagio | 226 | ;; omx requires libomxil-bellagio |
| 225 | "--with-egl-platforms=x11,drm" | 227 | "--with-egl-platforms=x11,drm" |
| @@ -403,6 +405,7 @@ extension functionality is exposed in a single header file.") | |||
| 403 | (native-inputs `(("pkg-config" ,pkg-config))) | 405 | (native-inputs `(("pkg-config" ,pkg-config))) |
| 404 | (inputs `(("guile" ,guile-2.0) | 406 | (inputs `(("guile" ,guile-2.0) |
| 405 | ("mesa" ,mesa) | 407 | ("mesa" ,mesa) |
| 408 | ("glu" ,glu) | ||
| 406 | ("freeglut" ,freeglut))) | 409 | ("freeglut" ,freeglut))) |
| 407 | (arguments | 410 | (arguments |
| 408 | '(#:phases (alist-cons-before | 411 | '(#:phases (alist-cons-before |
| @@ -417,7 +420,7 @@ extension functionality is exposed in a single header file.") | |||
| 417 | ;; Replace dynamic-link calls for libGL, libGLU, and | 420 | ;; Replace dynamic-link calls for libGL, libGLU, and |
| 418 | ;; libglut with absolute paths to the store. | 421 | ;; libglut with absolute paths to the store. |
| 419 | (dynamic-link-substitute "glx/runtime.scm" "GL" "mesa") | 422 | (dynamic-link-substitute "glx/runtime.scm" "GL" "mesa") |
| 420 | (dynamic-link-substitute "glu/runtime.scm" "GLU" "mesa") | 423 | (dynamic-link-substitute "glu/runtime.scm" "GLU" "glu") |
| 421 | (dynamic-link-substitute "glut/runtime.scm" "glut" | 424 | (dynamic-link-substitute "glut/runtime.scm" "glut" |
| 422 | "freeglut")) | 425 | "freeglut")) |
| 423 | %standard-phases))) | 426 | %standard-phases))) |
| @@ -484,3 +487,45 @@ OpenGL graphics API.") | |||
| 484 | (description | 487 | (description |
| 485 | "A library for handling OpenGL function pointer management.") | 488 | "A library for handling OpenGL function pointer management.") |
| 486 | (license l:x11))) | 489 | (license l:x11))) |
| 490 | |||
| 491 | (define-public soil | ||
| 492 | (package | ||
| 493 | (name "soil") | ||
| 494 | (version "1.0.7") | ||
| 495 | (source (origin | ||
| 496 | (method url-fetch) | ||
| 497 | ;; No versioned archive available. | ||
| 498 | (uri "http://www.lonesock.net/files/soil.zip") | ||
| 499 | (sha256 | ||
| 500 | (base32 | ||
| 501 | "00gpwp9dldzhsdhksjvmbhsd2ialraqbv6v6dpikdmpncj6mnc52")))) | ||
| 502 | (build-system gnu-build-system) | ||
| 503 | (arguments | ||
| 504 | '(#:tests? #f ; no tests | ||
| 505 | #:phases (modify-phases %standard-phases | ||
| 506 | (delete 'configure) | ||
| 507 | (add-before 'build 'init-build | ||
| 508 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 509 | (let ((out (assoc-ref outputs "out"))) | ||
| 510 | (setenv "CFLAGS" "-fPIC") ; needed for shared library | ||
| 511 | ;; Use alternate Makefile | ||
| 512 | (copy-file "projects/makefile/alternate Makefile.txt" | ||
| 513 | "src/Makefile") | ||
| 514 | (chdir "src") | ||
| 515 | (substitute* '("Makefile") | ||
| 516 | (("INCLUDEDIR = /usr/include/SOIL") | ||
| 517 | (string-append "INCLUDEDIR = " out "/include/SOIL")) | ||
| 518 | (("LIBDIR = /usr/lib") | ||
| 519 | (string-append "LIBDIR = " out "/lib")) | ||
| 520 | ;; Remove these flags from 'install' commands. | ||
| 521 | (("-o root -g root") "")))))))) | ||
| 522 | (native-inputs | ||
| 523 | `(("unzip" ,unzip))) | ||
| 524 | (inputs | ||
| 525 | `(("mesa" ,mesa))) | ||
| 526 | (home-page "http://www.lonesock.net/soil.html") | ||
| 527 | (synopsis "OpenGL texture loading library") | ||
| 528 | (description | ||
| 529 | "SOIL is a tiny C library used primarily for uploading textures into | ||
| 530 | OpenGL.") | ||
| 531 | (license l:public-domain))) | ||
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 1d43895f5cb..305c89c022a 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm | |||
| @@ -353,10 +353,11 @@ translated.") | |||
| 353 | (base32 | 353 | (base32 |
| 354 | "1xi1v1msz75qs0s4lkyf1psrksdppa3hwkg0mznc6gpw5flg3hdz")))) | 354 | "1xi1v1msz75qs0s4lkyf1psrksdppa3hwkg0mznc6gpw5flg3hdz")))) |
| 355 | (build-system gnu-build-system) | 355 | (build-system gnu-build-system) |
| 356 | (inputs | 356 | (propagated-inputs ; according to dbus-glib-1.pc |
| 357 | `(("dbus" ,dbus) | 357 | `(("dbus" ,dbus) |
| 358 | ("expat" ,expat) | ||
| 359 | ("glib" ,glib))) | 358 | ("glib" ,glib))) |
| 359 | (inputs | ||
| 360 | `(("expat" ,expat))) | ||
| 360 | (native-inputs | 361 | (native-inputs |
| 361 | `(("glib" ,glib "bin") | 362 | `(("glib" ,glib "bin") |
| 362 | ("pkg-config" ,pkg-config))) | 363 | ("pkg-config" ,pkg-config))) |
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 871cde84910..4af1d13495a 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | ;;; Copyright © 2014, 2015 Federico Beffa <beffa@fbengineering.ch> | 6 | ;;; Copyright © 2014, 2015 Federico Beffa <beffa@fbengineering.ch> |
| 7 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> | 7 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
| 8 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> | 8 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> |
| 9 | ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com> | ||
| 10 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | ||
| 9 | ;;; | 11 | ;;; |
| 10 | ;;; This file is part of GNU Guix. | 12 | ;;; This file is part of GNU Guix. |
| 11 | ;;; | 13 | ;;; |
| @@ -36,14 +38,15 @@ | |||
| 36 | #:use-module (gnu packages cups) | 38 | #:use-module (gnu packages cups) |
| 37 | #:use-module (gnu packages curl) | 39 | #:use-module (gnu packages curl) |
| 38 | #:use-module (gnu packages databases) | 40 | #:use-module (gnu packages databases) |
| 41 | #:use-module (gnu packages djvu) | ||
| 39 | #:use-module (gnu packages flex) | 42 | #:use-module (gnu packages flex) |
| 40 | #:use-module (gnu packages databases) | ||
| 41 | #:use-module (gnu packages docbook) | 43 | #:use-module (gnu packages docbook) |
| 42 | #:use-module (gnu packages glib) | 44 | #:use-module (gnu packages glib) |
| 43 | #:use-module (gnu packages gnupg) | 45 | #:use-module (gnu packages gnupg) |
| 44 | #:use-module (gnu packages gnuzilla) | 46 | #:use-module (gnu packages gnuzilla) |
| 45 | #:use-module (gnu packages gstreamer) | 47 | #:use-module (gnu packages gstreamer) |
| 46 | #:use-module (gnu packages gtk) | 48 | #:use-module (gnu packages gtk) |
| 49 | #:use-module (gnu packages guile) | ||
| 47 | #:use-module (gnu packages pdf) | 50 | #:use-module (gnu packages pdf) |
| 48 | #:use-module (gnu packages polkit) | 51 | #:use-module (gnu packages polkit) |
| 49 | #:use-module (gnu packages popt) | 52 | #:use-module (gnu packages popt) |
| @@ -59,13 +62,20 @@ | |||
| 59 | #:use-module (gnu packages pulseaudio) | 62 | #:use-module (gnu packages pulseaudio) |
| 60 | #:use-module (gnu packages python) | 63 | #:use-module (gnu packages python) |
| 61 | #:use-module (gnu packages scanner) | 64 | #:use-module (gnu packages scanner) |
| 65 | #:use-module (gnu packages ssh) | ||
| 62 | #:use-module (gnu packages xml) | 66 | #:use-module (gnu packages xml) |
| 63 | #:use-module (gnu packages gl) | 67 | #:use-module (gnu packages gl) |
| 64 | #:use-module (gnu packages compression) | 68 | #:use-module (gnu packages compression) |
| 69 | #:use-module (gnu packages texlive) | ||
| 65 | #:use-module (gnu packages web) | 70 | #:use-module (gnu packages web) |
| 71 | #:use-module (gnu packages webkit) | ||
| 66 | #:use-module (gnu packages xorg) | 72 | #:use-module (gnu packages xorg) |
| 67 | #:use-module (gnu packages xdisorg) | 73 | #:use-module (gnu packages xdisorg) |
| 68 | #:use-module (gnu packages ncurses)) | 74 | #:use-module (gnu packages mail) |
| 75 | #:use-module (gnu packages backup) | ||
| 76 | #:use-module (gnu packages nettle) | ||
| 77 | #:use-module (gnu packages ncurses) | ||
| 78 | #:use-module (srfi srfi-1)) | ||
| 69 | 79 | ||
| 70 | (define-public brasero | 80 | (define-public brasero |
| 71 | (package | 81 | (package |
| @@ -176,6 +186,50 @@ Gnome project. It includes xml2po tool which makes it easier to translate | |||
| 176 | and keep up to date translations of documentation.") | 186 | and keep up to date translations of documentation.") |
| 177 | (license license:gpl2+))) ; xslt under lgpl | 187 | (license license:gpl2+))) ; xslt under lgpl |
| 178 | 188 | ||
| 189 | (define-public gcr | ||
| 190 | (package | ||
| 191 | (name "gcr") | ||
| 192 | (version "3.16.0") | ||
| 193 | (source (origin | ||
| 194 | (method url-fetch) | ||
| 195 | (uri (string-append "mirror://gnome/sources/" name "/" | ||
| 196 | (version-major+minor version) "/" | ||
| 197 | name "-" version ".tar.xz")) | ||
| 198 | (sha256 | ||
| 199 | (base32 | ||
| 200 | "0xfhi0w358lvca1jjx24x2gm67mif33dsnmi9cv5i0f83ks8vzpc")))) | ||
| 201 | (build-system gnu-build-system) | ||
| 202 | (arguments | ||
| 203 | '(#:tests? #f ;25 of 598 tests fail because /var/lib/dbus/machine-id does | ||
| 204 | ;not exist | ||
| 205 | #:phases (modify-phases %standard-phases | ||
| 206 | (add-before | ||
| 207 | 'check 'pre-check | ||
| 208 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 209 | (substitute* "build/tap-driver" | ||
| 210 | (("/usr/bin/env python") (which "python")))))))) | ||
| 211 | (inputs | ||
| 212 | `(("dbus" ,dbus) | ||
| 213 | ("gnupg" ,gnupg) ;called as a child process during tests | ||
| 214 | ("libgcrypt" ,libgcrypt))) | ||
| 215 | (native-inputs | ||
| 216 | `(("python" ,python-2) ;for tests | ||
| 217 | ("pkg-config" ,pkg-config) | ||
| 218 | ("glib" ,glib "bin") | ||
| 219 | ("intltool" ,intltool))) | ||
| 220 | ;; mentioned in gck.pc, gcr.pc and gcr-ui.pc | ||
| 221 | (propagated-inputs | ||
| 222 | `(("p11-kit" ,p11-kit) | ||
| 223 | ("glib" ,glib) | ||
| 224 | ("gtk+" ,gtk+))) | ||
| 225 | (home-page "http://www.gnome.org") | ||
| 226 | (synopsis "Libraries for displaying certificates and accessing key stores") | ||
| 227 | (description | ||
| 228 | "The GCR package contains libraries used for displaying certificates and | ||
| 229 | accessing key stores. It also provides the viewer for crypto files on the | ||
| 230 | GNOME Desktop.") | ||
| 231 | (license license:lgpl2.1+))) | ||
| 232 | |||
| 179 | (define-public libgnome-keyring | 233 | (define-public libgnome-keyring |
| 180 | (package | 234 | (package |
| 181 | (name "libgnome-keyring") | 235 | (name "libgnome-keyring") |
| @@ -207,10 +261,77 @@ and keep up to date translations of documentation.") | |||
| 207 | ;; Though a couple of files are LGPLv2.1+. | 261 | ;; Though a couple of files are LGPLv2.1+. |
| 208 | (license license:lgpl2.0+))) | 262 | (license license:lgpl2.0+))) |
| 209 | 263 | ||
| 264 | (define-public gnome-keyring | ||
| 265 | (package | ||
| 266 | (name "gnome-keyring") | ||
| 267 | (version "3.16.0") | ||
| 268 | (source (origin | ||
| 269 | (method url-fetch) | ||
| 270 | (uri (string-append "mirror://gnome/sources/" name "/" | ||
| 271 | (version-major+minor version) "/" | ||
| 272 | name "-" version ".tar.xz")) | ||
| 273 | (sha256 | ||
| 274 | (base32 | ||
| 275 | "1xg1xha3x3hzlmvdq2zm90hc61pj7pnf9yxxvgq4ynl5af6bp8qm")))) | ||
| 276 | (build-system gnu-build-system) | ||
| 277 | (arguments | ||
| 278 | `(#:tests? #f ;48 of 603 tests fail because /var/lib/dbus/machine-id does | ||
| 279 | ;not exist | ||
| 280 | #:configure-flags | ||
| 281 | (list | ||
| 282 | (string-append "--with-pkcs11-config=" | ||
| 283 | (assoc-ref %outputs "out") "/share/p11-kit/modules/") | ||
| 284 | (string-append "--with-pkcs11-modules=" | ||
| 285 | (assoc-ref %outputs "out") "/share/p11-kit/modules/")) | ||
| 286 | #:phases | ||
| 287 | (modify-phases %standard-phases | ||
| 288 | (add-before | ||
| 289 | 'check 'pre-check | ||
| 290 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 291 | (substitute* "build/tap-driver" | ||
| 292 | (("/usr/bin/env python") (which "python"))))) | ||
| 293 | (add-before | ||
| 294 | 'configure 'fix-docbook | ||
| 295 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 296 | (substitute* "docs/Makefile.am" | ||
| 297 | (("http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl") | ||
| 298 | (string-append (assoc-ref inputs "docbook-xsl") | ||
| 299 | "/xml/xsl/docbook-xsl-" | ||
| 300 | ,(package-version docbook-xsl) | ||
| 301 | "/manpages/docbook.xsl"))) | ||
| 302 | (setenv "XML_CATALOG_FILES" | ||
| 303 | (string-append (assoc-ref inputs "docbook-xml") | ||
| 304 | "/xml/dtd/docbook/catalog.xml"))))))) | ||
| 305 | (inputs | ||
| 306 | `(("libgcrypt" ,libgcrypt) | ||
| 307 | ("dbus" ,dbus) | ||
| 308 | ("gcr" ,gcr))) | ||
| 309 | (native-inputs | ||
| 310 | `(("pkg-config" ,pkg-config) | ||
| 311 | ("glib" ,glib "bin") | ||
| 312 | ("python" ,python-2) ;for tests | ||
| 313 | ("intltool" ,intltool) | ||
| 314 | ("autoconf" ,autoconf) | ||
| 315 | ("automake" ,automake) | ||
| 316 | ("libxslt" ,libxslt) ;for documentation | ||
| 317 | ("docbook-xml" ,docbook-xml-4.2) | ||
| 318 | ("docbook-xsl" ,docbook-xsl))) | ||
| 319 | (home-page "http://www.gnome.org") | ||
| 320 | (synopsis "Daemon to store passwords and encryption keys") | ||
| 321 | (description | ||
| 322 | "gnome-keyring is a program that keeps passwords and other secrets for | ||
| 323 | users. It is run as a daemon in the session, similar to ssh-agent, and other | ||
| 324 | applications locate it via an environment variable or D-Bus. | ||
| 325 | |||
| 326 | The program can manage several keyrings, each with its own master password, | ||
| 327 | and there is also a session keyring which is never stored to disk, but | ||
| 328 | forgotten when the session ends.") | ||
| 329 | (license license:lgpl2.1+))) | ||
| 330 | |||
| 210 | (define-public evince | 331 | (define-public evince |
| 211 | (package | 332 | (package |
| 212 | (name "evince") | 333 | (name "evince") |
| 213 | (version "3.6.1") | 334 | (version "3.16.1") |
| 214 | (source (origin | 335 | (source (origin |
| 215 | (method url-fetch) | 336 | (method url-fetch) |
| 216 | (uri (string-append "mirror://gnome/sources/" name "/" | 337 | (uri (string-append "mirror://gnome/sources/" name "/" |
| @@ -218,7 +339,7 @@ and keep up to date translations of documentation.") | |||
| 218 | name "-" version ".tar.xz")) | 339 | name "-" version ".tar.xz")) |
| 219 | (sha256 | 340 | (sha256 |
| 220 | (base32 | 341 | (base32 |
| 221 | "1da1pij030dh8mb0pr0jnyszgsbjnh8lc17rj5ii52j3kmbv51qv")))) | 342 | "0c31pwfzfm5x036f018q31k33vl8xb96nbs0iiccsc1abc37bzq6")))) |
| 222 | (build-system glib-or-gtk-build-system) | 343 | (build-system glib-or-gtk-build-system) |
| 223 | (arguments | 344 | (arguments |
| 224 | `(#:configure-flags '("--disable-nautilus") | 345 | `(#:configure-flags '("--disable-nautilus") |
| @@ -229,12 +350,18 @@ and keep up to date translations of documentation.") | |||
| 229 | #:tests? #f)) | 350 | #:tests? #f)) |
| 230 | (inputs | 351 | (inputs |
| 231 | `(("libspectre" ,libspectre) | 352 | `(("libspectre" ,libspectre) |
| 232 | ;; ("djvulibre" ,djvulibre) | 353 | ("djvulibre" ,djvulibre) |
| 233 | ("ghostscript" ,ghostscript) | 354 | ("ghostscript" ,ghostscript) |
| 234 | ("poppler" ,poppler) | 355 | ("poppler" ,poppler) |
| 356 | ("libtiff" ,libtiff) | ||
| 357 | ;; TODO: | ||
| 358 | ;; Add libgxps for XPS support. | ||
| 359 | ;; Build libkpathsea as a shared library for DVI support. | ||
| 360 | ;; ("libkpathsea" ,texlive-bin) | ||
| 361 | ("gnome-desktop" ,gnome-desktop) | ||
| 235 | ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) | 362 | ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) |
| 236 | ("libgnome-keyring" ,libgnome-keyring) | 363 | ("libgnome-keyring" ,libgnome-keyring) |
| 237 | ("gnome-icon-theme" ,gnome-icon-theme) | 364 | ("adwaita-icon-theme" ,adwaita-icon-theme) |
| 238 | ("itstool" ,itstool) | 365 | ("itstool" ,itstool) |
| 239 | ("gdk-pixbuf" ,gdk-pixbuf) | 366 | ("gdk-pixbuf" ,gdk-pixbuf) |
| 240 | ("atk" ,atk) | 367 | ("atk" ,atk) |
| @@ -247,7 +374,8 @@ and keep up to date translations of documentation.") | |||
| 247 | ("shared-mime-info" ,shared-mime-info) | 374 | ("shared-mime-info" ,shared-mime-info) |
| 248 | ("dconf" ,dconf) | 375 | ("dconf" ,dconf) |
| 249 | ("libcanberra" ,libcanberra) | 376 | ("libcanberra" ,libcanberra) |
| 250 | 377 | ("libsecret" ,libsecret) | |
| 378 | |||
| 251 | ;; For tests. | 379 | ;; For tests. |
| 252 | ("dogtail" ,python2-dogtail))) | 380 | ("dogtail" ,python2-dogtail))) |
| 253 | (native-inputs | 381 | (native-inputs |
| @@ -365,7 +493,7 @@ update-desktop-database: updates the database containing a cache of MIME types | |||
| 365 | (define-public gnome-icon-theme | 493 | (define-public gnome-icon-theme |
| 366 | (package | 494 | (package |
| 367 | (name "gnome-icon-theme") | 495 | (name "gnome-icon-theme") |
| 368 | (version "3.10.0") | 496 | (version "3.12.0") |
| 369 | (source | 497 | (source |
| 370 | (origin | 498 | (origin |
| 371 | (method url-fetch) | 499 | (method url-fetch) |
| @@ -374,14 +502,13 @@ update-desktop-database: updates the database containing a cache of MIME types | |||
| 374 | name "-" version ".tar.xz")) | 502 | name "-" version ".tar.xz")) |
| 375 | (sha256 | 503 | (sha256 |
| 376 | (base32 | 504 | (base32 |
| 377 | "1xinbgkkvlhazj887ajcl13i7kdc1wcca02jwxzvjrvchjsp4m66")))) | 505 | "0fjh9qmmgj34zlgxb09231ld7khys562qxbpsjlaplq2j85p57im")))) |
| 378 | (build-system gnu-build-system) | 506 | (build-system gnu-build-system) |
| 379 | (inputs | ||
| 380 | `(("gtk+" ,gtk+) | ||
| 381 | ("icon-naming-utils" ,icon-naming-utils))) | ||
| 382 | (native-inputs | 507 | (native-inputs |
| 383 | `(("intltool" ,intltool) | 508 | `(("gtk+" ,gtk+) ; for gtk-update-icon-cache |
| 384 | ("pkg-config" ,pkg-config))) | 509 | ("icon-naming-utils" ,icon-naming-utils) |
| 510 | ("intltool" ,intltool) | ||
| 511 | ("pkg-config" ,pkg-config))) | ||
| 385 | (home-page "http://art.gnome.org/") | 512 | (home-page "http://art.gnome.org/") |
| 386 | (synopsis | 513 | (synopsis |
| 387 | "GNOME icon theme") | 514 | "GNOME icon theme") |
| @@ -389,6 +516,20 @@ update-desktop-database: updates the database containing a cache of MIME types | |||
| 389 | "Icons for the GNOME desktop.") | 516 | "Icons for the GNOME desktop.") |
| 390 | (license license:lgpl3))) ; or Creative Commons BY-SA 3.0 | 517 | (license license:lgpl3))) ; or Creative Commons BY-SA 3.0 |
| 391 | 518 | ||
| 519 | ;; gnome-icon-theme was renamed to adwaita-icon-theme after version 3.12.0. | ||
| 520 | (define-public adwaita-icon-theme | ||
| 521 | (package (inherit gnome-icon-theme) | ||
| 522 | (name "adwaita-icon-theme") | ||
| 523 | (version "3.16.2") | ||
| 524 | (source (origin | ||
| 525 | (method url-fetch) | ||
| 526 | (uri (string-append "mirror://gnome/sources/" name "/" | ||
| 527 | (version-major+minor version) "/" | ||
| 528 | name "-" version ".tar.xz")) | ||
| 529 | (sha256 | ||
| 530 | (base32 | ||
| 531 | "1hmlw7kvhr7c2asc5y77adpymi9ka17gaf76zz835nwwffnn4rlw")))))) | ||
| 532 | |||
| 392 | (define-public shared-mime-info | 533 | (define-public shared-mime-info |
| 393 | (package | 534 | (package |
| 394 | (name "shared-mime-info") | 535 | (name "shared-mime-info") |
| @@ -629,7 +770,7 @@ dealing with different structured file formats.") | |||
| 629 | (define-public librsvg | 770 | (define-public librsvg |
| 630 | (package | 771 | (package |
| 631 | (name "librsvg") | 772 | (name "librsvg") |
| 632 | (version "2.40.6") | 773 | (version "2.40.9") |
| 633 | (source (origin | 774 | (source (origin |
| 634 | (method url-fetch) | 775 | (method url-fetch) |
| 635 | (uri (string-append "mirror://gnome/sources/" name "/" | 776 | (uri (string-append "mirror://gnome/sources/" name "/" |
| @@ -637,7 +778,7 @@ dealing with different structured file formats.") | |||
| 637 | name "-" version ".tar.xz")) | 778 | name "-" version ".tar.xz")) |
| 638 | (sha256 | 779 | (sha256 |
| 639 | (base32 | 780 | (base32 |
| 640 | "01jgb11779080b80k2ncrhdphgillqrrnszal6vh8yv787r4kwwa")))) | 781 | "0fplymmqqr28y24vcnb01szn62pfbqhk8p1ngns54x9m6mflr5hk")))) |
| 641 | (build-system gnu-build-system) | 782 | (build-system gnu-build-system) |
| 642 | (arguments | 783 | (arguments |
| 643 | `(#:phases | 784 | `(#:phases |
| @@ -657,15 +798,15 @@ dealing with different structured file formats.") | |||
| 657 | (alist-cons-after | 798 | (alist-cons-after |
| 658 | 'install 'generate-full-cache | 799 | 'install 'generate-full-cache |
| 659 | (lambda* (#:key inputs outputs #:allow-other-keys) | 800 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 660 | (let ((loaders-directory | 801 | (let ((loaders-directory |
| 661 | (string-append (assoc-ref outputs "out") | 802 | (string-append (assoc-ref outputs "out") |
| 662 | "/lib/gdk-pixbuf-2.0/2.10.0/loaders"))) | 803 | "/lib/gdk-pixbuf-2.0/2.10.0/loaders"))) |
| 663 | (zero? | 804 | (zero? |
| 664 | (system | 805 | (system |
| 665 | (string-append | 806 | (string-append |
| 666 | "gdk-pixbuf-query-loaders " | 807 | "gdk-pixbuf-query-loaders " |
| 667 | loaders-directory "/libpixbufloader-svg.so " | 808 | loaders-directory "/libpixbufloader-svg.so " |
| 668 | (string-join (find-files (assoc-ref inputs "gdk-pixbuf") | 809 | (string-join (find-files (assoc-ref inputs "gdk-pixbuf") |
| 669 | "libpixbufloader-.*\\.so") " ") | 810 | "libpixbufloader-.*\\.so") " ") |
| 670 | "> " loaders-directory ".cache"))))) | 811 | "> " loaders-directory ".cache"))))) |
| 671 | %standard-phases)))) | 812 | %standard-phases)))) |
| @@ -716,7 +857,7 @@ library.") | |||
| 716 | Definition Language (idl) files, which is a specification for defining | 857 | Definition Language (idl) files, which is a specification for defining |
| 717 | portable interfaces. libidl was initially written for orbit (the orb from the | 858 | portable interfaces. libidl was initially written for orbit (the orb from the |
| 718 | GNOME project, and the primary means of libidl distribution). However, the | 859 | GNOME project, and the primary means of libidl distribution). However, the |
| 719 | functionality was designed to be as reusable and portable as possible.") | 860 | functionality was designed to be as reusable and portable as possible.") |
| 720 | (license license:lgpl2.0+))) | 861 | (license license:lgpl2.0+))) |
| 721 | 862 | ||
| 722 | 863 | ||
| @@ -726,7 +867,7 @@ functionality was designed to be as reusable and portable as possible.") | |||
| 726 | (version "2.14.19") | 867 | (version "2.14.19") |
| 727 | (source (origin | 868 | (source (origin |
| 728 | (method url-fetch) | 869 | (method url-fetch) |
| 729 | (uri (let ((upstream-name "ORBit2")) | 870 | (uri (let ((upstream-name "ORBit2")) |
| 730 | (string-append "mirror://gnome/sources/" upstream-name "/" | 871 | (string-append "mirror://gnome/sources/" upstream-name "/" |
| 731 | (version-major+minor version) "/" | 872 | (version-major+minor version) "/" |
| 732 | upstream-name "-" version ".tar.bz2"))) | 873 | upstream-name "-" version ".tar.bz2"))) |
| @@ -751,11 +892,11 @@ functionality was designed to be as reusable and portable as possible.") | |||
| 751 | (home-page "https://projects.gnome.org/orbit2/") | 892 | (home-page "https://projects.gnome.org/orbit2/") |
| 752 | (synopsis "CORBA 2.4-compliant Object Request Broker") | 893 | (synopsis "CORBA 2.4-compliant Object Request Broker") |
| 753 | (description "ORBit2 is a CORBA 2.4-compliant Object Request Broker (orb) | 894 | (description "ORBit2 is a CORBA 2.4-compliant Object Request Broker (orb) |
| 754 | featuring mature C, C++ and Python bindings.") | 895 | featuring mature C, C++ and Python bindings.") |
| 755 | ;; Licence notice is unclear. The Web page simply say "GPL" without giving a version. | 896 | ;; Licence notice is unclear. The Web page simply say "GPL" without giving a version. |
| 756 | ;; SOME of the code files have licence notices for GPLv2+ | 897 | ;; SOME of the code files have licence notices for GPLv2+ |
| 757 | ;; The tarball contains files of the text of GPLv2 and LGPLv2 | 898 | ;; The tarball contains files of the text of GPLv2 and LGPLv2 |
| 758 | (license license:gpl2+))) | 899 | (license license:gpl2+))) |
| 759 | 900 | ||
| 760 | 901 | ||
| 761 | (define-public libbonobo | 902 | (define-public libbonobo |
| @@ -798,7 +939,7 @@ featuring mature C, C++ and Python bindings.") | |||
| 798 | (home-page "https://developer.gnome.org/libbonobo/") | 939 | (home-page "https://developer.gnome.org/libbonobo/") |
| 799 | (synopsis "Framework for creating reusable components for use in GNOME applications") | 940 | (synopsis "Framework for creating reusable components for use in GNOME applications") |
| 800 | (description "Bonobo is a framework for creating reusable components for | 941 | (description "Bonobo is a framework for creating reusable components for |
| 801 | use in GNOME applications, built on top of CORBA.") | 942 | use in GNOME applications, built on top of CORBA.") |
| 802 | ;; Licence not explicitly stated. Source files contain no licence notices. | 943 | ;; Licence not explicitly stated. Source files contain no licence notices. |
| 803 | ;; Tarball contains text of both GPLv2 and LGPLv2 | 944 | ;; Tarball contains text of both GPLv2 and LGPLv2 |
| 804 | ;; GPLv2 covers both conditions | 945 | ;; GPLv2 covers both conditions |
| @@ -811,7 +952,7 @@ use in GNOME applications, built on top of CORBA.") | |||
| 811 | (version "3.2.6") | 952 | (version "3.2.6") |
| 812 | (source (origin | 953 | (source (origin |
| 813 | (method url-fetch) | 954 | (method url-fetch) |
| 814 | (uri | 955 | (uri |
| 815 | (let ((upstream-name "GConf")) | 956 | (let ((upstream-name "GConf")) |
| 816 | (string-append "mirror://gnome/sources/" upstream-name "/" | 957 | (string-append "mirror://gnome/sources/" upstream-name "/" |
| 817 | (version-major+minor version) "/" | 958 | (version-major+minor version) "/" |
| @@ -819,11 +960,10 @@ use in GNOME applications, built on top of CORBA.") | |||
| 819 | (sha256 | 960 | (sha256 |
| 820 | (base32 "0k3q9nh53yhc9qxf1zaicz4sk8p3kzq4ndjdsgpaa2db0ccbj4hr")))) | 961 | (base32 "0k3q9nh53yhc9qxf1zaicz4sk8p3kzq4ndjdsgpaa2db0ccbj4hr")))) |
| 821 | (build-system gnu-build-system) | 962 | (build-system gnu-build-system) |
| 822 | (inputs `(("glib" ,glib) | 963 | (inputs `(("dbus-glib" ,dbus-glib) |
| 823 | ("dbus" ,dbus) | ||
| 824 | ("dbus-glib" ,dbus-glib) | ||
| 825 | ("libxml2" ,libxml2))) | 964 | ("libxml2" ,libxml2))) |
| 826 | (propagated-inputs `(("orbit2" ,orbit2))) ; referred to in the .pc file | 965 | (propagated-inputs `(("glib" ,glib) ; referred to in the .pc file |
| 966 | ("orbit2" ,orbit2))) | ||
| 827 | (native-inputs | 967 | (native-inputs |
| 828 | `(("intltool" ,intltool) | 968 | `(("intltool" ,intltool) |
| 829 | ("glib" ,glib "bin") ; for glib-genmarshal, etc. | 969 | ("glib" ,glib "bin") ; for glib-genmarshal, etc. |
| @@ -832,7 +972,7 @@ use in GNOME applications, built on top of CORBA.") | |||
| 832 | (synopsis "Store application preferences") | 972 | (synopsis "Store application preferences") |
| 833 | (description "Gconf is a system for storing application preferences. It | 973 | (description "Gconf is a system for storing application preferences. It |
| 834 | is intended for user preferences; not arbitrary data storage.") | 974 | is intended for user preferences; not arbitrary data storage.") |
| 835 | (license license:lgpl2.0+))) | 975 | (license license:lgpl2.0+))) |
| 836 | 976 | ||
| 837 | 977 | ||
| 838 | (define-public gnome-mime-data | 978 | (define-public gnome-mime-data |
| @@ -887,10 +1027,8 @@ designed to be accessed through the MIME functions in GnomeVFS.") | |||
| 887 | (substitute* "test/test-async-cancel.c" | 1027 | (substitute* "test/test-async-cancel.c" |
| 888 | (("EXIT_FAILURE") "77"))) | 1028 | (("EXIT_FAILURE") "77"))) |
| 889 | %standard-phases)))) | 1029 | %standard-phases)))) |
| 890 | (inputs `(("glib" ,glib) | 1030 | (inputs `(("libxml2" ,libxml2) |
| 891 | ("libxml2" ,libxml2) | ||
| 892 | ("dbus-glib" ,dbus-glib) | 1031 | ("dbus-glib" ,dbus-glib) |
| 893 | ("dbus" ,dbus) | ||
| 894 | ("gconf" ,gconf) | 1032 | ("gconf" ,gconf) |
| 895 | ("gnome-mime-data" ,gnome-mime-data) | 1033 | ("gnome-mime-data" ,gnome-mime-data) |
| 896 | ("zlib" ,zlib))) | 1034 | ("zlib" ,zlib))) |
| @@ -925,7 +1063,7 @@ to access local and remote files with a single consistent API.") | |||
| 925 | `(#:phases | 1063 | `(#:phases |
| 926 | (alist-cons-before | 1064 | (alist-cons-before |
| 927 | 'configure 'enable-deprecated | 1065 | 'configure 'enable-deprecated |
| 928 | (lambda _ | 1066 | (lambda _ |
| 929 | (substitute* "libgnome/Makefile.in" | 1067 | (substitute* "libgnome/Makefile.in" |
| 930 | (("-DG_DISABLE_DEPRECATED") "-DGLIB_DISABLE_DEPRECATION_WARNINGS"))) | 1068 | (("-DG_DISABLE_DEPRECATED") "-DGLIB_DISABLE_DEPRECATION_WARNINGS"))) |
| 931 | %standard-phases))) | 1069 | %standard-phases))) |
| @@ -943,8 +1081,7 @@ to access local and remote files with a single consistent API.") | |||
| 943 | `(("libcanberra" ,libcanberra) | 1081 | `(("libcanberra" ,libcanberra) |
| 944 | ("libbonobo" ,libbonobo) | 1082 | ("libbonobo" ,libbonobo) |
| 945 | ("gconf" ,gconf) | 1083 | ("gconf" ,gconf) |
| 946 | ("gnome-vfs" ,gnome-vfs) | 1084 | ("gnome-vfs" ,gnome-vfs))) |
| 947 | ("glib" ,glib))) | ||
| 948 | (home-page "https://developer.gnome.org/libgnome/") | 1085 | (home-page "https://developer.gnome.org/libgnome/") |
| 949 | (synopsis "Useful routines for building applications") | 1086 | (synopsis "Useful routines for building applications") |
| 950 | (description "The libgnome library provides a number of useful routines | 1087 | (description "The libgnome library provides a number of useful routines |
| @@ -971,7 +1108,7 @@ files and URIs, and displaying help.") | |||
| 971 | `(("pkg-config" ,pkg-config))) | 1108 | `(("pkg-config" ,pkg-config))) |
| 972 | (home-page "https://people.gnome.org/~mathieu/libart") | 1109 | (home-page "https://people.gnome.org/~mathieu/libart") |
| 973 | (synopsis "2D drawing library") | 1110 | (synopsis "2D drawing library") |
| 974 | (description "Libart is a 2D drawing library intended as a | 1111 | (description "Libart is a 2D drawing library intended as a |
| 975 | high-quality vector-based 2D library with antialiasing and alpha composition.") | 1112 | high-quality vector-based 2D library with antialiasing and alpha composition.") |
| 976 | (license license:lgpl2.0+))) | 1113 | (license license:lgpl2.0+))) |
| 977 | 1114 | ||
| @@ -1143,7 +1280,7 @@ since ca. 2006, when GTK+ itself incorporated printing support.") | |||
| 1143 | ("glib" ,glib) | 1280 | ("glib" ,glib) |
| 1144 | ("gnome-icon-theme" ,gnome-icon-theme) | 1281 | ("gnome-icon-theme" ,gnome-icon-theme) |
| 1145 | ("libgnomecanvas" ,libgnomecanvas) | 1282 | ("libgnomecanvas" ,libgnomecanvas) |
| 1146 | ("libxml2" ,libxml2))) | 1283 | ("libxml2" ,libxml2))) |
| 1147 | (native-inputs | 1284 | (native-inputs |
| 1148 | `(("intltool" ,intltool) | 1285 | `(("intltool" ,intltool) |
| 1149 | ("pkg-config" ,pkg-config))) | 1286 | ("pkg-config" ,pkg-config))) |
| @@ -1172,7 +1309,7 @@ since ca. 2006, when GTK+ itself incorporated printing support.") | |||
| 1172 | (lambda* (#:key inputs #:allow-other-keys) | 1309 | (lambda* (#:key inputs #:allow-other-keys) |
| 1173 | (let ((xorg-server (assoc-ref inputs "xorg-server")) | 1310 | (let ((xorg-server (assoc-ref inputs "xorg-server")) |
| 1174 | (disp ":1")) | 1311 | (disp ":1")) |
| 1175 | 1312 | ||
| 1176 | (setenv "HOME" (getcwd)) | 1313 | (setenv "HOME" (getcwd)) |
| 1177 | (setenv "DISPLAY" disp) | 1314 | (setenv "DISPLAY" disp) |
| 1178 | ;; There must be a running X server and make check doesn't start one. | 1315 | ;; There must be a running X server and make check doesn't start one. |
| @@ -1269,11 +1406,38 @@ Hints specification (EWMH).") | |||
| 1269 | (home-page "https://developer.gnome.org/goffice/") | 1406 | (home-page "https://developer.gnome.org/goffice/") |
| 1270 | (synopsis "Document-centric objects and utilities") | 1407 | (synopsis "Document-centric objects and utilities") |
| 1271 | (description "A GLib/GTK+ set of document-centric objects and utilities.") | 1408 | (description "A GLib/GTK+ set of document-centric objects and utilities.") |
| 1272 | (license | 1409 | (license |
| 1273 | ;; Dual licensed under GPLv2 or GPLv3 (both without "or later") | 1410 | ;; Dual licensed under GPLv2 or GPLv3 (both without "or later") |
| 1274 | ;; Note: NOT LGPL | 1411 | ;; Note: NOT LGPL |
| 1275 | (list license:gpl2 license:gpl3)))) | 1412 | (list license:gpl2 license:gpl3)))) |
| 1276 | 1413 | ||
| 1414 | (define-public goffice-0.8 | ||
| 1415 | (package (inherit goffice) | ||
| 1416 | (version "0.8.17") | ||
| 1417 | (source (origin | ||
| 1418 | (method url-fetch) | ||
| 1419 | (uri (string-append "mirror://gnome/sources/" (package-name goffice) "/" | ||
| 1420 | (version-major+minor version) "/" | ||
| 1421 | (package-name goffice) "-" version ".tar.xz")) | ||
| 1422 | (sha256 | ||
| 1423 | (base32 "05fvzbs5bin05bbsr4dp79aiva3lnq0a3a40zq55i13vnsz70l0n")))) | ||
| 1424 | (arguments | ||
| 1425 | `(#:phases | ||
| 1426 | (alist-cons-after | ||
| 1427 | 'unpack 'fix-pcre-check | ||
| 1428 | (lambda _ | ||
| 1429 | ;; Only glib.h can be included directly. See | ||
| 1430 | ;; https://bugzilla.gnome.org/show_bug.cgi?id=670316 | ||
| 1431 | (substitute* "configure" | ||
| 1432 | (("glib/gregex\\.h") "glib.h")) #t) | ||
| 1433 | %standard-phases))) | ||
| 1434 | (propagated-inputs | ||
| 1435 | ;; libgoffice-0.8.pc mentions libgsf-1 | ||
| 1436 | `(("libgsf" ,libgsf))) | ||
| 1437 | (inputs | ||
| 1438 | `(("gtk" ,gtk+-2) | ||
| 1439 | ,@(alist-delete "gtk" (package-inputs goffice)))))) | ||
| 1440 | |||
| 1277 | (define-public gnumeric | 1441 | (define-public gnumeric |
| 1278 | (package | 1442 | (package |
| 1279 | (name "gnumeric") | 1443 | (name "gnumeric") |
| @@ -1290,7 +1454,7 @@ Hints specification (EWMH).") | |||
| 1290 | (arguments | 1454 | (arguments |
| 1291 | `(;; The gnumeric developers don't worry much about failing tests. | 1455 | `(;; The gnumeric developers don't worry much about failing tests. |
| 1292 | ;; See https://bugzilla.gnome.org/show_bug.cgi?id=732387 | 1456 | ;; See https://bugzilla.gnome.org/show_bug.cgi?id=732387 |
| 1293 | #:tests? #f | 1457 | #:tests? #f |
| 1294 | #:phases | 1458 | #:phases |
| 1295 | (alist-cons-before | 1459 | (alist-cons-before |
| 1296 | 'configure 'pre-conf | 1460 | 'configure 'pre-conf |
| @@ -1299,9 +1463,9 @@ Hints specification (EWMH).") | |||
| 1299 | ;; I am informed that this only affects the possibility to embed a | 1463 | ;; I am informed that this only affects the possibility to embed a |
| 1300 | ;; spreadsheet inside an Abiword document. So presumably when we | 1464 | ;; spreadsheet inside an Abiword document. So presumably when we |
| 1301 | ;; package Abiword we'll have to refer it to this directory. | 1465 | ;; package Abiword we'll have to refer it to this directory. |
| 1302 | (substitute* "configure" | 1466 | (substitute* "configure" |
| 1303 | (("^GOFFICE_PLUGINS_DIR=.*") | 1467 | (("^GOFFICE_PLUGINS_DIR=.*") |
| 1304 | (string-append "GOFFICE_PLUGINS_DIR=" | 1468 | (string-append "GOFFICE_PLUGINS_DIR=" |
| 1305 | (assoc-ref outputs "out") "/goffice/plugins")))) | 1469 | (assoc-ref outputs "out") "/goffice/plugins")))) |
| 1306 | %standard-phases))) | 1470 | %standard-phases))) |
| 1307 | (inputs | 1471 | (inputs |
| @@ -1336,7 +1500,7 @@ engineering.") | |||
| 1336 | (source | 1500 | (source |
| 1337 | (origin | 1501 | (origin |
| 1338 | (method url-fetch) | 1502 | (method url-fetch) |
| 1339 | (uri (string-append "mirror://gnome/sources/" name "/" | 1503 | (uri (string-append "mirror://gnome/sources/" name "/" |
| 1340 | (version-major+minor version) "/" name "-" | 1504 | (version-major+minor version) "/" name "-" |
| 1341 | version ".tar.xz")) | 1505 | version ".tar.xz")) |
| 1342 | (sha256 | 1506 | (sha256 |
| @@ -1361,8 +1525,8 @@ engineering.") | |||
| 1361 | ;; gdk-pixbuf because the latter does not include support for SVG | 1525 | ;; gdk-pixbuf because the latter does not include support for SVG |
| 1362 | ;; files. | 1526 | ;; files. |
| 1363 | (lambda* (#:key inputs #:allow-other-keys) | 1527 | (lambda* (#:key inputs #:allow-other-keys) |
| 1364 | (setenv "GDK_PIXBUF_MODULE_FILE" | 1528 | (setenv "GDK_PIXBUF_MODULE_FILE" |
| 1365 | (car (find-files (assoc-ref inputs "librsvg") | 1529 | (car (find-files (assoc-ref inputs "librsvg") |
| 1366 | "loaders\\.cache")))) | 1530 | "loaders\\.cache")))) |
| 1367 | %standard-phases))) | 1531 | %standard-phases))) |
| 1368 | (home-page "https://launchpad.net/gnome-themes-standard") | 1532 | (home-page "https://launchpad.net/gnome-themes-standard") |
| @@ -1371,6 +1535,39 @@ engineering.") | |||
| 1371 | "The default GNOME 3 themes (Adwaita and some accessibility themes).") | 1535 | "The default GNOME 3 themes (Adwaita and some accessibility themes).") |
| 1372 | (license license:lgpl2.1+))) | 1536 | (license license:lgpl2.1+))) |
| 1373 | 1537 | ||
| 1538 | (define-public seahorse | ||
| 1539 | (package | ||
| 1540 | (name "seahorse") | ||
| 1541 | (version "3.16.0") | ||
| 1542 | (source | ||
| 1543 | (origin | ||
| 1544 | (method url-fetch) | ||
| 1545 | (uri (string-append "mirror://gnome/sources/" name "/" | ||
| 1546 | (version-major+minor version) "/" name "-" | ||
| 1547 | version ".tar.xz")) | ||
| 1548 | (sha256 | ||
| 1549 | (base32 | ||
| 1550 | "0cg1grgpwbfkiny5148n17rzpc8kswyr5yff0kpm8l3lp01my2kp")))) | ||
| 1551 | (build-system glib-or-gtk-build-system) | ||
| 1552 | (inputs | ||
| 1553 | `(("gtk+" ,gtk+) | ||
| 1554 | ("gcr" ,gcr) | ||
| 1555 | ("gnupg" ,gnupg-1) | ||
| 1556 | ("gpgme" ,gpgme) | ||
| 1557 | ("openssh" ,openssh) | ||
| 1558 | ("libsecret" ,libsecret))) | ||
| 1559 | (native-inputs | ||
| 1560 | `(("intltool" ,intltool) | ||
| 1561 | ("glib:bin" ,glib "bin") | ||
| 1562 | ("itstool" ,itstool) | ||
| 1563 | ("pkg-config" ,pkg-config))) | ||
| 1564 | (home-page "https://launchpad.net/gnome-themes-standard") | ||
| 1565 | (synopsis "Manage encryption keys and passwords in the GNOME keyring") | ||
| 1566 | (description | ||
| 1567 | "Seahorse is a GNOME application for managing encryption keys and | ||
| 1568 | passwords in the GNOME keyring.") | ||
| 1569 | (license license:gpl2+))) | ||
| 1570 | |||
| 1374 | (define-public vala | 1571 | (define-public vala |
| 1375 | (package | 1572 | (package |
| 1376 | (name "vala") | 1573 | (name "vala") |
| @@ -1471,7 +1668,7 @@ editors, IDEs, etc.") | |||
| 1471 | (source (origin | 1668 | (source (origin |
| 1472 | (method url-fetch) | 1669 | (method url-fetch) |
| 1473 | (uri (string-append | 1670 | (uri (string-append |
| 1474 | "mirror://gnome/sources/" name "/" | 1671 | "mirror://gnome/sources/" name "/" |
| 1475 | (version-major+minor version) "/" | 1672 | (version-major+minor version) "/" |
| 1476 | name "-" version ".tar.xz")) | 1673 | name "-" version ".tar.xz")) |
| 1477 | (sha256 | 1674 | (sha256 |
| @@ -1493,7 +1690,7 @@ editors, IDEs, etc.") | |||
| 1493 | ; or /etc/machine-id. | 1690 | ; or /etc/machine-id. |
| 1494 | #:configure-flags | 1691 | #:configure-flags |
| 1495 | ;; Set the correct RUNPATH in binaries. | 1692 | ;; Set the correct RUNPATH in binaries. |
| 1496 | (list (string-append "LDFLAGS=-Wl,-rpath=" | 1693 | (list (string-append "LDFLAGS=-Wl,-rpath=" |
| 1497 | (assoc-ref %outputs "out") "/lib") | 1694 | (assoc-ref %outputs "out") "/lib") |
| 1498 | "--disable-gtk-doc-html") ; FIXME: requires gtk-doc | 1695 | "--disable-gtk-doc-html") ; FIXME: requires gtk-doc |
| 1499 | #:phases | 1696 | #:phases |
| @@ -1502,12 +1699,12 @@ editors, IDEs, etc.") | |||
| 1502 | (lambda* (#:key inputs #:allow-other-keys) | 1699 | (lambda* (#:key inputs #:allow-other-keys) |
| 1503 | (substitute* "docs/Makefile.in" | 1700 | (substitute* "docs/Makefile.in" |
| 1504 | (("http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl") | 1701 | (("http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl") |
| 1505 | (string-append (assoc-ref inputs "docbook-xsl") | 1702 | (string-append (assoc-ref inputs "docbook-xsl") |
| 1506 | "/xml/xsl/docbook-xsl-" | 1703 | "/xml/xsl/docbook-xsl-" |
| 1507 | ,(package-version docbook-xsl) | 1704 | ,(package-version docbook-xsl) |
| 1508 | "/manpages/docbook.xsl"))) | 1705 | "/manpages/docbook.xsl"))) |
| 1509 | (setenv "XML_CATALOG_FILES" | 1706 | (setenv "XML_CATALOG_FILES" |
| 1510 | (string-append (assoc-ref inputs "docbook-xml") | 1707 | (string-append (assoc-ref inputs "docbook-xml") |
| 1511 | "/xml/dtd/docbook/catalog.xml"))) | 1708 | "/xml/dtd/docbook/catalog.xml"))) |
| 1512 | %standard-phases))) | 1709 | %standard-phases))) |
| 1513 | (home-page "https://developer.gnome.org/dconf") | 1710 | (home-page "https://developer.gnome.org/dconf") |
| @@ -1906,7 +2103,6 @@ keyboard shortcuts.") | |||
| 1906 | ("intltool" ,intltool))) | 2103 | ("intltool" ,intltool))) |
| 1907 | (inputs | 2104 | (inputs |
| 1908 | `(("eudev" ,eudev) | 2105 | `(("eudev" ,eudev) |
| 1909 | ("dbus" ,dbus) | ||
| 1910 | ("dbus-glib" ,dbus-glib) | 2106 | ("dbus-glib" ,dbus-glib) |
| 1911 | ("libusb" ,libusb) | 2107 | ("libusb" ,libusb) |
| 1912 | ("lcms" ,lcms) | 2108 | ("lcms" ,lcms) |
| @@ -1923,7 +2119,7 @@ output devices.") | |||
| 1923 | (define-public geoclue | 2119 | (define-public geoclue |
| 1924 | (package | 2120 | (package |
| 1925 | (name "geoclue") | 2121 | (name "geoclue") |
| 1926 | (version "2.1.10") | 2122 | (version "2.2.0") |
| 1927 | (source | 2123 | (source |
| 1928 | (origin | 2124 | (origin |
| 1929 | (method url-fetch) | 2125 | (method url-fetch) |
| @@ -1932,7 +2128,7 @@ output devices.") | |||
| 1932 | name "-" version ".tar.xz")) | 2128 | name "-" version ".tar.xz")) |
| 1933 | (sha256 | 2129 | (sha256 |
| 1934 | (base32 | 2130 | (base32 |
| 1935 | "0s0ws2bx5g1cbjamxmm448r4n4crha2fwpzm8zbx6cq6qslygmzi")) | 2131 | "0inlqx0zar498fhi9hh92p2g4kp8qy3zdl4z3vw6bjwp9w6xx454")) |
| 1936 | (patches (list (search-patch "geoclue-config.patch"))))) | 2132 | (patches (list (search-patch "geoclue-config.patch"))))) |
| 1937 | (build-system glib-or-gtk-build-system) | 2133 | (build-system glib-or-gtk-build-system) |
| 1938 | (arguments | 2134 | (arguments |
| @@ -2040,7 +2236,6 @@ faster results and to avoid unnecessary server load.") | |||
| 2040 | ("python" ,python))) | 2236 | ("python" ,python))) |
| 2041 | (inputs | 2237 | (inputs |
| 2042 | `(("eudev" ,eudev) | 2238 | `(("eudev" ,eudev) |
| 2043 | ("dbus" ,dbus) | ||
| 2044 | ("dbus-glib" ,dbus-glib) | 2239 | ("dbus-glib" ,dbus-glib) |
| 2045 | ("libusb" ,libusb))) | 2240 | ("libusb" ,libusb))) |
| 2046 | (home-page "http://upower.freedesktop.org/") | 2241 | (home-page "http://upower.freedesktop.org/") |
| @@ -2153,3 +2348,99 @@ parameters of a GNOME session and the applications that run under it. It | |||
| 2153 | handles settings such keyboard layout, shortcuts, and accessibility, clipboard | 2348 | handles settings such keyboard layout, shortcuts, and accessibility, clipboard |
| 2154 | settings, themes, mouse settings, and startup of other daemons.") | 2349 | settings, themes, mouse settings, and startup of other daemons.") |
| 2155 | (license license:gpl2+))) | 2350 | (license license:gpl2+))) |
| 2351 | |||
| 2352 | (define-public totem-pl-parser | ||
| 2353 | (package | ||
| 2354 | (name "totem-pl-parser") | ||
| 2355 | (version "3.10.5") | ||
| 2356 | (source (origin | ||
| 2357 | (method url-fetch) | ||
| 2358 | (uri (string-append "mirror://gnome/sources/totem-pl-parser/3.10/" | ||
| 2359 | "totem-pl-parser-" version ".tar.xz")) | ||
| 2360 | (sha256 | ||
| 2361 | (base32 | ||
| 2362 | "0dw1kiwmjwdjrighri0j9nagsnj44dllm0mamnfh4y5nc47mhim7")))) | ||
| 2363 | (build-system gnu-build-system) | ||
| 2364 | (arguments | ||
| 2365 | ;; FIXME: Tests require gvfs. | ||
| 2366 | `(#:tests? #f)) | ||
| 2367 | (native-inputs | ||
| 2368 | `(("intltool" ,intltool) | ||
| 2369 | ("glib" ,glib "bin") | ||
| 2370 | ("pkg-config" ,pkg-config))) | ||
| 2371 | (inputs | ||
| 2372 | `(("glib" ,glib) | ||
| 2373 | ("gmime" ,gmime) | ||
| 2374 | ("libarchive" ,libarchive) | ||
| 2375 | ("libgcrypt" ,libgcrypt) | ||
| 2376 | ("nettle" ,nettle) | ||
| 2377 | ("libsoup" ,libsoup) | ||
| 2378 | ("libxml2" ,libxml2))) | ||
| 2379 | (home-page "https://projects.gnome.org/totem") | ||
| 2380 | (synopsis "Library to parse and save media playlists for GNOME") | ||
| 2381 | (description "Totem-pl-parser is a GObjects-based library to parse and save | ||
| 2382 | playlists in a variety of formats.") | ||
| 2383 | (license license:lgpl2.0+))) | ||
| 2384 | |||
| 2385 | (define-public aisleriot | ||
| 2386 | (package | ||
| 2387 | (name "aisleriot") | ||
| 2388 | (version "3.16.1") | ||
| 2389 | (source (origin | ||
| 2390 | (method url-fetch) | ||
| 2391 | (uri (string-append "mirror://gnome/sources/" name "/" | ||
| 2392 | (version-major+minor version) "/" | ||
| 2393 | name "-" version ".tar.xz")) | ||
| 2394 | (sha256 | ||
| 2395 | (base32 | ||
| 2396 | "19k483x9dkq8vjbq8f333pk9qil64clpsfg20q8xk9bgmk38aj8h")))) | ||
| 2397 | (build-system glib-or-gtk-build-system) | ||
| 2398 | (arguments | ||
| 2399 | '(#:configure-flags | ||
| 2400 | '("--with-platform=gtk-only" | ||
| 2401 | "--with-card-theme-formats=svg"))) | ||
| 2402 | (native-inputs | ||
| 2403 | `(("desktop-file-utils" ,desktop-file-utils) | ||
| 2404 | ("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc. | ||
| 2405 | ("intltool" ,intltool) | ||
| 2406 | ("itstool" ,itstool) | ||
| 2407 | ("pkg-config" ,pkg-config) | ||
| 2408 | ("xmllint" ,libxml2))) | ||
| 2409 | (inputs | ||
| 2410 | `(("gtk+" ,gtk+) | ||
| 2411 | ("guile" ,guile-2.0) | ||
| 2412 | ("libcanberra" ,libcanberra) | ||
| 2413 | ("librsvg" ,librsvg))) | ||
| 2414 | (home-page "https://wiki.gnome.org/Apps/Aisleriot") | ||
| 2415 | (synopsis "Solitaire card games") | ||
| 2416 | (description | ||
| 2417 | "Aisleriot (also known as Solitaire or sol) is a collection of card games | ||
| 2418 | which are easy to play with the aid of a mouse.") | ||
| 2419 | (license license:gpl3+))) | ||
| 2420 | |||
| 2421 | (define-public devhelp | ||
| 2422 | (package | ||
| 2423 | (name "devhelp") | ||
| 2424 | (version "3.16.1") | ||
| 2425 | (source (origin | ||
| 2426 | (method url-fetch) | ||
| 2427 | (uri (string-append "mirror://gnome/sources/" name "/" | ||
| 2428 | (version-major+minor version) "/" | ||
| 2429 | name "-" version ".tar.xz")) | ||
| 2430 | (sha256 | ||
| 2431 | (base32 | ||
| 2432 | "0i8kyh86hzwxs8dm047ivghl2b92vigdxa3x4pk4ha0whpk38g37")))) | ||
| 2433 | (build-system glib-or-gtk-build-system) | ||
| 2434 | (native-inputs | ||
| 2435 | `(("intltool" ,intltool) | ||
| 2436 | ("pkg-config" ,pkg-config))) | ||
| 2437 | (inputs | ||
| 2438 | `(("gsettings-desktop-schemas" ,gsettings-desktop-schemas) | ||
| 2439 | ("webkitgtk" ,webkitgtk))) | ||
| 2440 | (home-page "https://wiki.gnome.org/Apps/Devhelp") | ||
| 2441 | (synopsis "API documentation browser for GNOME") | ||
| 2442 | (description | ||
| 2443 | "Devhelp is an API documentation browser for GTK+ and GNOME. It works | ||
| 2444 | natively with GTK-Doc (the API reference system developed for GTK+ and used | ||
| 2445 | throughout GNOME for API documentation).") | ||
| 2446 | (license license:gpl2+))) | ||
diff --git a/gnu/packages/gnu-pw-mgr.scm b/gnu/packages/gnu-pw-mgr.scm index e0f223d7d66..7a9b0b98101 100644 --- a/gnu/packages/gnu-pw-mgr.scm +++ b/gnu/packages/gnu-pw-mgr.scm | |||
| @@ -23,22 +23,25 @@ | |||
| 23 | #:use-module (guix download) | 23 | #:use-module (guix download) |
| 24 | #:use-module (guix build-system gnu) | 24 | #:use-module (guix build-system gnu) |
| 25 | #:use-module (gnu packages) | 25 | #:use-module (gnu packages) |
| 26 | #:use-module (gnu packages base)) | 26 | #:use-module (gnu packages base) |
| 27 | #:use-module (gnu packages autogen)) | ||
| 27 | 28 | ||
| 28 | (define-public gnu-pw-mgr | 29 | (define-public gnu-pw-mgr |
| 29 | (package | 30 | (package |
| 30 | (name "gnu-pw-mgr") | 31 | (name "gnu-pw-mgr") |
| 31 | (version "1.3") | 32 | (version "1.4") |
| 32 | (source | 33 | (source |
| 33 | (origin | 34 | (origin |
| 34 | (method url-fetch) | 35 | (method url-fetch) |
| 35 | (uri (string-append "mirror://gnu/gnu-pw-mgr/gnu-pw-mgr-" | 36 | (uri (string-append "mirror://gnu/gnu-pw-mgr/gnu-pw-mgr-" |
| 36 | version ".tar.gz")) | 37 | version ".tar.xz")) |
| 37 | (sha256 | 38 | (sha256 |
| 38 | (base32 | 39 | (base32 |
| 39 | "0rbnv5wszpr35py97vwylqkdlf06qpd2x9j9aqlmgkd4mr1n4hf0")))) | 40 | "0a352y1m33vp6zmdbn96fdrq9gr9lchc9vcrj14mfx7g0dsvxjns")))) |
| 40 | (build-system gnu-build-system) | 41 | (build-system gnu-build-system) |
| 41 | (inputs `(("which" ,which))) | 42 | (native-inputs |
| 43 | `(("which" ,which) | ||
| 44 | ("autogen" ,autogen))) | ||
| 42 | (home-page "http://www.gnu.org/software/gnu-pw-mgr/") | 45 | (home-page "http://www.gnu.org/software/gnu-pw-mgr/") |
| 43 | (synopsis "Retrieve login credentials without recording passwords") | 46 | (synopsis "Retrieve login credentials without recording passwords") |
| 44 | (description | 47 | (description |
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm new file mode 100644 index 00000000000..6ab8f09ce67 --- /dev/null +++ b/gnu/packages/gnucash.scm | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu packages gnucash) | ||
| 20 | #:use-module (guix licenses) | ||
| 21 | #:use-module (guix packages) | ||
| 22 | #:use-module (guix download) | ||
| 23 | #:use-module (guix build-system gnu) | ||
| 24 | #:use-module (gnu packages) | ||
| 25 | #:use-module (gnu packages gnome) | ||
| 26 | #:use-module (gnu packages glib) | ||
| 27 | #:use-module (gnu packages gtk) | ||
| 28 | #:use-module (gnu packages guile) | ||
| 29 | #:use-module (gnu packages icu4c) | ||
| 30 | #:use-module (gnu packages pkg-config) | ||
| 31 | #:use-module (gnu packages webkit) | ||
| 32 | #:use-module (gnu packages xml)) | ||
| 33 | |||
| 34 | (define-public gnucash | ||
| 35 | (package | ||
| 36 | (name "gnucash") | ||
| 37 | (version "2.6.6") | ||
| 38 | (source | ||
| 39 | (origin | ||
| 40 | (method url-fetch) | ||
| 41 | (uri (string-append "mirror://sourceforge/gnucash/gnucash-" | ||
| 42 | version ".tar.bz2")) | ||
| 43 | (sha256 | ||
| 44 | (base32 | ||
| 45 | "103ir5qg6k8m2mmg9b99c3gn8myxh1gsqyr0mfhmrhqya68wfdr3")))) | ||
| 46 | (build-system gnu-build-system) | ||
| 47 | (arguments | ||
| 48 | `(#:tests? #f ;FIXME: failing at /qof/gnc-date/qof print date dmy buff | ||
| 49 | #:configure-flags '("--disable-dbi"))) | ||
| 50 | (inputs | ||
| 51 | `(("guile" ,guile-2.0) | ||
| 52 | ("icu4c" ,icu4c) | ||
| 53 | ("glib" ,glib) | ||
| 54 | ("gtk" ,gtk+-2) | ||
| 55 | ("goffice" ,goffice-0.8) | ||
| 56 | ("libgnomecanvas" ,libgnomecanvas) | ||
| 57 | ("libxml2" ,libxml2) | ||
| 58 | ("libxslt" ,libxslt) | ||
| 59 | ("webkitgtk" ,webkitgtk/gtk+-2))) | ||
| 60 | (native-inputs | ||
| 61 | `(("glib" ,glib "bin") ; glib-compile-schemas, etc. | ||
| 62 | ("intltool" ,intltool) | ||
| 63 | ("pkg-config" ,pkg-config))) | ||
| 64 | (home-page "https://gnu.org/software/gnucash") | ||
| 65 | (synopsis "Personal and small business financial accounting software") | ||
| 66 | (description | ||
| 67 | "GnuCash is personal and professional financial-accounting software. | ||
| 68 | It can be used to track bank accounts, stocks, income and expenses, based on | ||
| 69 | the double-entry accounting practice. It includes support for QIF/OFX/HBCI | ||
| 70 | import and transaction matching. It also automates several tasks, such as | ||
| 71 | financial calculations or scheduled transactions.") | ||
| 72 | (license gpl3+))) | ||
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 3b29d1abfa1..5724bc83486 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm | |||
| @@ -190,14 +190,14 @@ compatible to GNU Pth.") | |||
| 190 | (define-public gnupg | 190 | (define-public gnupg |
| 191 | (package | 191 | (package |
| 192 | (name "gnupg") | 192 | (name "gnupg") |
| 193 | (version "2.1.2") | 193 | (version "2.1.4") |
| 194 | (source (origin | 194 | (source (origin |
| 195 | (method url-fetch) | 195 | (method url-fetch) |
| 196 | (uri (string-append "mirror://gnupg/gnupg/gnupg-" version | 196 | (uri (string-append "mirror://gnupg/gnupg/gnupg-" version |
| 197 | ".tar.bz2")) | 197 | ".tar.bz2")) |
| 198 | (sha256 | 198 | (sha256 |
| 199 | (base32 | 199 | (base32 |
| 200 | "14k7c5spai3yppz6izf1ggbnffskl54ln87v1wgy9pwism1mlks0")))) | 200 | "1c3c89b7ziknz6h1dnwmfjhgyy28g982rcncrhmhylb8v3npw4k4")))) |
| 201 | (build-system gnu-build-system) | 201 | (build-system gnu-build-system) |
| 202 | (inputs | 202 | (inputs |
| 203 | `(("bzip2" ,bzip2) | 203 | `(("bzip2" ,bzip2) |
| @@ -231,14 +231,14 @@ libskba (working with X.509 certificates and CMS data).") | |||
| 231 | 231 | ||
| 232 | (define-public gnupg-2.0 | 232 | (define-public gnupg-2.0 |
| 233 | (package (inherit gnupg) | 233 | (package (inherit gnupg) |
| 234 | (version "2.0.27") | 234 | (version "2.0.28") |
| 235 | (source (origin | 235 | (source (origin |
| 236 | (method url-fetch) | 236 | (method url-fetch) |
| 237 | (uri (string-append "mirror://gnupg/gnupg/gnupg-" version | 237 | (uri (string-append "mirror://gnupg/gnupg/gnupg-" version |
| 238 | ".tar.bz2")) | 238 | ".tar.bz2")) |
| 239 | (sha256 | 239 | (sha256 |
| 240 | (base32 | 240 | (base32 |
| 241 | "1wihx7dphacg9fy5wfj93h236lr1w5gwzh7ir3js37wi9cz6sr2p")))) | 241 | "0k2k399fnhfhhr4dvm8d6vs4ihq6gg06191lzfwikzaqmgj2w2ff")))) |
| 242 | (inputs | 242 | (inputs |
| 243 | `(("bzip2" ,bzip2) | 243 | `(("bzip2" ,bzip2) |
| 244 | ("curl" ,curl) | 244 | ("curl" ,curl) |
| @@ -300,7 +300,7 @@ libskba (working with X.509 certificates and CMS data).") | |||
| 300 | ;; Needs to be propagated because gpgme.h includes gpg-error.h. | 300 | ;; Needs to be propagated because gpgme.h includes gpg-error.h. |
| 301 | `(("libgpg-error" ,libgpg-error))) | 301 | `(("libgpg-error" ,libgpg-error))) |
| 302 | (inputs | 302 | (inputs |
| 303 | `(("gnupg" ,gnupg) | 303 | `(("gnupg" ,gnupg-2.0) |
| 304 | ("libassuan" ,libassuan))) | 304 | ("libassuan" ,libassuan))) |
| 305 | (arguments '(#:make-flags '("GPG=gpg2"))) | 305 | (arguments '(#:make-flags '("GPG=gpg2"))) |
| 306 | (home-page "http://www.gnupg.org/related_software/gpgme/") | 306 | (home-page "http://www.gnupg.org/related_software/gpgme/") |
diff --git a/gnu/packages/gnutls.scm b/gnu/packages/gnutls.scm index 17cd4582fff..4ed339a09bd 100644 --- a/gnu/packages/gnutls.scm +++ b/gnu/packages/gnutls.scm | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | (define-public libtasn1 | 39 | (define-public libtasn1 |
| 40 | (package | 40 | (package |
| 41 | (name "libtasn1") | 41 | (name "libtasn1") |
| 42 | (version "4.4") | 42 | (version "4.5") |
| 43 | (source | 43 | (source |
| 44 | (origin | 44 | (origin |
| 45 | (method url-fetch) | 45 | (method url-fetch) |
| @@ -47,7 +47,7 @@ | |||
| 47 | version ".tar.gz")) | 47 | version ".tar.gz")) |
| 48 | (sha256 | 48 | (sha256 |
| 49 | (base32 | 49 | (base32 |
| 50 | "0p8c5s1gm3z3nn4s9qc6gs18grbk45mx44byqw2l2qzynjqrsd7q")))) | 50 | "1nhvnznhg2aqfrfjxc8v008hjlzkh5831jsfahqk89qrw7fbbcw9")))) |
| 51 | (build-system gnu-build-system) | 51 | (build-system gnu-build-system) |
| 52 | (native-inputs `(("perl" ,perl) | 52 | (native-inputs `(("perl" ,perl) |
| 53 | 53 | ||
| @@ -104,7 +104,7 @@ living in the same process.") | |||
| 104 | (define-public gnutls | 104 | (define-public gnutls |
| 105 | (package | 105 | (package |
| 106 | (name "gnutls") | 106 | (name "gnutls") |
| 107 | (version "3.4.0") | 107 | (version "3.4.1") |
| 108 | (source (origin | 108 | (source (origin |
| 109 | (method url-fetch) | 109 | (method url-fetch) |
| 110 | (uri | 110 | (uri |
| @@ -115,9 +115,7 @@ living in the same process.") | |||
| 115 | "/gnutls-" version ".tar.xz")) | 115 | "/gnutls-" version ".tar.xz")) |
| 116 | (sha256 | 116 | (sha256 |
| 117 | (base32 | 117 | (base32 |
| 118 | "0bj7ydvsyvml59b6040wg7694iz37rwnqnv09bic9ddz652588ml")) | 118 | "0bmih0zyiplr4v8798w0v9g3215zmganq18n8935cizkxj5zbdg9")))) |
| 119 | (patches | ||
| 120 | (list (search-patch "gnutls-fix-duplicate-manpages.patch"))))) | ||
| 121 | (build-system gnu-build-system) | 119 | (build-system gnu-build-system) |
| 122 | (arguments | 120 | (arguments |
| 123 | '(#:configure-flags | 121 | '(#:configure-flags |
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 522404f2803..7caa7314a9b 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm | |||
| @@ -124,7 +124,7 @@ in the Mozilla clients.") | |||
| 124 | (define-public nss | 124 | (define-public nss |
| 125 | (package | 125 | (package |
| 126 | (name "nss") | 126 | (name "nss") |
| 127 | (version "3.18") | 127 | (version "3.19.1") |
| 128 | (source (origin | 128 | (source (origin |
| 129 | (method url-fetch) | 129 | (method url-fetch) |
| 130 | (uri (let ((version-with-underscores | 130 | (uri (let ((version-with-underscores |
| @@ -135,7 +135,7 @@ in the Mozilla clients.") | |||
| 135 | "nss-" version ".tar.gz"))) | 135 | "nss-" version ".tar.gz"))) |
| 136 | (sha256 | 136 | (sha256 |
| 137 | (base32 | 137 | (base32 |
| 138 | "0h0xy9kvd2s8r438q4dfn25cgvv5dc1hkm9lb4bgrxpr5bxv13b1")) | 138 | "1zrgqlli01gsg2a5w4bk2p0q3aagi5dhd31yirnj04zca6ap1gmp")) |
| 139 | ;; Create nss.pc and nss-config. | 139 | ;; Create nss.pc and nss-config. |
| 140 | (patches (list (search-patch "nss-pkgconfig.patch"))))) | 140 | (patches (list (search-patch "nss-pkgconfig.patch"))))) |
| 141 | (build-system gnu-build-system) | 141 | (build-system gnu-build-system) |
| @@ -205,6 +205,12 @@ in the Mozilla clients.") | |||
| 205 | ("zlib" ,zlib))) | 205 | ("zlib" ,zlib))) |
| 206 | (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc. | 206 | (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc. |
| 207 | (native-inputs `(("perl" ,perl))) | 207 | (native-inputs `(("perl" ,perl))) |
| 208 | |||
| 209 | ;; The NSS test suite takes over 28 hours on Loongson 3A (MIPS), and | ||
| 210 | ;; possibly longer when another build is happening concurrently on the | ||
| 211 | ;; same machine. | ||
| 212 | (properties '((timeout . 144000))) ; 40 hours | ||
| 213 | |||
| 208 | (home-page | 214 | (home-page |
| 209 | "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS") | 215 | "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS") |
| 210 | (synopsis "Network Security Services") | 216 | (synopsis "Network Security Services") |
| @@ -219,7 +225,7 @@ standards.") | |||
| 219 | (define-public icecat | 225 | (define-public icecat |
| 220 | (package | 226 | (package |
| 221 | (name "icecat") | 227 | (name "icecat") |
| 222 | (version "31.6.0-gnu1") | 228 | (version "31.7.0-gnu1") |
| 223 | (source | 229 | (source |
| 224 | (origin | 230 | (origin |
| 225 | (method url-fetch) | 231 | (method url-fetch) |
| @@ -228,15 +234,13 @@ standards.") | |||
| 228 | name "-" version ".tar.bz2")) | 234 | name "-" version ".tar.bz2")) |
| 229 | (sha256 | 235 | (sha256 |
| 230 | (base32 | 236 | (base32 |
| 231 | "1a4l23msg4cpc4yp59q2z6xv63r6advlbnjy65v4djv6yhgnqf1i")))) | 237 | "0a25jp5afla2dxzj7i4cyvqpa5smsn7ns3xvpzqw6pc7naixkpap")))) |
| 232 | (build-system gnu-build-system) | 238 | (build-system gnu-build-system) |
| 233 | (inputs | 239 | (inputs |
| 234 | `(("alsa-lib" ,alsa-lib) | 240 | `(("alsa-lib" ,alsa-lib) |
| 235 | ("bzip2" ,bzip2) | 241 | ("bzip2" ,bzip2) |
| 236 | ("cairo" ,cairo) | 242 | ("cairo" ,cairo) |
| 237 | ("dbus" ,dbus) | ||
| 238 | ("dbus-glib" ,dbus-glib) | 243 | ("dbus-glib" ,dbus-glib) |
| 239 | ("glib" ,glib) | ||
| 240 | ("gstreamer" ,gstreamer) | 244 | ("gstreamer" ,gstreamer) |
| 241 | ("gst-plugins-base" ,gst-plugins-base) | 245 | ("gst-plugins-base" ,gst-plugins-base) |
| 242 | ("gtk+" ,gtk+-2) | 246 | ("gtk+" ,gtk+-2) |
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm index 03aecdfa534..24dc41b7033 100644 --- a/gnu/packages/gstreamer.scm +++ b/gnu/packages/gstreamer.scm | |||
| @@ -171,6 +171,10 @@ This package provides the core library and elements.") | |||
| 171 | ;; for g-ir-scanner. | 171 | ;; for g-ir-scanner. |
| 172 | (setenv "CC" "gcc")) | 172 | (setenv "CC" "gcc")) |
| 173 | %standard-phases))) | 173 | %standard-phases))) |
| 174 | (native-search-paths | ||
| 175 | (list (search-path-specification | ||
| 176 | (variable "GST_PLUGIN_SYSTEM_PATH") | ||
| 177 | (files '("lib/gstreamer-1.0"))))) | ||
| 174 | (home-page "http://gstreamer.freedesktop.org/") | 178 | (home-page "http://gstreamer.freedesktop.org/") |
| 175 | (synopsis | 179 | (synopsis |
| 176 | "Plugins for the GStreamer multimedia library") | 180 | "Plugins for the GStreamer multimedia library") |
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 8a5a3099bfb..f5189924983 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm | |||
| @@ -138,24 +138,28 @@ affine transformation (scale, rotation, shear, etc.)") | |||
| 138 | (define-public harfbuzz | 138 | (define-public harfbuzz |
| 139 | (package | 139 | (package |
| 140 | (name "harfbuzz") | 140 | (name "harfbuzz") |
| 141 | (version "0.9.22") | 141 | (version "0.9.40") |
| 142 | (source (origin | 142 | (source (origin |
| 143 | (method url-fetch) | 143 | (method url-fetch) |
| 144 | (uri (string-append "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-" | 144 | (uri (string-append "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-" |
| 145 | version ".tar.bz2")) | 145 | version ".tar.bz2")) |
| 146 | (sha256 | 146 | (sha256 |
| 147 | (base32 | 147 | (base32 |
| 148 | "1nkimwadri6v2kzrmz8y0crmy59gw0kg4i4f6cc786bngs0815lq")))) | 148 | "07rjp05axas96fp23lpf8l2yyfdj9yib4m0qjv592vdyhcsxaw8p")))) |
| 149 | (build-system gnu-build-system) | 149 | (build-system gnu-build-system) |
| 150 | (inputs | 150 | (inputs |
| 151 | `(("cairo" ,cairo) | 151 | `(("cairo" ,cairo) |
| 152 | ("graphite2" ,graphite2) | 152 | ("graphite2" ,graphite2) |
| 153 | ("icu4c" ,icu4c))) | 153 | ("icu4c" ,icu4c))) |
| 154 | (propagated-inputs | ||
| 155 | `(("glib" ,glib))) ; required by harfbuzz-gobject.pc | ||
| 154 | (native-inputs | 156 | (native-inputs |
| 155 | `(("pkg-config" ,pkg-config) | 157 | `(("gobject-introspection" ,gobject-introspection) |
| 156 | ("python" ,python-wrapper))) | 158 | ("pkg-config" ,pkg-config) |
| 159 | ("python" ,python-2))) ; incompatible with Python 3 (print syntax) | ||
| 157 | (arguments | 160 | (arguments |
| 158 | `(#:configure-flags `("--with-graphite2=yes"))) | 161 | `(#:configure-flags `("--with-graphite2" |
| 162 | "--with-gobject"))) | ||
| 159 | (synopsis "OpenType text shaping engine") | 163 | (synopsis "OpenType text shaping engine") |
| 160 | (description | 164 | (description |
| 161 | "HarfBuzz is an OpenType text shaping engine.") | 165 | "HarfBuzz is an OpenType text shaping engine.") |
| @@ -426,7 +430,7 @@ is part of the GNOME accessibility project.") | |||
| 426 | (define-public gtk+-2 | 430 | (define-public gtk+-2 |
| 427 | (package | 431 | (package |
| 428 | (name "gtk+") | 432 | (name "gtk+") |
| 429 | (version "2.24.27") | 433 | (version "2.24.28") |
| 430 | (source (origin | 434 | (source (origin |
| 431 | (method url-fetch) | 435 | (method url-fetch) |
| 432 | (uri (string-append "mirror://gnome/sources/" name "/" | 436 | (uri (string-append "mirror://gnome/sources/" name "/" |
| @@ -434,7 +438,7 @@ is part of the GNOME accessibility project.") | |||
| 434 | name "-" version ".tar.xz")) | 438 | name "-" version ".tar.xz")) |
| 435 | (sha256 | 439 | (sha256 |
| 436 | (base32 | 440 | (base32 |
| 437 | "1x14rnjvqslpa1q19fp1qalz5sxds72amsgjk8m7769rwk511jr0")))) | 441 | "0mj6xn40py9r9lvzg633fal81xfwfm89d9mvz7jk4lmwk0g49imj")))) |
| 438 | (build-system gnu-build-system) | 442 | (build-system gnu-build-system) |
| 439 | (outputs '("out" "doc")) | 443 | (outputs '("out" "doc")) |
| 440 | (propagated-inputs | 444 | (propagated-inputs |
| @@ -482,7 +486,7 @@ application suites.") | |||
| 482 | (define-public gtk+ | 486 | (define-public gtk+ |
| 483 | (package (inherit gtk+-2) | 487 | (package (inherit gtk+-2) |
| 484 | (name "gtk+") | 488 | (name "gtk+") |
| 485 | (version "3.16.2") | 489 | (version "3.16.3") |
| 486 | (source (origin | 490 | (source (origin |
| 487 | (method url-fetch) | 491 | (method url-fetch) |
| 488 | (uri (string-append "mirror://gnome/sources/" name "/" | 492 | (uri (string-append "mirror://gnome/sources/" name "/" |
| @@ -490,7 +494,7 @@ application suites.") | |||
| 490 | name "-" version ".tar.xz")) | 494 | name "-" version ".tar.xz")) |
| 491 | (sha256 | 495 | (sha256 |
| 492 | (base32 | 496 | (base32 |
| 493 | "1yhwg2l72l3khfkprydcjlpxjrg11ccqfc80sjl56llz3jk66fd0")))) | 497 | "195ykv53sl2gsc847wcnd79zilm1yzcc2cfjxnrakhh2dd5gshr9")))) |
| 494 | (propagated-inputs | 498 | (propagated-inputs |
| 495 | `(("at-spi2-atk" ,at-spi2-atk) | 499 | `(("at-spi2-atk" ,at-spi2-atk) |
| 496 | ("atk" ,atk) | 500 | ("atk" ,atk) |
| @@ -501,7 +505,8 @@ application suites.") | |||
| 501 | ("libxdamage" ,libxdamage) | 505 | ("libxdamage" ,libxdamage) |
| 502 | ("pango" ,pango))) | 506 | ("pango" ,pango))) |
| 503 | (inputs | 507 | (inputs |
| 504 | `(("libxml2" ,libxml2) | 508 | `(("librsvg" ,librsvg) ;for gtk-encode-symbolic-svg |
| 509 | ("libxml2" ,libxml2) | ||
| 505 | ("cups" ,cups))) ;for printing support | 510 | ("cups" ,cups))) ;for printing support |
| 506 | (native-inputs | 511 | (native-inputs |
| 507 | `(("perl" ,perl) | 512 | `(("perl" ,perl) |
| @@ -533,7 +538,18 @@ application suites.") | |||
| 533 | "demos/gtk-demo/Makefile.in") | 538 | "demos/gtk-demo/Makefile.in") |
| 534 | (("gtk-update-icon-cache") "$(bindir)/gtk-update-icon-cache")) | 539 | (("gtk-update-icon-cache") "$(bindir)/gtk-update-icon-cache")) |
| 535 | #t) | 540 | #t) |
| 536 | %standard-phases))))) | 541 | (alist-cons-after |
| 542 | 'install 'wrap-gtk-encode-symbolic-svg | ||
| 543 | ;; By using GdkPixbuf, gtk-encode-symbolic-svg needs to know | ||
| 544 | ;; librsvg's loaders.cache to handle SVG files. | ||
| 545 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 546 | (let* ((out (assoc-ref outputs "out")) | ||
| 547 | (prog (string-append out "/bin/gtk-encode-symbolic-svg")) | ||
| 548 | (librsvg (assoc-ref inputs "librsvg")) | ||
| 549 | (loaders.cache (find-files librsvg "^loaders\\.cache$"))) | ||
| 550 | (wrap-program prog | ||
| 551 | `("GDK_PIXBUF_MODULE_FILE" = ,loaders.cache)))) | ||
| 552 | %standard-phases)))))) | ||
| 537 | 553 | ||
| 538 | ;;; | 554 | ;;; |
| 539 | ;;; Guile bindings. | 555 | ;;; Guile bindings. |
| @@ -844,7 +860,7 @@ write GNOME applications.") | |||
| 844 | (define-public girara | 860 | (define-public girara |
| 845 | (package | 861 | (package |
| 846 | (name "girara") | 862 | (name "girara") |
| 847 | (version "0.2.3") | 863 | (version "0.2.4") |
| 848 | (source (origin | 864 | (source (origin |
| 849 | (method url-fetch) | 865 | (method url-fetch) |
| 850 | (uri | 866 | (uri |
| @@ -852,7 +868,7 @@ write GNOME applications.") | |||
| 852 | version ".tar.gz")) | 868 | version ".tar.gz")) |
| 853 | (sha256 | 869 | (sha256 |
| 854 | (base32 | 870 | (base32 |
| 855 | "1phfmqp8y17zcy9yi6pm2f80x8ldbk60iswpm4bmjz5217jwqzxh")))) | 871 | "0pnfdsg435b5vc4x8l9pgm77aj7ram1q0bzrp9g4a3bh1r64xq1f")))) |
| 856 | (native-inputs `(("pkg-config" ,pkg-config) | 872 | (native-inputs `(("pkg-config" ,pkg-config) |
| 857 | ("gettext" ,gnu-gettext))) | 873 | ("gettext" ,gnu-gettext))) |
| 858 | (inputs `(("gtk+" ,gtk+) | 874 | (inputs `(("gtk+" ,gtk+) |
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 751002f54cc..d8c1a8ca35a 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #:use-module (gnu packages gperf) | 27 | #:use-module (gnu packages gperf) |
| 28 | #:use-module (gnu packages libffi) | 28 | #:use-module (gnu packages libffi) |
| 29 | #:use-module (gnu packages autotools) | 29 | #:use-module (gnu packages autotools) |
| 30 | #:use-module (gnu packages flex) | ||
| 30 | #:use-module (gnu packages libunistring) | 31 | #:use-module (gnu packages libunistring) |
| 31 | #:use-module (gnu packages m4) | 32 | #:use-module (gnu packages m4) |
| 32 | #:use-module (gnu packages multiprecision) | 33 | #:use-module (gnu packages multiprecision) |
| @@ -35,6 +36,9 @@ | |||
| 35 | #:use-module (gnu packages ncurses) | 36 | #:use-module (gnu packages ncurses) |
| 36 | #:use-module (gnu packages ed) | 37 | #:use-module (gnu packages ed) |
| 37 | #:use-module (gnu packages base) | 38 | #:use-module (gnu packages base) |
| 39 | #:use-module (gnu packages texinfo) | ||
| 40 | #:use-module (gnu packages gettext) | ||
| 41 | #:use-module (gnu packages gdbm) | ||
| 38 | #:use-module (guix packages) | 42 | #:use-module (guix packages) |
| 39 | #:use-module (guix download) | 43 | #:use-module (guix download) |
| 40 | #:use-module (guix git-download) | 44 | #:use-module (guix git-download) |
| @@ -181,6 +185,42 @@ without requiring the source code to be rewritten.") | |||
| 181 | ;; in the `base' module, and thus changing it entails a full rebuild. | 185 | ;; in the `base' module, and thus changing it entails a full rebuild. |
| 182 | guile-2.0) | 186 | guile-2.0) |
| 183 | 187 | ||
| 188 | (define-public guile-for-guile-emacs | ||
| 189 | (package (inherit guile-2.0) | ||
| 190 | (name "guile-for-guile-emacs") | ||
| 191 | (version "20150510.d8d9a8d") | ||
| 192 | (source (origin | ||
| 193 | (method git-fetch) | ||
| 194 | (uri (git-reference | ||
| 195 | (url "git://git.hcoop.net/git/bpt/guile.git") | ||
| 196 | (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17"))) | ||
| 197 | (sha256 | ||
| 198 | (base32 | ||
| 199 | "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0")))) | ||
| 200 | (arguments | ||
| 201 | (substitute-keyword-arguments `(;; Tests aren't passing for now. | ||
| 202 | ;; Obviously we should re-enable this! | ||
| 203 | #:tests? #f | ||
| 204 | ,@(package-arguments guile-2.0)) | ||
| 205 | ((#:phases phases) | ||
| 206 | `(modify-phases ,phases | ||
| 207 | (add-after 'unpack 'autogen | ||
| 208 | (lambda _ | ||
| 209 | (zero? (system* "sh" "autogen.sh")))) | ||
| 210 | (add-before 'autogen 'patch-/bin/sh | ||
| 211 | (lambda _ | ||
| 212 | (substitute* "build-aux/git-version-gen" | ||
| 213 | (("#!/bin/sh") (string-append "#!" (which "sh")))) | ||
| 214 | #t)))))) | ||
| 215 | (native-inputs | ||
| 216 | `(("autoconf" ,autoconf) | ||
| 217 | ("automake" ,automake) | ||
| 218 | ("libtool" ,libtool) | ||
| 219 | ("flex" ,flex) | ||
| 220 | ("texinfo" ,texinfo) | ||
| 221 | ("gettext" ,gnu-gettext) | ||
| 222 | ,@(package-native-inputs guile-2.0))))) | ||
| 223 | |||
| 184 | 224 | ||
| 185 | ;;; | 225 | ;;; |
| 186 | ;;; Extensions. | 226 | ;;; Extensions. |
| @@ -189,25 +229,19 @@ without requiring the source code to be rewritten.") | |||
| 189 | (define-public guile-reader | 229 | (define-public guile-reader |
| 190 | (package | 230 | (package |
| 191 | (name "guile-reader") | 231 | (name "guile-reader") |
| 192 | (version "0.6") | 232 | (version "0.6.1") |
| 193 | (source (origin | 233 | (source (origin |
| 194 | (method url-fetch) | 234 | (method url-fetch) |
| 195 | (uri (string-append "mirror://savannah/guile-reader/guile-reader-" | 235 | (uri (string-append "mirror://savannah/guile-reader/guile-reader-" |
| 196 | version ".tar.gz")) | 236 | version ".tar.gz")) |
| 197 | (sha256 | 237 | (sha256 |
| 198 | (base32 | 238 | (base32 |
| 199 | "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n")))) | 239 | "020wz5w8z6g79nbqifg2n496wxwkcjzh8xizpv6mz0hczpl155ma")))) |
| 200 | (build-system gnu-build-system) | 240 | (build-system gnu-build-system) |
| 201 | (native-inputs `(("pkgconfig" ,pkg-config) | 241 | (native-inputs `(("pkgconfig" ,pkg-config) |
| 202 | ("gperf" ,gperf))) | 242 | ("gperf" ,gperf))) |
| 203 | (inputs `(("guile" ,guile-2.0))) | 243 | (inputs `(("guile" ,guile-2.0))) |
| 204 | (arguments `(;; The extract-*.sh scripts really expect to run in the C | 244 | (arguments `(#:configure-flags |
| 205 | ;; locale. Failing to do that, we end up with a build | ||
| 206 | ;; failure while extracting doc. (Fixed in Guile-Reader's | ||
| 207 | ;; repo.) | ||
| 208 | #:locale "C" | ||
| 209 | |||
| 210 | #:configure-flags | ||
| 211 | (let ((out (assoc-ref %outputs "out"))) | 245 | (let ((out (assoc-ref %outputs "out"))) |
| 212 | (list (string-append "--with-guilemoduledir=" | 246 | (list (string-append "--with-guilemoduledir=" |
| 213 | out "/share/guile/site/2.0"))))) | 247 | out "/share/guile/site/2.0"))))) |
| @@ -436,4 +470,69 @@ slightly from miniKanren mainline. | |||
| 436 | See http://minikanren.org/ for more on miniKanren generally.") | 470 | See http://minikanren.org/ for more on miniKanren generally.") |
| 437 | (license expat))) | 471 | (license expat))) |
| 438 | 472 | ||
| 473 | |||
| 474 | ;; There are two guile-gdbm packages, one using the FFI and one with | ||
| 475 | ;; direct C bindings, hence the verbose name. | ||
| 476 | |||
| 477 | (define-public guile-gdbm-ffi | ||
| 478 | (package | ||
| 479 | (name "guile-gdbm-ffi") | ||
| 480 | (version "20120209.fa1d5b6") | ||
| 481 | (source (origin | ||
| 482 | (method git-fetch) | ||
| 483 | (uri (git-reference | ||
| 484 | (url "https://github.com/ijp/guile-gdbm.git") | ||
| 485 | (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246"))) | ||
| 486 | (sha256 | ||
| 487 | (base32 | ||
| 488 | "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj")))) | ||
| 489 | (build-system trivial-build-system) | ||
| 490 | (arguments | ||
| 491 | `(#:modules | ||
| 492 | ((guix build utils)) | ||
| 493 | #:builder | ||
| 494 | (begin | ||
| 495 | (use-modules (guix build utils) | ||
| 496 | (system base compile)) | ||
| 497 | |||
| 498 | (let* ((out (assoc-ref %outputs "out")) | ||
| 499 | (module-dir (string-append out "/share/guile/site/2.0")) | ||
| 500 | (source (assoc-ref %build-inputs "source")) | ||
| 501 | (doc (string-append out "/share/doc")) | ||
| 502 | (guild (string-append (assoc-ref %build-inputs "guile") | ||
| 503 | "/bin/guild")) | ||
| 504 | (gdbm.scm-dest | ||
| 505 | (string-append module-dir "/gdbm.scm")) | ||
| 506 | (gdbm.go-dest | ||
| 507 | (string-append module-dir "/gdbm.go"))) | ||
| 508 | ;; Make installation directories. | ||
| 509 | (mkdir-p module-dir) | ||
| 510 | (mkdir-p doc) | ||
| 511 | |||
| 512 | ;; Switch directory for compiling and installing | ||
| 513 | (chdir source) | ||
| 514 | |||
| 515 | ;; copy the source | ||
| 516 | (copy-file "gdbm.scm" gdbm.scm-dest) | ||
| 517 | |||
| 518 | ;; Patch the FFI | ||
| 519 | (substitute* gdbm.scm-dest | ||
| 520 | (("\\(dynamic-link \"libgdbm\"\\)") | ||
| 521 | (format #f "(dynamic-link \"~a/lib/libgdbm.so\")" | ||
| 522 | (assoc-ref %build-inputs "gdbm")))) | ||
| 523 | |||
| 524 | ;; compile to the destination | ||
| 525 | (compile-file gdbm.scm-dest | ||
| 526 | #:output-file gdbm.go-dest))))) | ||
| 527 | (inputs | ||
| 528 | `(("guile" ,guile-2.0))) | ||
| 529 | (propagated-inputs | ||
| 530 | `(("gdbm" ,gdbm))) | ||
| 531 | (home-page "https://github.com/ijp/guile-gdbm") | ||
| 532 | (synopsis "Guile bindings to the GDBM library via Guile's FFI") | ||
| 533 | (description | ||
| 534 | "Guile bindings to the GDBM key-value storage system, using | ||
| 535 | Guile's foreign function interface.") | ||
| 536 | (license gpl3+))) | ||
| 537 | |||
| 439 | ;;; guile.scm ends here | 538 | ;;; guile.scm ends here |
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 3bb5e3074a2..ac87de540ed 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm | |||
| @@ -373,14 +373,13 @@ access to the full zlib feature set.") | |||
| 373 | (arguments | 373 | (arguments |
| 374 | `(#:tests? #f)) ; FIXME: currently missing libraries used for tests. | 374 | `(#:tests? #f)) ; FIXME: currently missing libraries used for tests. |
| 375 | (home-page "https://github.com/bos/text") | 375 | (home-page "https://github.com/bos/text") |
| 376 | (synopsis | 376 | (synopsis "Efficient packed Unicode text type library") |
| 377 | "Efficient packed Unicode text type library.") | ||
| 378 | (description | 377 | (description |
| 379 | "An efficient packed, immutable Unicode text type (both strict and | 378 | "An efficient packed, immutable Unicode text type (both strict and |
| 380 | lazy), with a powerful loop fusion optimization framework. | 379 | lazy), with a powerful loop fusion optimization framework. |
| 381 | 380 | ||
| 382 | The 'Text' type represents Unicode character strings, in a time and | 381 | The 'Text' type represents Unicode character strings, in a time and |
| 383 | space-efficient manner. This package provides text processing | 382 | space-efficient manner. This package provides text processing |
| 384 | capabilities that are optimized for performance critical use, both | 383 | capabilities that are optimized for performance critical use, both |
| 385 | in terms of large data quantities and high speed.") | 384 | in terms of large data quantities and high speed.") |
| 386 | (license bsd-3))) | 385 | (license bsd-3))) |
| @@ -870,7 +869,7 @@ package into this package.") | |||
| 870 | (home-page "https://github.com/haskell/HTTP") | 869 | (home-page "https://github.com/haskell/HTTP") |
| 871 | (synopsis "Library for client-side HTTP") | 870 | (synopsis "Library for client-side HTTP") |
| 872 | (description | 871 | (description |
| 873 | "The HTTP package supports client-side web programming in Haskell. It | 872 | "The HTTP package supports client-side web programming in Haskell. It |
| 874 | lets you set up HTTP connections, transmitting requests and processing the | 873 | lets you set up HTTP connections, transmitting requests and processing the |
| 875 | responses coming back.") | 874 | responses coming back.") |
| 876 | (license bsd-3))) | 875 | (license bsd-3))) |
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm index 813d0040eea..1abe70a1ab5 100644 --- a/gnu/packages/ibus.scm +++ b/gnu/packages/ibus.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | 2 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
| 3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -72,7 +73,6 @@ | |||
| 72 | `(("dbus" ,dbus) | 73 | `(("dbus" ,dbus) |
| 73 | ("dconf" ,dconf) | 74 | ("dconf" ,dconf) |
| 74 | ("gconf" ,gconf) | 75 | ("gconf" ,gconf) |
| 75 | ("glib" ,glib) | ||
| 76 | ("gtk2" ,gtk+-2) | 76 | ("gtk2" ,gtk+-2) |
| 77 | ("intltool" ,intltool) | 77 | ("intltool" ,intltool) |
| 78 | ("libnotify" ,libnotify) | 78 | ("libnotify" ,libnotify) |
diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm index a575e91c8cf..a753a22b20d 100644 --- a/gnu/packages/icu4c.scm +++ b/gnu/packages/icu4c.scm | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | (define-public icu4c | 28 | (define-public icu4c |
| 29 | (package | 29 | (package |
| 30 | (name "icu4c") | 30 | (name "icu4c") |
| 31 | (version "54.1") | 31 | (version "55.1") |
| 32 | (source (origin | 32 | (source (origin |
| 33 | (method url-fetch) | 33 | (method url-fetch) |
| 34 | (uri (string-append "http://download.icu-project.org/files/icu4c/" | 34 | (uri (string-append "http://download.icu-project.org/files/icu4c/" |
| @@ -37,7 +37,7 @@ | |||
| 37 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | 37 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) |
| 38 | "-src.tgz")) | 38 | "-src.tgz")) |
| 39 | (sha256 | 39 | (sha256 |
| 40 | (base32 "1cwapgjmvrcv1n2wjspj3vahidg596gjfp4jn1gcb4baralcjayl")))) | 40 | (base32 "0ys5f5spizg45qlaa31j2lhgry0jka2gfha527n4ndfxxz5j4sz1")))) |
| 41 | (build-system gnu-build-system) | 41 | (build-system gnu-build-system) |
| 42 | (inputs | 42 | (inputs |
| 43 | `(("perl" ,perl))) | 43 | `(("perl" ,perl))) |
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index c24ec993752..89590cc5adb 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm | |||
| @@ -555,10 +555,10 @@ multi-dimensional image processing.") | |||
| 555 | (synopsis "Lossless and lossy image compression") | 555 | (synopsis "Lossless and lossy image compression") |
| 556 | (description | 556 | (description |
| 557 | "WebP is a new image format that provides lossless and lossy compression | 557 | "WebP is a new image format that provides lossless and lossy compression |
| 558 | for images. WebP lossless images are 26% smaller in size compared to | 558 | for images. WebP lossless images are 26% smaller in size compared to |
| 559 | PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at | 559 | PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at |
| 560 | equivalent SSIM index. WebP supports lossless transparency (also known as | 560 | equivalent SSIM index. WebP supports lossless transparency (also known as |
| 561 | alpha channel) with just 22% additional bytes. Transparency is also supported | 561 | alpha channel) with just 22% additional bytes. Transparency is also supported |
| 562 | with lossy compression and typically provides 3x smaller file sizes compared | 562 | with lossy compression and typically provides 3x smaller file sizes compared |
| 563 | to PNG when lossy compression is acceptable for the red/green/blue color | 563 | to PNG when lossy compression is acceptable for the red/green/blue color |
| 564 | channels.") | 564 | channels.") |
diff --git a/gnu/packages/imagemagick.scm b/gnu/packages/imagemagick.scm index ab663b5a416..b52237f9924 100644 --- a/gnu/packages/imagemagick.scm +++ b/gnu/packages/imagemagick.scm | |||
| @@ -37,14 +37,14 @@ | |||
| 37 | (define-public imagemagick | 37 | (define-public imagemagick |
| 38 | (package | 38 | (package |
| 39 | (name "imagemagick") | 39 | (name "imagemagick") |
| 40 | (version "6.9.0-4") | 40 | (version "6.9.1-3") |
| 41 | (source (origin | 41 | (source (origin |
| 42 | (method url-fetch) | 42 | (method url-fetch) |
| 43 | (uri (string-append "mirror://imagemagick/ImageMagick-" | 43 | (uri (string-append "mirror://imagemagick/ImageMagick-" |
| 44 | version ".tar.xz")) | 44 | version ".tar.xz")) |
| 45 | (sha256 | 45 | (sha256 |
| 46 | (base32 | 46 | (base32 |
| 47 | "0ms9lxrm3hvgghv8k7rj6kvk40xkc6lgr41xyaxz7lyf3l4ahslr")))) | 47 | "18wbsjfccxlgsdsd6h9wvhcjrsglyi086jk4bk029ik07rh81laz")))) |
| 48 | (build-system gnu-build-system) | 48 | (build-system gnu-build-system) |
| 49 | (arguments | 49 | (arguments |
| 50 | `(#:phases (alist-cons-before | 50 | `(#:phases (alist-cons-before |
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 26fc3eccf59..ea8de9e2cf4 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm | |||
| @@ -250,6 +250,11 @@ build process and its dependencies, whereas Make uses Makefile format.") | |||
| 250 | ;; gremlin) doesn't support it yet, so skip this phase. | 250 | ;; gremlin) doesn't support it yet, so skip this phase. |
| 251 | #:validate-runpath? #f | 251 | #:validate-runpath? #f |
| 252 | 252 | ||
| 253 | #:modules ((guix build utils) | ||
| 254 | (guix build gnu-build-system) | ||
| 255 | (ice-9 popen) | ||
| 256 | (ice-9 rdelim)) | ||
| 257 | |||
| 253 | #:configure-flags | 258 | #:configure-flags |
| 254 | (let* ((gcjdir (assoc-ref %build-inputs "gcj")) | 259 | (let* ((gcjdir (assoc-ref %build-inputs "gcj")) |
| 255 | (ecj (string-append gcjdir "/share/java/ecj.jar")) | 260 | (ecj (string-append gcjdir "/share/java/ecj.jar")) |
| @@ -378,9 +383,16 @@ build process and its dependencies, whereas Make uses Makefile format.") | |||
| 378 | (lambda* (#:key inputs #:allow-other-keys) | 383 | (lambda* (#:key inputs #:allow-other-keys) |
| 379 | (let* ((gcjdir (assoc-ref %build-inputs "gcj")) | 384 | (let* ((gcjdir (assoc-ref %build-inputs "gcj")) |
| 380 | (gcjlib (string-append gcjdir "/lib")) | 385 | (gcjlib (string-append gcjdir "/lib")) |
| 381 | (antpath (string-append (getcwd) "/../apache-ant-1.9.4"))) | 386 | (antpath (string-append (getcwd) "/../apache-ant-1.9.4")) |
| 387 | ;; Get target-specific include directory so that | ||
| 388 | ;; libgcj-config.h is found when compiling hotspot. | ||
| 389 | (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include")) | ||
| 390 | (str (read-line port))) | ||
| 391 | (close-pipe port) | ||
| 392 | str))) | ||
| 382 | (setenv "CPATH" | 393 | (setenv "CPATH" |
| 383 | (string-append (assoc-ref %build-inputs "libxrender") | 394 | (string-append gcjinclude ":" |
| 395 | (assoc-ref %build-inputs "libxrender") | ||
| 384 | "/include/X11/extensions" ":" | 396 | "/include/X11/extensions" ":" |
| 385 | (assoc-ref %build-inputs "libxtst") | 397 | (assoc-ref %build-inputs "libxtst") |
| 386 | "/include/X11/extensions" ":" | 398 | "/include/X11/extensions" ":" |
diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm index c6556865c2e..1409e7c0b10 100644 --- a/gnu/packages/kde.scm +++ b/gnu/packages/kde.scm | |||
| @@ -224,6 +224,6 @@ calculation of sha1 for every file crawled | |||
| 224 | (arguments | 224 | (arguments |
| 225 | `(#:tests? #f)) ; no test target | 225 | `(#:tests? #f)) ; no test target |
| 226 | (home-page "http://www.kde.org/") | 226 | (home-page "http://www.kde.org/") |
| 227 | (synopsis "oxygen icon theme for the KDE desktop") | 227 | (synopsis "Oxygen icon theme for the KDE desktop") |
| 228 | (description "KDE desktop environment") | 228 | (description "KDE desktop environment") |
| 229 | (license lgpl3+))) | 229 | (license lgpl3+))) |
diff --git a/gnu/packages/libedit.scm b/gnu/packages/libedit.scm index fcf5ab4c74f..1d7b5b6a5fc 100644 --- a/gnu/packages/libedit.scm +++ b/gnu/packages/libedit.scm | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | (synopsis "NetBSD Editline library") | 42 | (synopsis "NetBSD Editline library") |
| 43 | (description | 43 | (description |
| 44 | "This is an autotool- and libtoolized port of the NetBSD Editline | 44 | "This is an autotool- and libtoolized port of the NetBSD Editline |
| 45 | library (libedit). This Berkeley-style licensed command line editor library | 45 | library (libedit). This Berkeley-style licensed command line editor library |
| 46 | provides generic line editing, history, and tokenization functions, similar to | 46 | provides generic line editing, history, and tokenization functions, similar to |
| 47 | those found in GNU Readline.") | 47 | those found in GNU Readline.") |
| 48 | (license bsd-3))) | 48 | (license bsd-3))) |
diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm index cbe1c75eeb6..4cd78f68cc0 100644 --- a/gnu/packages/libreoffice.scm +++ b/gnu/packages/libreoffice.scm | |||
| @@ -18,14 +18,51 @@ | |||
| 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 19 | ||
| 20 | (define-module (gnu packages libreoffice) | 20 | (define-module (gnu packages libreoffice) |
| 21 | #:use-module (guix packages) | ||
| 22 | #:use-module (guix download) | ||
| 23 | #:use-module ((guix licenses) #:select (mpl2.0)) | ||
| 24 | #:use-module (guix build-system gnu) | 21 | #:use-module (guix build-system gnu) |
| 22 | #:use-module (guix download) | ||
| 23 | #:use-module ((guix licenses) | ||
| 24 | #:select (gpl2+ lgpl2.1+ mpl1.1 mpl2.0 | ||
| 25 | non-copyleft x11-style)) | ||
| 26 | #:use-module (guix packages) | ||
| 27 | #:use-module (guix utils) | ||
| 28 | #:use-module (gnu packages autotools) | ||
| 29 | #:use-module (gnu packages base) | ||
| 30 | #:use-module (gnu packages bison) | ||
| 25 | #:use-module (gnu packages boost) | 31 | #:use-module (gnu packages boost) |
| 32 | #:use-module (gnu packages check) | ||
| 26 | #:use-module (gnu packages compression) | 33 | #:use-module (gnu packages compression) |
| 34 | #:use-module (gnu packages cups) | ||
| 35 | #:use-module (gnu packages curl) | ||
| 36 | #:use-module (gnu packages cyrus-sasl) | ||
| 37 | #:use-module (gnu packages databases) | ||
| 38 | #:use-module (gnu packages doxygen) | ||
| 39 | #:use-module (gnu packages flex) | ||
| 40 | #:use-module (gnu packages fontutils) | ||
| 41 | #:use-module (gnu packages ghostscript) | ||
| 42 | #:use-module (gnu packages gl) | ||
| 43 | #:use-module (gnu packages glib) | ||
| 44 | #:use-module (gnu packages gnome) | ||
| 45 | #:use-module (gnu packages gperf) | ||
| 46 | #:use-module (gnu packages gnuzilla) | ||
| 47 | #:use-module (gnu packages gstreamer) | ||
| 48 | #:use-module (gnu packages gtk) | ||
| 49 | #:use-module (gnu packages icu4c) | ||
| 50 | #:use-module (gnu packages image) | ||
| 51 | #:use-module (gnu packages java) | ||
| 52 | #:use-module (gnu packages linux) | ||
| 53 | #:use-module (gnu packages maths) | ||
| 54 | #:use-module (gnu packages openldap) | ||
| 55 | #:use-module (gnu packages openssl) | ||
| 56 | #:use-module (gnu packages pdf) | ||
| 57 | #:use-module (gnu packages perl) | ||
| 27 | #:use-module (gnu packages pkg-config) | 58 | #:use-module (gnu packages pkg-config) |
| 28 | #:use-module (gnu packages python)) | 59 | #:use-module (gnu packages python) |
| 60 | #:use-module (gnu packages rdf) | ||
| 61 | #:use-module (gnu packages scanner) | ||
| 62 | #:use-module (gnu packages version-control) | ||
| 63 | #:use-module (gnu packages xml) | ||
| 64 | #:use-module (gnu packages xorg) | ||
| 65 | #:use-module (gnu packages zip)) | ||
| 29 | 66 | ||
| 30 | (define-public ixion | 67 | (define-public ixion |
| 31 | (package | 68 | (package |
| @@ -79,3 +116,711 @@ Microsoft Excel 2007 XML, Microsoft Excel 2003 XML, Open Document Spreadsheet, | |||
| 79 | Plain Text, Gnumeric XML, Generic XML. It also includes low-level parsers for | 116 | Plain Text, Gnumeric XML, Generic XML. It also includes low-level parsers for |
| 80 | CSV, CSS and XML.") | 117 | CSV, CSS and XML.") |
| 81 | (license mpl2.0))) | 118 | (license mpl2.0))) |
| 119 | |||
| 120 | (define-public librevenge | ||
| 121 | (package | ||
| 122 | (name "librevenge") | ||
| 123 | (version "0.0.2") | ||
| 124 | (source | ||
| 125 | (origin | ||
| 126 | (method url-fetch) | ||
| 127 | (uri (string-append "mirror://sourceforge/libwpd/" name "/" name "-" | ||
| 128 | version ".tar.xz")) | ||
| 129 | (sha256 (base32 | ||
| 130 | "03ygxyb0vfjv8raif5q62sl33b54wkr5rzgadb8slijm6k281wpn")))) | ||
| 131 | (build-system gnu-build-system) | ||
| 132 | (native-inputs | ||
| 133 | `(("boost" ,boost) | ||
| 134 | ("cppunit" ,cppunit) | ||
| 135 | ("doxygen" ,doxygen) | ||
| 136 | ("pkg-config" ,pkg-config))) | ||
| 137 | (inputs | ||
| 138 | `(("zlib" ,zlib))) | ||
| 139 | (arguments | ||
| 140 | ;; avoid triggering configure errors by simple inclusion of boost headers | ||
| 141 | `(#:configure-flags '("--disable-werror"))) | ||
| 142 | (home-page "http://sourceforge.net/p/libwpd/wiki/librevenge/") | ||
| 143 | (synopsis "Document importer for office suites") | ||
| 144 | (description "Librevenge is a base library for writing document import | ||
| 145 | filters. It has interfaces for text documents, vector graphics, | ||
| 146 | spreadsheets and presentations.") | ||
| 147 | (license (list mpl2.0 lgpl2.1+)))) ;dual licensed | ||
| 148 | |||
| 149 | (define-public libwpd | ||
| 150 | (package | ||
| 151 | (name "libwpd") | ||
| 152 | (version "0.10.0") | ||
| 153 | (source | ||
| 154 | (origin | ||
| 155 | (method url-fetch) | ||
| 156 | (uri (string-append "mirror://sourceforge/libwpd/" name "/" name "-" | ||
| 157 | version ".tar.xz")) | ||
| 158 | (sha256 (base32 | ||
| 159 | "0b6krzr6kxzm89g6bapn805kdayq70hn16n5b5wfs2lwrf0ag2wx")))) | ||
| 160 | (build-system gnu-build-system) | ||
| 161 | (native-inputs | ||
| 162 | `(("doxygen" ,doxygen) | ||
| 163 | ("pkg-config" ,pkg-config))) | ||
| 164 | (propagated-inputs | ||
| 165 | `(("librevenge" ,librevenge))) ; in Requires field of .pkg | ||
| 166 | (inputs | ||
| 167 | `(("zlib" ,zlib))) | ||
| 168 | (home-page "http://libwpd.sourceforge.net/") | ||
| 169 | (synopsis "Library for importing WordPerfect documents") | ||
| 170 | (description "Libwpd is a C++ library designed to help process | ||
| 171 | WordPerfect documents. It is most commonly used to import such documents | ||
| 172 | into other word processors.") | ||
| 173 | (license (list mpl2.0 lgpl2.1+)))) ;dual licensed | ||
| 174 | |||
| 175 | (define-public libe-book | ||
| 176 | (package | ||
| 177 | (name "libe-book") | ||
| 178 | (version "0.1.2") | ||
| 179 | (source | ||
| 180 | (origin | ||
| 181 | (method url-fetch) | ||
| 182 | (uri (string-append "mirror://sourceforge/libebook/libe-book-" | ||
| 183 | version "/libe-book-" version ".tar.xz")) | ||
| 184 | (sha256 | ||
| 185 | (base32 | ||
| 186 | "1v48pd32r2pfysr3a3igc4ivcf6vvb26jq4pdkcnq75p70alp2bz")))) | ||
| 187 | (build-system gnu-build-system) | ||
| 188 | (native-inputs | ||
| 189 | `(("cppunit" ,cppunit) | ||
| 190 | ("gperf" ,gperf) | ||
| 191 | ("pkg-config" ,pkg-config))) | ||
| 192 | (propagated-inputs ; in Requires or Requires.private field of .pkg | ||
| 193 | `(("icu4c" ,icu4c) | ||
| 194 | ("librevenge" ,librevenge) | ||
| 195 | ("libxml2" ,libxml2))) | ||
| 196 | (inputs | ||
| 197 | `(("boost" ,boost))) | ||
| 198 | (arguments | ||
| 199 | ;; avoid triggering configure errors by simple inclusion of boost headers | ||
| 200 | `(#:configure-flags '("--disable-werror"))) | ||
| 201 | (home-page "http://libebook.sourceforge.net") | ||
| 202 | (synopsis "Library for import of reflowable e-book formats") | ||
| 203 | (description "Libe-book is a library and a set of tools for reading and | ||
| 204 | converting various reflowable e-book formats. Currently supported are: | ||
| 205 | Broad Band eBook, eReader .pdb, FictionBook v. 2 (including zipped files), | ||
| 206 | PalmDoc Ebook, Plucker .pdb, QiOO (mobile format, for java-enabled | ||
| 207 | cellphones), TCR (simple compressed text format), TealDoc, zTXT, | ||
| 208 | ZVR (simple compressed text format).") | ||
| 209 | (license mpl2.0))) | ||
| 210 | |||
| 211 | (define-public libwpg | ||
| 212 | (package | ||
| 213 | (name "libwpg") | ||
| 214 | (version "0.3.0") | ||
| 215 | (source | ||
| 216 | (origin | ||
| 217 | (method url-fetch) | ||
| 218 | (uri (string-append "mirror://sourceforge/libwpg/" name "/" name "-" | ||
| 219 | version ".tar.xz")) | ||
| 220 | (sha256 (base32 | ||
| 221 | "097jx8a638fwwfrzf6v29r1yhc34rq9526py7wf0ck2z4fcr2w3g")))) | ||
| 222 | (build-system gnu-build-system) | ||
| 223 | (native-inputs | ||
| 224 | `(("doxygen" ,doxygen) | ||
| 225 | ("pkg-config" ,pkg-config))) | ||
| 226 | (propagated-inputs | ||
| 227 | `(("libwpd" ,libwpd))) ; in Requires field of .pkg | ||
| 228 | (inputs | ||
| 229 | `(("perl" ,perl) | ||
| 230 | ("zlib" ,zlib))) | ||
| 231 | (home-page "http://libwpg.sourceforge.net/") | ||
| 232 | (synopsis "Library and tools for the WordPerfect Graphics format") | ||
| 233 | (description "The libwpg project provides a library and tools for | ||
| 234 | working with graphics in the WPG (WordPerfect Graphics) format.") | ||
| 235 | (license (list mpl2.0 lgpl2.1+)))) ;dual licensed | ||
| 236 | |||
| 237 | (define-public libcmis | ||
| 238 | (package | ||
| 239 | (name "libcmis") | ||
| 240 | (version "0.5.0") | ||
| 241 | (source | ||
| 242 | (origin | ||
| 243 | (method url-fetch) | ||
| 244 | (uri (string-append "mirror://sourceforge/" name "/" name "-" | ||
| 245 | version ".tar.gz")) | ||
| 246 | (sha256 (base32 | ||
| 247 | "1dprvk4fibylv24l7gr49gfqbkfgmxynvgssvdcycgpf7n8h4zm8")))) | ||
| 248 | (build-system gnu-build-system) | ||
| 249 | (native-inputs | ||
| 250 | `(("cppunit" ,cppunit) | ||
| 251 | ("pkg-config" ,pkg-config))) | ||
| 252 | (propagated-inputs ; in Requires field of .pkg | ||
| 253 | `(("curl" ,curl) | ||
| 254 | ("libxml2" ,libxml2))) | ||
| 255 | (inputs | ||
| 256 | `(("boost" ,boost) | ||
| 257 | ("cyrus-sasl" ,cyrus-sasl) | ||
| 258 | ("openssl" ,openssl))) | ||
| 259 | (arguments | ||
| 260 | `(#:configure-flags | ||
| 261 | (list | ||
| 262 | ;; FIXME: Man pages generation requires docbook-to-man; reenable | ||
| 263 | ;; it once this is available. | ||
| 264 | "--without-man" | ||
| 265 | ;; avoid triggering configure errors by simple inclusion of | ||
| 266 | ;; boost headers | ||
| 267 | "--disable-werror" | ||
| 268 | ;; During configure, the boost headers are found, but linking | ||
| 269 | ;; fails without the following flag. | ||
| 270 | (string-append "--with-boost=" | ||
| 271 | (assoc-ref %build-inputs "boost"))))) | ||
| 272 | (home-page "http://sourceforge.net/projects/libcmis/") | ||
| 273 | (synopsis "CMIS client library") | ||
| 274 | (description "LibCMIS is a C++ client library for the CMIS interface. It | ||
| 275 | allows C++ applications to connect to any ECM behaving as a CMIS server such | ||
| 276 | as Alfresco or Nuxeo.") | ||
| 277 | (license (list mpl1.1 gpl2+ lgpl2.1+)))) ; triple license | ||
| 278 | |||
| 279 | (define-public libabw | ||
| 280 | (package | ||
| 281 | (name "libabw") | ||
| 282 | (version "0.1.1") | ||
| 283 | (source | ||
| 284 | (origin | ||
| 285 | (method url-fetch) | ||
| 286 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 287 | name "-" version ".tar.xz")) | ||
| 288 | (sha256 (base32 | ||
| 289 | "0zi1zj4fpxgpglbbb5n1kg3dmhqq5rpf46lli89r5daavp19iing")))) | ||
| 290 | (build-system gnu-build-system) | ||
| 291 | (native-inputs | ||
| 292 | `(("doxygen" ,doxygen) | ||
| 293 | ("gperf" ,gperf) | ||
| 294 | ("perl" ,perl) | ||
| 295 | ("pkg-config" ,pkg-config))) | ||
| 296 | (propagated-inputs ; in Requires or Requires.private field of .pkg | ||
| 297 | `(("librevenge" ,librevenge) | ||
| 298 | ("libxml2" ,libxml2))) | ||
| 299 | (inputs | ||
| 300 | `(("boost" ,boost))) | ||
| 301 | (arguments | ||
| 302 | ;; avoid triggering configure errors by simple inclusion of boost headers | ||
| 303 | `(#:configure-flags '("--disable-werror"))) | ||
| 304 | (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libabw") | ||
| 305 | (synopsis "Library for parsing the AbiWord format") | ||
| 306 | (description "Libabw is a library that parses the file format of | ||
| 307 | AbiWord documents.") | ||
| 308 | (license mpl2.0))) | ||
| 309 | |||
| 310 | (define-public libcdr | ||
| 311 | (package | ||
| 312 | (name "libcdr") | ||
| 313 | (version "0.1.1") | ||
| 314 | (source | ||
| 315 | (origin | ||
| 316 | (method url-fetch) | ||
| 317 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 318 | name "-" version ".tar.xz")) | ||
| 319 | (sha256 (base32 | ||
| 320 | "07yzb1yr5kzv0binzj5swz3zzay2gw3xb0fbkc2zwdssgrkf19nh")))) | ||
| 321 | (build-system gnu-build-system) | ||
| 322 | (native-inputs | ||
| 323 | `(("doxygen" ,doxygen) | ||
| 324 | ("pkg-config" ,pkg-config))) | ||
| 325 | (propagated-inputs ; in Requires or Requires.private field of .pkg | ||
| 326 | `(("icu4c" ,icu4c) | ||
| 327 | ("lcms" ,lcms) | ||
| 328 | ("librevenge" ,librevenge) | ||
| 329 | ("zlib" ,zlib))) | ||
| 330 | (inputs | ||
| 331 | `(("boost" ,boost))) | ||
| 332 | (arguments | ||
| 333 | ;; avoid triggering a build failure due to warnings | ||
| 334 | `(#:configure-flags '("--disable-werror"))) | ||
| 335 | (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libcdr") | ||
| 336 | (synopsis "Library for parsing the CorelDRAW format") | ||
| 337 | (description "Libcdr is a library that parses the file format of | ||
| 338 | CorelDRAW documents of all versions.") | ||
| 339 | (license mpl2.0))) | ||
| 340 | |||
| 341 | (define-public libetonyek | ||
| 342 | (package | ||
| 343 | (name "libetonyek") | ||
| 344 | (version "0.1.1") | ||
| 345 | (source | ||
| 346 | (origin | ||
| 347 | (method url-fetch) | ||
| 348 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 349 | name "-" version ".tar.xz")) | ||
| 350 | (sha256 (base32 | ||
| 351 | "0gn8v24jb9r9kxppbws6xlc7knpd9mk2n9xjvziccv5f2l7mlslw")))) | ||
| 352 | (build-system gnu-build-system) | ||
| 353 | (native-inputs | ||
| 354 | `(("cppunit" ,cppunit) | ||
| 355 | ("doxygen" ,doxygen) | ||
| 356 | ("gperf" ,gperf) | ||
| 357 | ("pkg-config" ,pkg-config))) | ||
| 358 | (propagated-inputs ; in Requires or Requires.private field of .pkg | ||
| 359 | `(("librevenge" ,librevenge) | ||
| 360 | ("libxml2" ,libxml2))) | ||
| 361 | (inputs | ||
| 362 | `(("boost" ,boost))) | ||
| 363 | (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libetonyek") | ||
| 364 | (synopsis "Library for parsing the Apple Keynote format") | ||
| 365 | (description "Libetonyek is a library that parses the file format of | ||
| 366 | Apple Keynote documents. It currently supports Keynote versions 2 to 5.") | ||
| 367 | (license mpl2.0))) | ||
| 368 | |||
| 369 | (define-public libexttextcat | ||
| 370 | (package | ||
| 371 | (name "libexttextcat") | ||
| 372 | (version "3.4.4") | ||
| 373 | (source | ||
| 374 | (origin | ||
| 375 | (method url-fetch) | ||
| 376 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 377 | name "-" version ".tar.xz")) | ||
| 378 | (sha256 (base32 | ||
| 379 | "14v2hkygnmf1zgahfm1fha47cr67iikrz2ymiqi28d2jydn0hk7j")))) | ||
| 380 | (build-system gnu-build-system) | ||
| 381 | (home-page "http://www.freedesktop.org/wiki/Software/libexttextcat/") | ||
| 382 | (synopsis "Text Categorization library") | ||
| 383 | (description "Libexttextcat is an N-Gram-Based Text Categorization | ||
| 384 | library primarily intended for language guessing.") | ||
| 385 | (license (non-copyleft "file://LICENSE" | ||
| 386 | "See LICENSE in the distribution.")))) | ||
| 387 | |||
| 388 | (define-public libfreehand | ||
| 389 | (package | ||
| 390 | (name "libfreehand") | ||
| 391 | (version "0.1.0") | ||
| 392 | (source | ||
| 393 | (origin | ||
| 394 | (method url-fetch) | ||
| 395 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 396 | name "-" version ".tar.xz")) | ||
| 397 | (sha256 (base32 | ||
| 398 | "01j7mxi4lmf72w1mv2r098p8l0csdd94w2gq0ncp93djn34al6ai")))) | ||
| 399 | (build-system gnu-build-system) | ||
| 400 | (native-inputs | ||
| 401 | `(("doxygen" ,doxygen) | ||
| 402 | ("gperf" ,gperf) | ||
| 403 | ("perl" ,perl) | ||
| 404 | ("pkg-config" ,pkg-config))) | ||
| 405 | (propagated-inputs ; in Requires or Requires.private field of .pkg | ||
| 406 | `(("librevenge" ,librevenge) | ||
| 407 | ("zlib" ,zlib))) | ||
| 408 | (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libfreehand") | ||
| 409 | (synopsis "Library for parsing the FreeHand format") | ||
| 410 | (description "Libfreehand is a library that parses the file format of | ||
| 411 | Aldus/Macromedia/Adobe FreeHand documents.") | ||
| 412 | (license mpl2.0))) | ||
| 413 | |||
| 414 | (define-public libmspub | ||
| 415 | (package | ||
| 416 | (name "libmspub") | ||
| 417 | (version "0.1.2") | ||
| 418 | (source | ||
| 419 | (origin | ||
| 420 | (method url-fetch) | ||
| 421 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 422 | name "-" version ".tar.xz")) | ||
| 423 | (sha256 (base32 | ||
| 424 | "03sn6lxpr49sdq6j8q7fw7yjybyfahhs03z80388mh105pwapfmh")))) | ||
| 425 | (build-system gnu-build-system) | ||
| 426 | (native-inputs | ||
| 427 | `(("doxygen" ,doxygen) | ||
| 428 | ("pkg-config" ,pkg-config))) | ||
| 429 | (propagated-inputs ; in Requires or Requires.private field of .pkg | ||
| 430 | `(("icu4c" ,icu4c) | ||
| 431 | ("librevenge" ,librevenge) | ||
| 432 | ("zlib" ,zlib))) | ||
| 433 | (inputs | ||
| 434 | `(("boost" ,boost))) | ||
| 435 | (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libmspub") | ||
| 436 | (synopsis "Library for parsing the Microsoft Publisher format") | ||
| 437 | (description "Libmspub is a library that parses the file format of | ||
| 438 | Microsoft Publisher documents of all versions.") | ||
| 439 | (license mpl2.0))) | ||
| 440 | |||
| 441 | (define-public libpagemaker | ||
| 442 | (package | ||
| 443 | (name "libpagemaker") | ||
| 444 | (version "0.0.2") | ||
| 445 | (source | ||
| 446 | (origin | ||
| 447 | (method url-fetch) | ||
| 448 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 449 | name "-" version ".tar.xz")) | ||
| 450 | (sha256 (base32 | ||
| 451 | "05zgj5ngg9z4b7dnrfs59nm0macm99lzyxv4mg53jcvp0mkgigfd")))) | ||
| 452 | (build-system gnu-build-system) | ||
| 453 | (native-inputs | ||
| 454 | `(("doxygen" ,doxygen) | ||
| 455 | ("pkg-config" ,pkg-config))) | ||
| 456 | (propagated-inputs ; in Requires field of .pkg | ||
| 457 | `(("librevenge" ,librevenge))) | ||
| 458 | (inputs | ||
| 459 | `(("boost" ,boost) | ||
| 460 | ("zlib" ,zlib))) | ||
| 461 | (arguments | ||
| 462 | ;; avoid triggering a build failure due to warnings | ||
| 463 | `(#:configure-flags '("--disable-werror"))) | ||
| 464 | (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libpagemaker") | ||
| 465 | (synopsis "Library for parsing the PageMaker format") | ||
| 466 | (description "Libpagemaker is a library that parses the file format of | ||
| 467 | Aldus/Adobe PageMaker documents. Currently it only understands documents | ||
| 468 | created by PageMaker version 6.x and 7.") | ||
| 469 | (license mpl2.0))) | ||
| 470 | |||
| 471 | (define-public libvisio | ||
| 472 | (package | ||
| 473 | (name "libvisio") | ||
| 474 | ;; FIXME: The newer version 0.1.1 fails its tests. | ||
| 475 | (version "0.1.0") | ||
| 476 | (source | ||
| 477 | (origin | ||
| 478 | (method url-fetch) | ||
| 479 | (uri (string-append "http://dev-www.libreoffice.org/src/" name "/" | ||
| 480 | name "-" version ".tar.xz")) | ||
| 481 | (sha256 (base32 | ||
| 482 | "0vvd2wyp4rw6s9xnj1dc9vgdpfvm45gnb5b9hhzif0fdnx4iskqf")))) | ||
| 483 | (build-system gnu-build-system) | ||
| 484 | (native-inputs | ||
| 485 | `(("cppunit" ,cppunit) | ||
| 486 | ("doxygen" ,doxygen) | ||
| 487 | ("gperf" ,gperf) | ||
| 488 | ("perl" ,perl) | ||
| 489 | ("pkg-config" ,pkg-config))) | ||
| 490 | (propagated-inputs ; in Requires or Requires.private field of .pkg | ||
| 491 | `(("icu4c" ,icu4c) | ||
| 492 | ("librevenge" ,librevenge) | ||
| 493 | ("libxml2" ,libxml2))) | ||
| 494 | (inputs | ||
| 495 | `(("boost" ,boost))) | ||
| 496 | ;; FIXME: Not needed any more for newer version 0.1.1. | ||
| 497 | (arguments | ||
| 498 | ;; avoid triggering a build failure due to warnings | ||
| 499 | `(#:configure-flags '("--disable-werror"))) | ||
| 500 | (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libvisio") | ||
| 501 | (synopsis "Library for parsing the Microsoft Visio format") | ||
| 502 | (description "Libvisio is a library that parses the file format of | ||
| 503 | Microsoft Visio documents of all versions.") | ||
| 504 | (license mpl2.0))) | ||
| 505 | |||
| 506 | (define-public libodfgen | ||
| 507 | (package | ||
| 508 | (name "libodfgen") | ||
| 509 | (version "0.1.3") | ||
| 510 | (source | ||
| 511 | (origin | ||
| 512 | (method url-fetch) | ||
| 513 | (uri (string-append "http://dev-www.libreoffice.org/src/" | ||
| 514 | name "-" version ".tar.bz2")) | ||
| 515 | (sha256 (base32 | ||
| 516 | "074qsav86ixwi9zm1f77g9vxdf1ihm6n930vxjg8q3lwzd8g7lb6")))) | ||
| 517 | (build-system gnu-build-system) | ||
| 518 | (native-inputs | ||
| 519 | `(("doxygen" ,doxygen) | ||
| 520 | ("pkg-config" ,pkg-config))) | ||
| 521 | (propagated-inputs ; in Requires field of .pkg | ||
| 522 | `(("librevenge" ,librevenge))) | ||
| 523 | (inputs | ||
| 524 | `(("boost" ,boost) | ||
| 525 | ("zlib" ,zlib))) | ||
| 526 | (arguments | ||
| 527 | ;; avoid triggering configure errors by simple inclusion of boost headers | ||
| 528 | `(#:configure-flags '("--disable-werror"))) | ||
| 529 | (home-page "http://sourceforge.net/p/libwpd/wiki/libodfgen/") | ||
| 530 | (synopsis "ODF (Open Document Format) library") | ||
| 531 | (description "Libodfgen is a library for generating documents in the | ||
| 532 | Open Document Format (ODF). It provides generator implementations for all | ||
| 533 | document interfaces supported by librevenge: | ||
| 534 | text documents, vector drawings, presentations and spreadsheets.") | ||
| 535 | (license (list mpl2.0 lgpl2.1+)))) ; dual license | ||
| 536 | |||
| 537 | (define-public libmwaw | ||
| 538 | (package | ||
| 539 | (name "libmwaw") | ||
| 540 | (version "0.3.4") | ||
| 541 | (source | ||
| 542 | (origin | ||
| 543 | (method url-fetch) | ||
| 544 | (uri (string-append "mirror://sourceforge/" name "/" name "/" | ||
| 545 | name "-" version ".tar.xz")) | ||
| 546 | (sha256 (base32 | ||
| 547 | "1sn95flxrh85qjsg1kk700c1ggxaaccr9j1nnw7x4daw8lky25ac")))) | ||
| 548 | (build-system gnu-build-system) | ||
| 549 | (native-inputs | ||
| 550 | `(("doxygen" ,doxygen) | ||
| 551 | ("pkg-config" ,pkg-config))) | ||
| 552 | (propagated-inputs ; in Requires field of .pkg | ||
| 553 | `(("librevenge" ,librevenge))) | ||
| 554 | (inputs | ||
| 555 | `(("boost" ,boost) | ||
| 556 | ("zlib" ,zlib))) | ||
| 557 | (arguments | ||
| 558 | ;; avoid triggering configure errors by simple inclusion of boost headers | ||
| 559 | `(#:configure-flags '("--disable-werror"))) | ||
| 560 | (home-page "http://sourceforge.net/p/libmwaw/wiki/Home/") | ||
| 561 | (synopsis "Import library for some old Macintosh text documents") | ||
| 562 | (description "Libmwaw contains some import filters for old Macintosh | ||
| 563 | text documents (MacWrite, ClarisWorks, ... ) and for some graphics and | ||
| 564 | spreadsheet documents.") | ||
| 565 | (license (list mpl2.0 lgpl2.1+)))) ; dual license | ||
| 566 | |||
| 567 | (define-public libwps | ||
| 568 | (package | ||
| 569 | (name "libwps") | ||
| 570 | (version "0.3.1") | ||
| 571 | (source | ||
| 572 | (origin | ||
| 573 | (method url-fetch) | ||
| 574 | (uri (string-append "mirror://sourceforge/" name "/" name "/" | ||
| 575 | name "-" version ".tar.xz")) | ||
| 576 | (sha256 (base32 | ||
| 577 | "14wfhw1ahavhx4hrdzc4hdwxjlffrm939kswf2x1250jnmyjlb5v")))) | ||
| 578 | (build-system gnu-build-system) | ||
| 579 | (native-inputs | ||
| 580 | `(("doxygen" ,doxygen) | ||
| 581 | ("pkg-config" ,pkg-config))) | ||
| 582 | (propagated-inputs ; in Requires field of .pkg | ||
| 583 | `(("librevenge" ,librevenge))) | ||
| 584 | (inputs | ||
| 585 | `(("boost" ,boost) | ||
| 586 | ("zlib" ,zlib))) | ||
| 587 | (arguments | ||
| 588 | ;; avoid triggering configure errors by simple inclusion of boost headers | ||
| 589 | `(#:configure-flags '("--disable-werror"))) | ||
| 590 | (home-page "http://libwps.sourceforge.net/") | ||
| 591 | (synopsis "Import library for Microsoft Works text documents") | ||
| 592 | (description "Libwps is a library for importing files in the Microsoft | ||
| 593 | Works word processor file format.") | ||
| 594 | (license (list mpl2.0 lgpl2.1+)))) ; dual license | ||
| 595 | |||
| 596 | (define-public hunspell | ||
| 597 | (package | ||
| 598 | (name "hunspell") | ||
| 599 | (version "1.3.3") | ||
| 600 | (source | ||
| 601 | (origin | ||
| 602 | (method url-fetch) | ||
| 603 | (uri (string-append "mirror://sourceforge/" name "/" | ||
| 604 | name "-" version ".tar.gz")) | ||
| 605 | (sha256 (base32 | ||
| 606 | "0v14ff9s37vkh45diaddndcrj0hmn67arh8xh8k79q9c1vgc1cm7")))) | ||
| 607 | (build-system gnu-build-system) | ||
| 608 | (home-page "http://hunspell.sourceforge.net/") | ||
| 609 | (synopsis "Spell checker") | ||
| 610 | (description "Hunspell is a spell checker and morphological analyzer | ||
| 611 | library and program designed for languages with rich morphology and complex | ||
| 612 | word compounding or character encoding.") | ||
| 613 | ;; triple license, including "mpl1.1 or later" | ||
| 614 | (license (list mpl1.1 gpl2+ lgpl2.1+)))) | ||
| 615 | |||
| 616 | (define-public hyphen | ||
| 617 | (package | ||
| 618 | (name "hyphen") | ||
| 619 | (version "2.8.8") | ||
| 620 | (source | ||
| 621 | (origin | ||
| 622 | (method url-fetch) | ||
| 623 | (uri (string-append "mirror://sourceforge/hunspell/" | ||
| 624 | name "-" version ".tar.gz")) | ||
| 625 | (sha256 (base32 | ||
| 626 | "01ap9pr6zzzbp4ky0vy7i1983fwyqy27pl0ld55s30fdxka3ciih")))) | ||
| 627 | (build-system gnu-build-system) | ||
| 628 | (inputs | ||
| 629 | `(("perl" ,perl))) | ||
| 630 | (home-page "http://hunspell.sourceforge.net/") | ||
| 631 | (synopsis "Hyphenation library") | ||
| 632 | (description "Hyphen is a hyphenation library using TeX hyphenation | ||
| 633 | patterns, which are pre-processed by a perl script.") | ||
| 634 | ;; triple license, including "mpl1.1 or later" | ||
| 635 | (license (list mpl1.1 mpl2.0 gpl2+ lgpl2.1+)))) | ||
| 636 | |||
| 637 | (define-public mythes | ||
| 638 | (package | ||
| 639 | (name "mythes") | ||
| 640 | (version "1.2.4") | ||
| 641 | (source | ||
| 642 | (origin | ||
| 643 | (method url-fetch) | ||
| 644 | (uri (string-append "mirror://sourceforge/hunspell/" | ||
| 645 | name "-" version ".tar.gz")) | ||
| 646 | (sha256 (base32 | ||
| 647 | "0prh19wy1c74kmzkkavm9qslk99gz8h8wmjvwzjc6lf8v2az708y")))) | ||
| 648 | (build-system gnu-build-system) | ||
| 649 | (native-inputs | ||
| 650 | `(("pkg-config" ,pkg-config))) | ||
| 651 | (inputs | ||
| 652 | `(("hunspell" ,hunspell) | ||
| 653 | ("perl" ,perl))) | ||
| 654 | (home-page "http://hunspell.sourceforge.net/") | ||
| 655 | (synopsis "Thesaurus") | ||
| 656 | (description "MyThes is a simple thesaurus that uses a structured text | ||
| 657 | data file and an index file with binary search to look up words and phrases | ||
| 658 | and to return information on pronunciations, meaningss and synonyms.") | ||
| 659 | (license (non-copyleft "file://COPYING" | ||
| 660 | "See COPYING in the distribution.")))) | ||
| 661 | |||
| 662 | ;; LibreOffice requires an xmlsec source tarball; it does not even check | ||
| 663 | ;; for the presence of an externally compiled library. | ||
| 664 | (define xmlsec-src-libreoffice | ||
| 665 | (origin | ||
| 666 | (method url-fetch) | ||
| 667 | (uri | ||
| 668 | (string-append | ||
| 669 | "http://dev-www.libreoffice.org/src/" | ||
| 670 | "1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz")) | ||
| 671 | (sha256 (base32 | ||
| 672 | "0jnxxygg6z5zi6za94dvxmg1bfar1wh8p5xa2bzbha0qcn2m02ir")))) | ||
| 673 | |||
| 674 | (define-public libreoffice | ||
| 675 | (package | ||
| 676 | (name "libreoffice") | ||
| 677 | (version "4.4.3.2") | ||
| 678 | (source | ||
| 679 | (origin | ||
| 680 | (method url-fetch) | ||
| 681 | (uri | ||
| 682 | (string-append | ||
| 683 | "http://download.documentfoundation.org/libreoffice/src/" | ||
| 684 | (version-prefix version 3) "/libreoffice-" version ".tar.xz")) | ||
| 685 | (sha256 (base32 | ||
| 686 | "0rl9x01ngxwnqwzxkrqy4vks4rb024m75z0w4zidwyp0az0m8qdd")))) | ||
| 687 | (build-system gnu-build-system) | ||
| 688 | (native-inputs | ||
| 689 | `(;; autoreconf is run by the LibreOffice build system, since after | ||
| 690 | ;; unpacking the external xmlsec tarball, it applies a series of | ||
| 691 | ;; patches to Makefile.am, configure.in, config.guess and config.sub. | ||
| 692 | ("autoconf" ,autoconf) | ||
| 693 | ("automake" ,automake) | ||
| 694 | ("bison" ,bison) | ||
| 695 | ("cppunit" ,cppunit) | ||
| 696 | ("flex" ,flex) | ||
| 697 | ("pkg-config" ,pkg-config) | ||
| 698 | ("python" ,python) | ||
| 699 | ("which" ,which))) | ||
| 700 | (inputs | ||
| 701 | `(("bluez" ,bluez) | ||
| 702 | ("boost" ,boost) | ||
| 703 | ("clucene" ,clucene) | ||
| 704 | ("cups" ,cups) | ||
| 705 | ("dbus-glib" ,dbus-glib) | ||
| 706 | ("fontconfig" ,fontconfig) | ||
| 707 | ("gconf" ,gconf) | ||
| 708 | ("glew" ,glew) | ||
| 709 | ("glm" ,glm) | ||
| 710 | ("gperf" ,gperf) | ||
| 711 | ("graphite2" ,graphite2) | ||
| 712 | ("gst-plugins-base" ,gst-plugins-base) | ||
| 713 | ("gtk+" ,gtk+-2) | ||
| 714 | ("harfbuzz" ,harfbuzz) | ||
| 715 | ("hunspell" ,hunspell) | ||
| 716 | ("hyphen" ,hyphen) | ||
| 717 | ("libabw" ,libabw) | ||
| 718 | ("libcdr" ,libcdr) | ||
| 719 | ("libcmis" ,libcmis) | ||
| 720 | ("libjpeg" ,libjpeg) | ||
| 721 | ("libe-book" ,libe-book) | ||
| 722 | ("libetonyek" ,libetonyek) | ||
| 723 | ("libexttextcat" ,libexttextcat) | ||
| 724 | ("libfreehand" ,libfreehand) | ||
| 725 | ("libmspub" ,libmspub) | ||
| 726 | ("libmwaw" ,libmwaw) | ||
| 727 | ("libodfgen" ,libodfgen) | ||
| 728 | ("libpagemaker" ,libpagemaker) | ||
| 729 | ("libvisio" ,libvisio) | ||
| 730 | ("libwpg" ,libwpg) | ||
| 731 | ("libwps" ,libwps) | ||
| 732 | ("libxrandr" ,libxrandr) | ||
| 733 | ("libxrender" ,libxrender) | ||
| 734 | ("libxslt" ,libxslt) | ||
| 735 | ("libxt" ,libxt) | ||
| 736 | ("lpsolve" ,lpsolve) | ||
| 737 | ("mdds" ,mdds) | ||
| 738 | ("mythes" ,mythes) | ||
| 739 | ("neon" ,neon) | ||
| 740 | ("nspr" ,nspr) | ||
| 741 | ("nss" ,nss) | ||
| 742 | ("openldap" ,openldap) | ||
| 743 | ("openssl" ,openssl) | ||
| 744 | ("orcus" ,orcus) | ||
| 745 | ("perl" ,perl) | ||
| 746 | ("perl-zip" ,perl-zip) | ||
| 747 | ("poppler" ,poppler) | ||
| 748 | ("postgresql" ,postgresql) | ||
| 749 | ("python" ,python) | ||
| 750 | ("redland" ,redland) | ||
| 751 | ("sane-backends" ,sane-backends) | ||
| 752 | ("unixodbc" ,unixodbc) | ||
| 753 | ("unzip" ,unzip) | ||
| 754 | ("vigra" ,vigra) | ||
| 755 | ("xmlsec-src" ,xmlsec-src-libreoffice) | ||
| 756 | ("zip" ,zip))) | ||
| 757 | (arguments | ||
| 758 | `(#:parallel-build? #f ; Otherwise the build fails. | ||
| 759 | #:tests? #f ; Building the tests already fails. | ||
| 760 | #:make-flags '("build-nocheck") ; Do not build unit tests, which fails. | ||
| 761 | #:phases | ||
| 762 | (modify-phases %standard-phases | ||
| 763 | (add-before 'configure 'prepare-src | ||
| 764 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 765 | (let ((xmlsec (assoc-ref inputs "xmlsec-src"))) | ||
| 766 | (substitute* | ||
| 767 | (list "sysui/CustomTarget_share.mk" | ||
| 768 | "solenv/gbuild/gbuild.mk" | ||
| 769 | "solenv/gbuild/platform/unxgcc.mk" | ||
| 770 | "external/libxmlsec/xmlsec1-oldlibtool.patch") | ||
| 771 | (("/bin/sh") (which "bash"))) | ||
| 772 | (mkdir "external/tarballs") | ||
| 773 | (symlink | ||
| 774 | xmlsec | ||
| 775 | (string-append "external/tarballs/" | ||
| 776 | "1f24ab1d39f4a51faf22244c94a6203f-" | ||
| 777 | "xmlsec1-1.2.14.tar.gz")) | ||
| 778 | ;; The following is required for building xmlsec from the | ||
| 779 | ;; unpatched external tarball; since "configure" starts with | ||
| 780 | ;; "/bin/sh", it needs to be executed by a command invoking | ||
| 781 | ;; the shell. | ||
| 782 | (setenv "SHELL" (which "bash")) | ||
| 783 | (setenv "CONFIG_SHELL" (which "bash")) | ||
| 784 | (substitute* "external/libxmlsec/ExternalProject_xmlsec.mk" | ||
| 785 | (("./configure") "$(CONFIG_SHELL) ./configure" )) | ||
| 786 | #t))) | ||
| 787 | (add-after 'install 'bin-install | ||
| 788 | ;; Create a symlink bin/soffice to the executable script. | ||
| 789 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 790 | (let* ((out (assoc-ref outputs "out")) | ||
| 791 | (bin (string-append out "/bin"))) | ||
| 792 | (mkdir bin) | ||
| 793 | (symlink | ||
| 794 | (string-append out "/lib/libreoffice/program/soffice") | ||
| 795 | (string-append bin "/soffice"))) | ||
| 796 | #t))) | ||
| 797 | #:configure-flags | ||
| 798 | (list | ||
| 799 | "--enable-release-build" | ||
| 800 | "--enable-verbose" | ||
| 801 | "--without-parallelism" ; otherwise the build fails | ||
| 802 | "--disable-fetch-external" ; disable downloads | ||
| 803 | "--with-system-libs" ; enable all --with-system-* flags | ||
| 804 | (string-append "--with-boost-libdir=" | ||
| 805 | (assoc-ref %build-inputs "boost") "/lib") | ||
| 806 | ;; Avoid a dependency on ucpp. | ||
| 807 | "--with-idlc-cpp=cpp" | ||
| 808 | ;; The fonts require an external tarball (crosextrafonts). | ||
| 809 | ;; They should not be needed when system fonts are available. | ||
| 810 | "--without-fonts" | ||
| 811 | ;; With java, the build fails since sac.jar is missing. | ||
| 812 | "--without-java" | ||
| 813 | ;; FIXME: Enable once the corresponding inputs are packaged. | ||
| 814 | "--without-system-npapi-headers" | ||
| 815 | "--disable-coinmp" | ||
| 816 | "--disable-firebird-sdbc" ; embedded firebird | ||
| 817 | "--disable-gltf" | ||
| 818 | "--disable-liblangtag"))) | ||
| 819 | (home-page "https://www.libreoffice.org/") | ||
| 820 | (synopsis "Office suite") | ||
| 821 | (description "LibreOffice is a comprehensive office suite. It contains | ||
| 822 | a number of components: Writer, a word processor; Calc, a spreadsheet | ||
| 823 | application; Impress, a presentation engine; Draw, a drawing and | ||
| 824 | flowcharting application; Base, a database and database frontend; | ||
| 825 | Math for editing mathematics.") | ||
| 826 | (license mpl2.0))) | ||
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 62eb753d240..dd8a2ff23be 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm | |||
| @@ -24,12 +24,13 @@ | |||
| 24 | #:use-module (guix download) | 24 | #:use-module (guix download) |
| 25 | #:use-module (guix build-system gnu) | 25 | #:use-module (guix build-system gnu) |
| 26 | #:use-module (gnu packages gnupg) | 26 | #:use-module (gnu packages gnupg) |
| 27 | #:use-module (gnu packages linux) | ||
| 27 | #:use-module (gnu packages pkg-config)) | 28 | #:use-module (gnu packages pkg-config)) |
| 28 | 29 | ||
| 29 | (define-public libusb | 30 | (define-public libusb |
| 30 | (package | 31 | (package |
| 31 | (name "libusb") | 32 | (name "libusb") |
| 32 | (version "1.0.9") | 33 | (version "1.0.19") |
| 33 | (source | 34 | (source |
| 34 | (origin | 35 | (origin |
| 35 | (method url-fetch) | 36 | (method url-fetch) |
| @@ -37,8 +38,14 @@ | |||
| 37 | "libusb-" version "/libusb-" version ".tar.bz2")) | 38 | "libusb-" version "/libusb-" version ".tar.bz2")) |
| 38 | (sha256 | 39 | (sha256 |
| 39 | (base32 | 40 | (base32 |
| 40 | "16sz34ix6hw2wwl3kqx6rf26fg210iryr68wc439dc065pffw879")))) | 41 | "0h38p9rxfpg9vkrbyb120i1diq57qcln82h5fr7hvy82c20jql3c")))) |
| 41 | (build-system gnu-build-system) | 42 | (build-system gnu-build-system) |
| 43 | |||
| 44 | ;; XXX: Enabling udev is now recommended, but eudev indirectly depends on | ||
| 45 | ;; libusb. | ||
| 46 | (arguments `(#:configure-flags '("--disable-udev"))) | ||
| 47 | ;; (inputs `(("eudev" ,eudev))) | ||
| 48 | |||
| 42 | (home-page "http://www.libusb.org") | 49 | (home-page "http://www.libusb.org") |
| 43 | (synopsis "User-space USB library") | 50 | (synopsis "User-space USB library") |
| 44 | (description | 51 | (description |
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 262c5bdb341..1b220c4e32a 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> | 3 | ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr> |
| 4 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> | 4 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
| 5 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> | 5 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
| 6 | ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> | 6 | ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> |
| @@ -55,6 +55,8 @@ | |||
| 55 | #:use-module (gnu packages gtk) | 55 | #:use-module (gnu packages gtk) |
| 56 | #:use-module (gnu packages docbook) | 56 | #:use-module (gnu packages docbook) |
| 57 | #:use-module (gnu packages asciidoc) | 57 | #:use-module (gnu packages asciidoc) |
| 58 | #:use-module (gnu packages readline) | ||
| 59 | #:use-module (gnu packages calendar) | ||
| 58 | #:use-module (guix packages) | 60 | #:use-module (guix packages) |
| 59 | #:use-module (guix download) | 61 | #:use-module (guix download) |
| 60 | #:use-module (guix utils) | 62 | #:use-module (guix utils) |
| @@ -208,7 +210,7 @@ for SYSTEM, or #f if there is no configuration for SYSTEM." | |||
| 208 | #f))) | 210 | #f))) |
| 209 | 211 | ||
| 210 | (define-public linux-libre | 212 | (define-public linux-libre |
| 211 | (let* ((version "4.0") | 213 | (let* ((version "4.0.5") |
| 212 | (build-phase | 214 | (build-phase |
| 213 | '(lambda* (#:key system inputs #:allow-other-keys #:rest args) | 215 | '(lambda* (#:key system inputs #:allow-other-keys #:rest args) |
| 214 | ;; Apply the neat patch. | 216 | ;; Apply the neat patch. |
| @@ -281,9 +283,7 @@ for SYSTEM, or #f if there is no configuration for SYSTEM." | |||
| 281 | (uri (linux-libre-urls version)) | 283 | (uri (linux-libre-urls version)) |
| 282 | (sha256 | 284 | (sha256 |
| 283 | (base32 | 285 | (base32 |
| 284 | "12nkzn1n4si2zcp10b645qri83m2y7iwp29vs2rjmy612azdab8f")) | 286 | "0g8a4h8gjw51pp02hjfrp6bk2nkrclm3krp9mpjh3iwbf4vfh2al")))) |
| 285 | (patches | ||
| 286 | (list (search-patch "linux-libre-libreboot-fix.patch"))))) | ||
| 287 | (build-system gnu-build-system) | 287 | (build-system gnu-build-system) |
| 288 | (native-inputs `(("perl" ,perl) | 288 | (native-inputs `(("perl" ,perl) |
| 289 | ("bc" ,bc) | 289 | ("bc" ,bc) |
| @@ -318,7 +318,7 @@ It has been modified to remove all non-free binary blobs.") | |||
| 318 | (license gpl2) | 318 | (license gpl2) |
| 319 | (home-page "http://www.gnu.org/software/linux-libre/")))) | 319 | (home-page "http://www.gnu.org/software/linux-libre/")))) |
| 320 | 320 | ||
| 321 | 321 | ||
| 322 | ;;; | 322 | ;;; |
| 323 | ;;; Pluggable authentication modules (PAM). | 323 | ;;; Pluggable authentication modules (PAM). |
| 324 | ;;; | 324 | ;;; |
| @@ -364,7 +364,7 @@ be used through the PAM API to perform tasks, like authenticating a user | |||
| 364 | at login. Local and dynamic reconfiguration are its key features") | 364 | at login. Local and dynamic reconfiguration are its key features") |
| 365 | (license bsd-3))) | 365 | (license bsd-3))) |
| 366 | 366 | ||
| 367 | 367 | ||
| 368 | ;;; | 368 | ;;; |
| 369 | ;;; Miscellaneous. | 369 | ;;; Miscellaneous. |
| 370 | ;;; | 370 | ;;; |
| @@ -587,8 +587,21 @@ slabtop, and skill.") | |||
| 587 | (string-append "#!" (which "sh"))))) | 587 | (string-append "#!" (which "sh"))))) |
| 588 | (alist-cons-after | 588 | (alist-cons-after |
| 589 | 'install 'install-libs | 589 | 'install 'install-libs |
| 590 | (lambda _ | 590 | (lambda* (#:key outputs #:allow-other-keys) |
| 591 | (zero? (system* "make" "install-libs"))) | 591 | (let* ((out (assoc-ref outputs "out")) |
| 592 | (lib (string-append out "/lib"))) | ||
| 593 | (and (zero? (system* "make" "install-libs")) | ||
| 594 | |||
| 595 | ;; Make the .a writable so that 'strip' works. | ||
| 596 | ;; Failing to do that, due to debug symbols, we | ||
| 597 | ;; retain a reference to the final | ||
| 598 | ;; linux-libre-headers, which refer to the | ||
| 599 | ;; bootstrap binaries. | ||
| 600 | (let ((archives (find-files lib "\\.a$"))) | ||
| 601 | (for-each (lambda (file) | ||
| 602 | (chmod file #o666)) | ||
| 603 | archives) | ||
| 604 | #t)))) | ||
| 592 | %standard-phases)) | 605 | %standard-phases)) |
| 593 | 606 | ||
| 594 | ;; FIXME: Tests work by comparing the stdout/stderr of programs, that | 607 | ;; FIXME: Tests work by comparing the stdout/stderr of programs, that |
| @@ -1041,6 +1054,17 @@ Linux-based operating systems.") | |||
| 1041 | '(#:phases (alist-cons-after | 1054 | '(#:phases (alist-cons-after |
| 1042 | 'unpack 'bootstrap | 1055 | 'unpack 'bootstrap |
| 1043 | (lambda _ | 1056 | (lambda _ |
| 1057 | ;; Fix "field ‘ip6’ has incomplete type" errors. | ||
| 1058 | (substitute* "libbridge/libbridge.h" | ||
| 1059 | (("#include <linux/if_bridge.h>") | ||
| 1060 | "#include <linux/in6.h>\n#include <linux/if_bridge.h>")) | ||
| 1061 | |||
| 1062 | ;; Ensure that the entire build fails if one of the | ||
| 1063 | ;; sub-Makefiles fails. | ||
| 1064 | (substitute* "Makefile.in" | ||
| 1065 | (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;") | ||
| 1066 | "$(MAKE) $(MFLAGS) -C $$x || exit 1;")) | ||
| 1067 | |||
| 1044 | (zero? (system* "autoreconf" "-vf"))) | 1068 | (zero? (system* "autoreconf" "-vf"))) |
| 1045 | %standard-phases) | 1069 | %standard-phases) |
| 1046 | #:tests? #f)) ; no 'check' target | 1070 | #:tests? #f)) ; no 'check' target |
| @@ -1198,7 +1222,8 @@ processes currently causing I/O.") | |||
| 1198 | version ".tar.gz")) | 1222 | version ".tar.gz")) |
| 1199 | (sha256 | 1223 | (sha256 |
| 1200 | (base32 | 1224 | (base32 |
| 1201 | "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb")))) | 1225 | "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb")) |
| 1226 | (patches (list (search-patch "fuse-CVE-2015-3202.patch"))))) | ||
| 1202 | (build-system gnu-build-system) | 1227 | (build-system gnu-build-system) |
| 1203 | (inputs `(("util-linux" ,util-linux))) | 1228 | (inputs `(("util-linux" ,util-linux))) |
| 1204 | (arguments | 1229 | (arguments |
| @@ -1567,7 +1592,7 @@ from the module-init-tools project.") | |||
| 1567 | ;; Work around undefined reference to | 1592 | ;; Work around undefined reference to |
| 1568 | ;; 'mq_getattr' in sc-daemon.c. | 1593 | ;; 'mq_getattr' in sc-daemon.c. |
| 1569 | "LDFLAGS=-lrt") | 1594 | "LDFLAGS=-lrt") |
| 1570 | #:phases | 1595 | #:phases |
| 1571 | (alist-cons-before | 1596 | (alist-cons-before |
| 1572 | 'build 'pre-build | 1597 | 'build 'pre-build |
| 1573 | ;; The program 'g-ir-scanner' (part of the package | 1598 | ;; The program 'g-ir-scanner' (part of the package |
| @@ -2171,3 +2196,40 @@ arrays when needed.") | |||
| 2171 | system calls, important for the performance of databases and other advanced | 2196 | system calls, important for the performance of databases and other advanced |
| 2172 | applications.") | 2197 | applications.") |
| 2173 | (license lgpl2.1+))) | 2198 | (license lgpl2.1+))) |
| 2199 | |||
| 2200 | (define-public bluez | ||
| 2201 | (package | ||
| 2202 | (name "bluez") | ||
| 2203 | (version "5.30") | ||
| 2204 | (source (origin | ||
| 2205 | (method url-fetch) | ||
| 2206 | (uri (string-append | ||
| 2207 | "https://www.kernel.org/pub/linux/bluetooth/bluez-" | ||
| 2208 | version ".tar.xz")) | ||
| 2209 | (sha256 | ||
| 2210 | (base32 | ||
| 2211 | "0b1qbnq1xzcdw5rajg9yyg31bf21jnff0n6gnf1snz89bbdllfhy")))) | ||
| 2212 | (build-system gnu-build-system) | ||
| 2213 | (arguments | ||
| 2214 | '(#:configure-flags | ||
| 2215 | (let ((out (assoc-ref %outputs "out"))) | ||
| 2216 | (list "--enable-library" | ||
| 2217 | "--disable-systemd" | ||
| 2218 | ;; Install dbus/udev files to the correct location. | ||
| 2219 | (string-append "--with-dbusconfdir=" out "/etc") | ||
| 2220 | (string-append "--with-udevdir=" out "/lib/udev"))))) | ||
| 2221 | (native-inputs | ||
| 2222 | `(("pkg-config" ,pkg-config) | ||
| 2223 | ("gettext" ,gnu-gettext))) | ||
| 2224 | (inputs | ||
| 2225 | `(("glib" ,glib) | ||
| 2226 | ("dbus" ,dbus) | ||
| 2227 | ("eudev" ,eudev) | ||
| 2228 | ("libical" ,libical) | ||
| 2229 | ("readline" ,readline))) | ||
| 2230 | (home-page "http://www.bluez.org/") | ||
| 2231 | (synopsis "Linux Bluetooth protocol stack") | ||
| 2232 | (description | ||
| 2233 | "BlueZ provides support for the core Bluetooth layers and protocols. It | ||
| 2234 | is flexible, efficient and uses a modular implementation.") | ||
| 2235 | (license gpl2+))) | ||
diff --git a/gnu/packages/m4.scm b/gnu/packages/m4.scm index b3b3a00fdeb..d1ba928768f 100644 --- a/gnu/packages/m4.scm +++ b/gnu/packages/m4.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -36,11 +36,10 @@ | |||
| 36 | "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf")))) | 36 | "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf")))) |
| 37 | (build-system gnu-build-system) | 37 | (build-system gnu-build-system) |
| 38 | (arguments | 38 | (arguments |
| 39 | ;; XXX: Disable tests on those platforms with know issues. | 39 | `(;; Explicitly disable tests when cross-compiling, otherwise 'make check' |
| 40 | `(#:tests? ,(not (member (%current-system) | 40 | ;; proceeds and fails, unsurprisingly. |
| 41 | '("x86_64-darwin" | 41 | #:tests? ,(not (%current-target-system)) |
| 42 | "i686-cygwin" | 42 | |
| 43 | "i686-sunos"))) | ||
| 44 | #:phases (alist-cons-before | 43 | #:phases (alist-cons-before |
| 45 | 'check 'pre-check | 44 | 'check 'pre-check |
| 46 | (lambda* (#:key inputs #:allow-other-keys) | 45 | (lambda* (#:key inputs #:allow-other-keys) |
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 170fbe49210..70b0b0298d2 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> | 7 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
| 8 | ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> | 8 | ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> |
| 9 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> | 9 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> |
| 10 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | ||
| 10 | ;;; | 11 | ;;; |
| 11 | ;;; This file is part of GNU Guix. | 12 | ;;; This file is part of GNU Guix. |
| 12 | ;;; | 13 | ;;; |
| @@ -66,7 +67,8 @@ | |||
| 66 | #:use-module (gnu packages xml) | 67 | #:use-module (gnu packages xml) |
| 67 | #:use-module (gnu packages xorg) | 68 | #:use-module (gnu packages xorg) |
| 68 | #:use-module ((guix licenses) | 69 | #:use-module ((guix licenses) |
| 69 | #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ lgpl3+ non-copyleft)) | 70 | #:select (gpl2 gpl2+ gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ non-copyleft |
| 71 | (expat . license:expat))) | ||
| 70 | #:use-module (guix packages) | 72 | #:use-module (guix packages) |
| 71 | #:use-module (guix download) | 73 | #:use-module (guix download) |
| 72 | #:use-module (guix utils) | 74 | #:use-module (guix utils) |
| @@ -492,7 +494,6 @@ MailCore 2.") | |||
| 492 | (inputs `(("bogofilter" ,bogofilter) | 494 | (inputs `(("bogofilter" ,bogofilter) |
| 493 | ("curl" ,curl) | 495 | ("curl" ,curl) |
| 494 | ("dbus-glib" ,dbus-glib) | 496 | ("dbus-glib" ,dbus-glib) |
| 495 | ("dbus" ,dbus) | ||
| 496 | ("enchant" ,enchant) | 497 | ("enchant" ,enchant) |
| 497 | ("expat" ,expat) | 498 | ("expat" ,expat) |
| 498 | ("ghostscript" ,ghostscript) | 499 | ("ghostscript" ,ghostscript) |
| @@ -639,6 +640,49 @@ deal of flexibility in the way mail can be routed, and there are extensive | |||
| 639 | facilities for checking incoming mail.") | 640 | facilities for checking incoming mail.") |
| 640 | (license gpl2+))) | 641 | (license gpl2+))) |
| 641 | 642 | ||
| 643 | (define-public dovecot | ||
| 644 | (package | ||
| 645 | (name "dovecot") | ||
| 646 | (version "2.2.16") | ||
| 647 | (source | ||
| 648 | (origin | ||
| 649 | (method url-fetch) | ||
| 650 | (uri (string-append "http://www.dovecot.org/releases/" | ||
| 651 | (version-major+minor version) "/" | ||
| 652 | name "-" version ".tar.gz")) | ||
| 653 | (sha256 (base32 | ||
| 654 | "1w6gg4h9mxg3i8faqpmgj19imzyy001b0v8ihch8ma3zl63i5kjn")))) | ||
| 655 | (build-system gnu-build-system) | ||
| 656 | (native-inputs | ||
| 657 | `(("pkg-config" ,pkg-config))) | ||
| 658 | (inputs | ||
| 659 | `(("openssl" ,openssl) | ||
| 660 | ("zlib" ,zlib) | ||
| 661 | ("bzip2" ,bzip2) | ||
| 662 | ("sqlite" ,sqlite))) | ||
| 663 | (arguments | ||
| 664 | `(#:configure-flags '("--sysconfdir=/etc" | ||
| 665 | "--localstatedir=/var") | ||
| 666 | #:phases (modify-phases %standard-phases | ||
| 667 | (add-before | ||
| 668 | 'configure 'pre-configure | ||
| 669 | (lambda _ | ||
| 670 | ;; Simple hack to avoid installing in /etc | ||
| 671 | (substitute* '("doc/Makefile.in" | ||
| 672 | "doc/example-config/Makefile.in") | ||
| 673 | (("pkgsysconfdir = .*") | ||
| 674 | "pkgsysconfdir = /tmp/etc")) | ||
| 675 | #t))))) | ||
| 676 | (home-page "http://www.dovecot.org") | ||
| 677 | (synopsis "Secure POP3/IMAP server") | ||
| 678 | (description | ||
| 679 | "Dovecot is a mail server whose major goals are security and reliability. | ||
| 680 | It supports mbox/Maildir and its own dbox/mdbox formats.") | ||
| 681 | ;; Most source files are covered by either lgpl2.1 or expat. The SHA code | ||
| 682 | ;; is covered by a variant of BSD-3, and UnicodeData.txt is covered by the | ||
| 683 | ;; Unicode, Inc. License Agreement for Data Files and Software. | ||
| 684 | (license (list lgpl2.1 license:expat (non-copyleft "file://COPYING"))))) | ||
| 685 | |||
| 642 | (define-public isync | 686 | (define-public isync |
| 643 | (package | 687 | (package |
| 644 | (name "isync") | 688 | (name "isync") |
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm index a92c6dd1321..fb43db9de9e 100644 --- a/gnu/packages/man.scm +++ b/gnu/packages/man.scm | |||
| @@ -153,7 +153,7 @@ Linux kernel and C library interfaces employed by user-space programs.") | |||
| 153 | (define-public help2man | 153 | (define-public help2man |
| 154 | (package | 154 | (package |
| 155 | (name "help2man") | 155 | (name "help2man") |
| 156 | (version "1.46.5") | 156 | (version "1.46.6") |
| 157 | (source | 157 | (source |
| 158 | (origin | 158 | (origin |
| 159 | (method url-fetch) | 159 | (method url-fetch) |
| @@ -161,7 +161,7 @@ Linux kernel and C library interfaces employed by user-space programs.") | |||
| 161 | version ".tar.xz")) | 161 | version ".tar.xz")) |
| 162 | (sha256 | 162 | (sha256 |
| 163 | (base32 | 163 | (base32 |
| 164 | "1gqfqgxq3qgwnldjz3i5mxvzyx2w3j042r3fw1wygic3f6327nha")))) | 164 | "1brccgnjf09f2zg70s6gv6gn68mi59kp3zf50wvxp79n72ngapv1")))) |
| 165 | (build-system gnu-build-system) | 165 | (build-system gnu-build-system) |
| 166 | (arguments `(;; There's no `check' target. | 166 | (arguments `(;; There's no `check' target. |
| 167 | #:tests? #f)) | 167 | #:tests? #f)) |
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 417af4a91bc..4d837c85e29 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org> | 7 | ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org> |
| 8 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | 8 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
| 9 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> | 9 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
| 10 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | ||
| 10 | ;;; | 11 | ;;; |
| 11 | ;;; This file is part of GNU Guix. | 12 | ;;; This file is part of GNU Guix. |
| 12 | ;;; | 13 | ;;; |
| @@ -68,6 +69,7 @@ | |||
| 68 | #:use-module (gnu packages tcl) | 69 | #:use-module (gnu packages tcl) |
| 69 | #:use-module (gnu packages texinfo) | 70 | #:use-module (gnu packages texinfo) |
| 70 | #:use-module (gnu packages texlive) | 71 | #:use-module (gnu packages texlive) |
| 72 | #:use-module (gnu packages wxwidgets) | ||
| 71 | #:use-module (gnu packages xml) | 73 | #:use-module (gnu packages xml) |
| 72 | #:use-module (gnu packages zip)) | 74 | #:use-module (gnu packages zip)) |
| 73 | 75 | ||
| @@ -382,6 +384,9 @@ extremely large and complex data collections.") | |||
| 382 | `(("lapack" ,lapack) | 384 | `(("lapack" ,lapack) |
| 383 | ("readline" ,readline) | 385 | ("readline" ,readline) |
| 384 | ("glpk" ,glpk) | 386 | ("glpk" ,glpk) |
| 387 | ("fftw" ,fftw) | ||
| 388 | ("fftwf" ,fftwf) | ||
| 389 | ("arpack" ,arpack-ng) | ||
| 385 | ("curl" ,curl) | 390 | ("curl" ,curl) |
| 386 | ("pcre" ,pcre) | 391 | ("pcre" ,pcre) |
| 387 | ("fltk" ,fltk) | 392 | ("fltk" ,fltk) |
| @@ -390,16 +395,18 @@ extremely large and complex data collections.") | |||
| 390 | ("hdf5" ,hdf5) | 395 | ("hdf5" ,hdf5) |
| 391 | ("libxft" ,libxft) | 396 | ("libxft" ,libxft) |
| 392 | ("mesa" ,mesa) | 397 | ("mesa" ,mesa) |
| 398 | ("glu" ,glu) | ||
| 393 | ("zlib" ,zlib))) | 399 | ("zlib" ,zlib))) |
| 394 | (native-inputs | 400 | (native-inputs |
| 395 | `(("gfortran" ,gfortran-4.8) | 401 | `(("gfortran" ,gfortran-4.8) |
| 396 | ("pkg-config" ,pkg-config) | 402 | ("pkg-config" ,pkg-config) |
| 397 | ("perl" ,perl) | 403 | ("perl" ,perl) |
| 398 | ;; The following inputs are not actually used in the build process. However, the | 404 | ;; The following inputs are not actually used in the build process. |
| 399 | ;; ./configure gratuitously tests for their existence and assumes that programs not | 405 | ;; However, the ./configure gratuitously tests for their existence and |
| 400 | ;; present at build time are also not, and can never be, available at run time! | 406 | ;; assumes that programs not present at build time are also not, and |
| 401 | ;; If these inputs are therefore not present, support for them will be built out. | 407 | ;; can never be, available at run time! If these inputs are therefore |
| 402 | ;; However, Octave will still run without them, albeit without the features they | 408 | ;; not present, support for them will be built out. However, Octave |
| 409 | ;; will still run without them, albeit without the features they | ||
| 403 | ;; provide. | 410 | ;; provide. |
| 404 | ("less" ,less) | 411 | ("less" ,less) |
| 405 | ("texinfo" ,texinfo) | 412 | ("texinfo" ,texinfo) |
| @@ -411,11 +418,11 @@ extremely large and complex data collections.") | |||
| 411 | "/bin/sh")))) | 418 | "/bin/sh")))) |
| 412 | (home-page "http://www.gnu.org/software/octave/") | 419 | (home-page "http://www.gnu.org/software/octave/") |
| 413 | (synopsis "High-level language for numerical computation") | 420 | (synopsis "High-level language for numerical computation") |
| 414 | (description "GNU Octave is a high-level interpreted language that is specialized | 421 | (description "GNU Octave is a high-level interpreted language that is |
| 415 | for numerical computations. It can be used for both linear and non-linear | 422 | specialized for numerical computations. It can be used for both linear and |
| 416 | applications and it provides great support for visualizing results. Work may | 423 | non-linear applications and it provides great support for visualizing results. |
| 417 | be performed both at the interactive command-line as well as via script | 424 | Work may be performed both at the interactive command-line as well as via |
| 418 | files.") | 425 | script files.") |
| 419 | (license license:gpl3+))) | 426 | (license license:gpl3+))) |
| 420 | 427 | ||
| 421 | (define-public gmsh | 428 | (define-public gmsh |
| @@ -917,7 +924,7 @@ to BMP, JPEG or PNG image formats.") | |||
| 917 | (define-public maxima | 924 | (define-public maxima |
| 918 | (package | 925 | (package |
| 919 | (name "maxima") | 926 | (name "maxima") |
| 920 | (version "5.34.1") | 927 | (version "5.36.1") |
| 921 | (source | 928 | (source |
| 922 | (origin | 929 | (origin |
| 923 | (method url-fetch) | 930 | (method url-fetch) |
| @@ -925,7 +932,8 @@ to BMP, JPEG or PNG image formats.") | |||
| 925 | version "-source/" name "-" version ".tar.gz")) | 932 | version "-source/" name "-" version ".tar.gz")) |
| 926 | (sha256 | 933 | (sha256 |
| 927 | (base32 | 934 | (base32 |
| 928 | "1dw9vfzldpj7lv303xbw0wpyn6ra6i2yzwlrjbcx7j0jm5n43ji0")))) | 935 | "0x1rk659sn3cq0n5c90848ilzr1gb1wf0072fl6jhkdq00qgh2s0")) |
| 936 | (patches (list (search-patch "maxima-defsystem-mkdir.patch"))))) | ||
| 929 | (build-system gnu-build-system) | 937 | (build-system gnu-build-system) |
| 930 | (inputs | 938 | (inputs |
| 931 | `(("gcl" ,gcl) | 939 | `(("gcl" ,gcl) |
| @@ -946,8 +954,8 @@ to BMP, JPEG or PNG image formats.") | |||
| 946 | (let ((v ,(package-version tk))) | 954 | (let ((v ,(package-version tk))) |
| 947 | (string-take v (string-index-right v #\.))))) | 955 | (string-take v (string-index-right v #\.))))) |
| 948 | ;; By default Maxima attempts to write temporary files to | 956 | ;; By default Maxima attempts to write temporary files to |
| 949 | ;; '/tmp/nix-build-maxima-5.34.1', which doesn't exist. Work around | 957 | ;; '/tmp/nix-build-maxima-*', which won't exist at run time. |
| 950 | ;; that. | 958 | ;; Work around that. |
| 951 | #:make-flags (list "TMPDIR=/tmp") | 959 | #:make-flags (list "TMPDIR=/tmp") |
| 952 | #:phases (alist-cons-before | 960 | #:phases (alist-cons-before |
| 953 | 'check 'pre-check | 961 | 'check 'pre-check |
| @@ -992,6 +1000,49 @@ point numbers") | |||
| 992 | ;; GPLv2 only is therefore the smallest subset. | 1000 | ;; GPLv2 only is therefore the smallest subset. |
| 993 | (license license:gpl2))) | 1001 | (license license:gpl2))) |
| 994 | 1002 | ||
| 1003 | (define-public wxmaxima | ||
| 1004 | (package | ||
| 1005 | (name "wxmaxima") | ||
| 1006 | (version "15.04.0") | ||
| 1007 | (source | ||
| 1008 | (origin | ||
| 1009 | (method url-fetch) | ||
| 1010 | (uri (string-append "mirror://sourceforge/wxmaxima/wxMaxima/" | ||
| 1011 | version "/" name "-" version ".tar.gz")) | ||
| 1012 | (sha256 | ||
| 1013 | (base32 | ||
| 1014 | "1fm47ah4aw5qdjqhkz67w5fwhy8yfffa5z896crp0d3hk2bh4180")))) | ||
| 1015 | (build-system gnu-build-system) | ||
| 1016 | (inputs | ||
| 1017 | `(("wxwidgets" ,wxwidgets) | ||
| 1018 | ("maxima" ,maxima))) | ||
| 1019 | (arguments | ||
| 1020 | `(#:phases (modify-phases %standard-phases | ||
| 1021 | (add-after | ||
| 1022 | 'install 'wrap-program | ||
| 1023 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 1024 | (wrap-program (string-append (assoc-ref outputs "out") | ||
| 1025 | "/bin/wxmaxima") | ||
| 1026 | `("PATH" ":" prefix | ||
| 1027 | (,(string-append (assoc-ref inputs "maxima") | ||
| 1028 | "/bin")))) | ||
| 1029 | #t))))) | ||
| 1030 | (home-page "https://andrejv.github.io/wxmaxima/") | ||
| 1031 | (synopsis "Graphical user interface for the Maxima computer algebra system") | ||
| 1032 | (description | ||
| 1033 | "wxMaxima is a graphical user interface for the Maxima computer algebra | ||
| 1034 | system. It eases the use of Maxima by making most of its commands available | ||
| 1035 | through a menu system and by providing input dialogs for commands that require | ||
| 1036 | more than one argument. It also implements its own display engine that | ||
| 1037 | outputs mathematical symbols directly instead of depicting them with ASCII | ||
| 1038 | characters. | ||
| 1039 | |||
| 1040 | wxMaxima also features 2D and 3D inline plots, simple animations, mixing of | ||
| 1041 | text and mathematical calculations to create documents, exporting of input and | ||
| 1042 | output to TeX, and a browser for Maxima's manual including command index and | ||
| 1043 | full text searching.") | ||
| 1044 | (license license:gpl2+))) | ||
| 1045 | |||
| 995 | (define-public muparser | 1046 | (define-public muparser |
| 996 | (package | 1047 | (package |
| 997 | (name "muparser") | 1048 | (name "muparser") |
| @@ -1020,7 +1071,7 @@ constant parts of it.") | |||
| 1020 | (define-public openblas | 1071 | (define-public openblas |
| 1021 | (package | 1072 | (package |
| 1022 | (name "openblas") | 1073 | (name "openblas") |
| 1023 | (version "0.2.13") | 1074 | (version "0.2.14") |
| 1024 | (source | 1075 | (source |
| 1025 | (origin | 1076 | (origin |
| 1026 | (method url-fetch) | 1077 | (method url-fetch) |
| @@ -1029,10 +1080,14 @@ constant parts of it.") | |||
| 1029 | (file-name (string-append name "-" version ".tar.gz")) | 1080 | (file-name (string-append name "-" version ".tar.gz")) |
| 1030 | (sha256 | 1081 | (sha256 |
| 1031 | (base32 | 1082 | (base32 |
| 1032 | "1asg5mix13ipxgj5h2yj2p0r8km1di5jbcjkn5gmhb37nx7qfv6k")))) | 1083 | "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db")))) |
| 1033 | (build-system gnu-build-system) | 1084 | (build-system gnu-build-system) |
| 1034 | (arguments | 1085 | (arguments |
| 1035 | '(#:tests? #f ;no "check" target | 1086 | `(#:tests? #f ;no "check" target |
| 1087 | ;; DYNAMIC_ARCH is not supported on MIPS. When it is disabled, | ||
| 1088 | ;; OpenBLAS will tune itself to the build host, so we need to disable | ||
| 1089 | ;; substitutions. | ||
| 1090 | #:substitutable? ,(not (string-prefix? "mips" (%current-system))) | ||
| 1036 | #:make-flags | 1091 | #:make-flags |
| 1037 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) | 1092 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) |
| 1038 | "SHELL=bash" | 1093 | "SHELL=bash" |
| @@ -1040,7 +1095,10 @@ constant parts of it.") | |||
| 1040 | ;; Build the library for all supported CPUs. This allows | 1095 | ;; Build the library for all supported CPUs. This allows |
| 1041 | ;; switching CPU targets at runtime with the environment variable | 1096 | ;; switching CPU targets at runtime with the environment variable |
| 1042 | ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type. | 1097 | ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type. |
| 1043 | "DYNAMIC_ARCH=1") | 1098 | ;; Unfortunately, this is not supported on MIPS. |
| 1099 | ,@(if (string-prefix? "mips" (%current-system)) | ||
| 1100 | '() | ||
| 1101 | '("DYNAMIC_ARCH=1"))) | ||
| 1044 | ;; no configure script | 1102 | ;; no configure script |
| 1045 | #:phases (alist-delete 'configure %standard-phases))) | 1103 | #:phases (alist-delete 'configure %standard-phases))) |
| 1046 | (inputs | 1104 | (inputs |
| @@ -1333,3 +1391,72 @@ library with poor performance.") | |||
| 1333 | library for graphics software based on the OpenGL Shading Language (GLSL) | 1391 | library for graphics software based on the OpenGL Shading Language (GLSL) |
| 1334 | specifications.") | 1392 | specifications.") |
| 1335 | (license license:expat))) | 1393 | (license license:expat))) |
| 1394 | |||
| 1395 | (define-public lpsolve | ||
| 1396 | (package | ||
| 1397 | (name "lpsolve") | ||
| 1398 | (version "5.5.2.0") | ||
| 1399 | (source | ||
| 1400 | (origin | ||
| 1401 | (method url-fetch) | ||
| 1402 | (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version | ||
| 1403 | "/lp_solve_" version "_source.tar.gz")) | ||
| 1404 | (sha256 | ||
| 1405 | (base32 | ||
| 1406 | "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq")) | ||
| 1407 | (modules '((guix build utils))) | ||
| 1408 | (snippet | ||
| 1409 | '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc") | ||
| 1410 | (("^c=cc") "c=gcc") | ||
| 1411 | ;; Pretend to be on a 64 bit platform to obtain a common directory | ||
| 1412 | ;; name for the build results on all architectures; nothing else | ||
| 1413 | ;; seems to depend on it. | ||
| 1414 | (("^PLATFORM=.*$") "PLATFORM=ux64\n"))))) | ||
| 1415 | (build-system gnu-build-system) | ||
| 1416 | (arguments | ||
| 1417 | `(#:tests? #f ; no check target | ||
| 1418 | #:phases | ||
| 1419 | (modify-phases %standard-phases | ||
| 1420 | (delete 'configure) | ||
| 1421 | (replace 'build | ||
| 1422 | (lambda _ | ||
| 1423 | (with-directory-excursion "lpsolve55" | ||
| 1424 | (system* "bash" "ccc")) | ||
| 1425 | (with-directory-excursion "lp_solve" | ||
| 1426 | (system* "bash" "ccc")) | ||
| 1427 | #t)) | ||
| 1428 | (replace 'install | ||
| 1429 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 1430 | (let* ((out (assoc-ref outputs "out")) | ||
| 1431 | (bin (string-append out "/bin")) | ||
| 1432 | (lib (string-append out "/lib")) | ||
| 1433 | ;; This is where LibreOffice expects to find the header | ||
| 1434 | ;; files, and where they are installed by Debian. | ||
| 1435 | (include (string-append out "/include/lpsolve"))) | ||
| 1436 | (mkdir-p lib) | ||
| 1437 | (copy-file "lpsolve55/bin/ux64/liblpsolve55.a" | ||
| 1438 | (string-append lib "/liblpsolve55.a")) | ||
| 1439 | (copy-file "lpsolve55/bin/ux64/liblpsolve55.so" | ||
| 1440 | (string-append lib "/liblpsolve55.so")) | ||
| 1441 | (mkdir-p bin) | ||
| 1442 | (copy-file "lp_solve/bin/ux64/lp_solve" | ||
| 1443 | (string-append bin "/lp_solve")) | ||
| 1444 | (mkdir-p include) | ||
| 1445 | ;; Install a subset of the header files as on Debian | ||
| 1446 | ;; (plus lp_bit.h, which matches the regular expression). | ||
| 1447 | (for-each | ||
| 1448 | (lambda (name) | ||
| 1449 | (copy-file name (string-append include "/" name))) | ||
| 1450 | (find-files "." "lp_[HMSa-z].*\\.h$")) | ||
| 1451 | (with-directory-excursion "shared" | ||
| 1452 | (for-each | ||
| 1453 | (lambda (name) | ||
| 1454 | (copy-file name (string-append include "/" name))) | ||
| 1455 | (find-files "." "\\.h$"))) | ||
| 1456 | #t)))))) | ||
| 1457 | (home-page "http://lpsolve.sourceforge.net/") | ||
| 1458 | (synopsis "Mixed integer linear programming (MILP) solver") | ||
| 1459 | (description | ||
| 1460 | "lp_solve is a mixed integer linear programming solver based on the | ||
| 1461 | revised simplex and the branch-and-bound methods.") | ||
| 1462 | (license license:lgpl2.1+))) | ||
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index fd857b1ec3e..50d59cfcc53 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> | 2 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
| 3 | ;;; Copyright © 2014 Julien Lepiller <julien@lepiller.eu> | 3 | ;;; Copyright © 2014 Julien Lepiller <julien@lepiller.eu> |
| 4 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> | 4 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
| 5 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | ||
| 5 | ;;; | 6 | ;;; |
| 6 | ;;; This file is part of GNU Guix. | 7 | ;;; This file is part of GNU Guix. |
| 7 | ;;; | 8 | ;;; |
| @@ -86,20 +87,20 @@ providing: | |||
| 86 | (define-public bitlbee | 87 | (define-public bitlbee |
| 87 | (package | 88 | (package |
| 88 | (name "bitlbee") | 89 | (name "bitlbee") |
| 89 | (version "3.2.2") | 90 | (version "3.4") |
| 90 | (source (origin | 91 | (source (origin |
| 91 | (method url-fetch) | 92 | (method url-fetch) |
| 92 | (uri (string-append "http://get.bitlbee.org/src/bitlbee-" | 93 | (uri (string-append "http://get.bitlbee.org/src/bitlbee-" |
| 93 | version ".tar.gz")) | 94 | version ".tar.gz")) |
| 94 | (sha256 | 95 | (sha256 |
| 95 | (base32 "13jmcxxgli82wb2n4hs091159xk8rgh7nb02f478lgpjh6996f5s")))) | 96 | (base32 "0plx4dryf8i6hz7vghg84z5f6w6rkw1l8ckl4c4wh5zxpd3ddfnf")) |
| 97 | (patches (list (search-patch "bitlbee-configure-doc-fix.patch"))))) | ||
| 96 | (build-system gnu-build-system) | 98 | (build-system gnu-build-system) |
| 97 | (native-inputs `(("pkg-config" ,pkg-config) | 99 | (native-inputs `(("pkg-config" ,pkg-config) |
| 98 | ("check" ,check))) | 100 | ("check" ,check))) |
| 99 | (inputs `(("glib" ,glib) | 101 | (inputs `(("glib" ,glib) |
| 100 | ("libotr" ,libotr) | 102 | ("libotr" ,libotr) |
| 101 | ("gnutls" ,gnutls) | 103 | ("gnutls" ,gnutls) |
| 102 | ("zlib" ,zlib) ; Needed to satisfy "pkg-config --exists gnutls" | ||
| 103 | ("python" ,python-2) | 104 | ("python" ,python-2) |
| 104 | ("perl" ,perl))) | 105 | ("perl" ,perl))) |
| 105 | (arguments | 106 | (arguments |
diff --git a/gnu/packages/moe.scm b/gnu/packages/moe.scm index 6708d729135..675ecb6ce26 100644 --- a/gnu/packages/moe.scm +++ b/gnu/packages/moe.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> | 2 | ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -27,7 +27,7 @@ | |||
| 27 | (define-public moe | 27 | (define-public moe |
| 28 | (package | 28 | (package |
| 29 | (name "moe") | 29 | (name "moe") |
| 30 | (version "1.6") | 30 | (version "1.7") |
| 31 | (source | 31 | (source |
| 32 | (origin | 32 | (origin |
| 33 | (method url-fetch) | 33 | (method url-fetch) |
| @@ -35,7 +35,7 @@ | |||
| 35 | version ".tar.lz")) | 35 | version ".tar.lz")) |
| 36 | (sha256 | 36 | (sha256 |
| 37 | (base32 | 37 | (base32 |
| 38 | "1cfwi67sdl2qchqbdib4p6wxjpwz2kmn6vxn9hmh1zs0gg4xkbwc")))) | 38 | "1fzimk1qpmsm7wzfnjzzrp4dvdn7ipdb5j7969910g1m93wndfik")))) |
| 39 | (build-system gnu-build-system) | 39 | (build-system gnu-build-system) |
| 40 | (native-inputs `(("lzip" ,lzip))) | 40 | (native-inputs `(("lzip" ,lzip))) |
| 41 | (inputs `(("ncurses" ,ncurses))) | 41 | (inputs `(("ncurses" ,ncurses))) |
diff --git a/gnu/packages/socat.scm b/gnu/packages/networking.scm index 7c0bc3d964a..dd13e1720bf 100644 --- a/gnu/packages/socat.scm +++ b/gnu/packages/networking.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -16,14 +17,42 @@ | |||
| 16 | ;;; You should have received a copy of the GNU General Public License | 17 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | 19 | ||
| 19 | (define-module (gnu packages socat) | 20 | (define-module (gnu packages networking) |
| 20 | #:use-module ((guix licenses) #:prefix license:) | 21 | #:use-module ((guix licenses) #:prefix license:) |
| 21 | #:use-module (guix packages) | 22 | #:use-module (guix packages) |
| 22 | #:use-module (guix download) | 23 | #:use-module (guix download) |
| 23 | #:use-module (guix build-system gnu) | 24 | #:use-module (guix build-system gnu) |
| 24 | #:use-module (gnu packages openssl)) | 25 | #:use-module (gnu packages openssl)) |
| 25 | 26 | ||
| 26 | ;; XXX: Group with other networking tools like tcpdump in a module? | 27 | (define-public miredo |
| 28 | (package | ||
| 29 | (name "miredo") | ||
| 30 | (version "1.2.6") | ||
| 31 | (source (origin | ||
| 32 | (method url-fetch) | ||
| 33 | (uri (string-append "http://www.remlab.net/files/miredo/miredo-" | ||
| 34 | version ".tar.xz")) | ||
| 35 | (sha256 | ||
| 36 | (base32 | ||
| 37 | "0j9ilig570snbmj48230hf7ms8kvcwi2wblycqrmhh85lksd49ps")))) | ||
| 38 | (build-system gnu-build-system) | ||
| 39 | (arguments | ||
| 40 | '(#:phases | ||
| 41 | (modify-phases %standard-phases | ||
| 42 | ;; The checkconf test in src/ requires network access. | ||
| 43 | (add-before | ||
| 44 | 'check 'disable-checkconf-test | ||
| 45 | (lambda _ | ||
| 46 | (substitute* "src/Makefile" | ||
| 47 | (("^TESTS = .*") "TESTS = \n"))))))) | ||
| 48 | (home-page "http://www.remlab.net/miredo/") | ||
| 49 | (synopsis "Teredo IPv6 tunneling software") | ||
| 50 | (description | ||
| 51 | "Miredo is an implementation (client, relay, server) of the Teredo | ||
| 52 | specification, which provides IPv6 Internet connectivity to IPv6 enabled hosts | ||
| 53 | residing in IPv4-only networks, even when they are behind a NAT device.") | ||
| 54 | (license license:gpl2+))) | ||
| 55 | |||
| 27 | (define-public socat | 56 | (define-public socat |
| 28 | (package | 57 | (package |
| 29 | (name "socat") | 58 | (name "socat") |
| @@ -53,3 +82,26 @@ line, to logically connect serial lines on different computers, or to | |||
| 53 | establish a relatively secure environment (su and chroot) for running client | 82 | establish a relatively secure environment (su and chroot) for running client |
| 54 | or server shell scripts with network connections. ") | 83 | or server shell scripts with network connections. ") |
| 55 | (license license:gpl2))) | 84 | (license license:gpl2))) |
| 85 | |||
| 86 | (define-public zeromq | ||
| 87 | (package | ||
| 88 | (name "zeromq") | ||
| 89 | (version "4.0.5") | ||
| 90 | (source (origin | ||
| 91 | (method url-fetch) | ||
| 92 | (uri (string-append "http://download.zeromq.org/zeromq-" | ||
| 93 | version ".tar.gz")) | ||
| 94 | (sha256 | ||
| 95 | (base32 | ||
| 96 | "0arl8fy8d03xd5h0mgda1s5bajwg8iyh1kk4hd1420rpcxgkrj9v")))) | ||
| 97 | (build-system gnu-build-system) | ||
| 98 | (home-page "http://zeromq.org") | ||
| 99 | (synopsis "Library for message-based applications") | ||
| 100 | (description | ||
| 101 | "The 0MQ lightweight messaging kernel is a library which extends the | ||
| 102 | standard socket interfaces with features traditionally provided by specialized | ||
| 103 | messaging middle-ware products. 0MQ sockets provide an abstraction of | ||
| 104 | asynchronous message queues, multiple messaging patterns, message | ||
| 105 | filtering (subscriptions), seamless access to multiple transport protocols and | ||
| 106 | more.") | ||
| 107 | (license license:lgpl3+))) | ||
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 2b4821ed42c..5baf24cac00 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> | 2 | ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> |
| 3 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 6 | ;;; |
| @@ -18,11 +18,20 @@ | |||
| 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 19 | ||
| 20 | (define-module (gnu packages ocaml) | 20 | (define-module (gnu packages ocaml) |
| 21 | #:use-module (guix licenses) | 21 | #:use-module ((guix licenses) #:hide (zlib)) |
| 22 | #:use-module (guix packages) | 22 | #:use-module (guix packages) |
| 23 | #:use-module (guix download) | 23 | #:use-module (guix download) |
| 24 | #:use-module (guix utils) | ||
| 24 | #:use-module (guix build-system gnu) | 25 | #:use-module (guix build-system gnu) |
| 25 | #:use-module (gnu packages) | 26 | #:use-module (gnu packages) |
| 27 | #:use-module (gnu packages base) | ||
| 28 | #:use-module (gnu packages emacs) | ||
| 29 | #:use-module (gnu packages texinfo) | ||
| 30 | #:use-module (gnu packages pkg-config) | ||
| 31 | #:use-module (gnu packages compression) | ||
| 32 | #:use-module (gnu packages commencement) | ||
| 33 | #:use-module (gnu packages xorg) | ||
| 34 | #:use-module (gnu packages texlive) | ||
| 26 | #:use-module (gnu packages perl) | 35 | #:use-module (gnu packages perl) |
| 27 | #:use-module (gnu packages python) | 36 | #:use-module (gnu packages python) |
| 28 | #:use-module (gnu packages ncurses) | 37 | #:use-module (gnu packages ncurses) |
| @@ -32,56 +41,94 @@ | |||
| 32 | (define-public ocaml | 41 | (define-public ocaml |
| 33 | (package | 42 | (package |
| 34 | (name "ocaml") | 43 | (name "ocaml") |
| 35 | (version "4.00.1") | 44 | (version "4.02.1") |
| 36 | (source (origin | 45 | (source (origin |
| 37 | (method url-fetch) | 46 | (method url-fetch) |
| 38 | (uri (string-append | 47 | (uri (string-append |
| 39 | "http://caml.inria.fr/pub/distrib/ocaml-4.00/ocaml-" | 48 | "http://caml.inria.fr/pub/distrib/ocaml-" |
| 40 | version ".tar.gz")) | 49 | (version-major+minor version) |
| 41 | (sha256 | 50 | "/ocaml-" version ".tar.xz")) |
| 42 | (base32 | 51 | (sha256 |
| 43 | "0yp86napnvbi2jgxr6bk1235bmjdclgzrzgq4mhwv87l7dymr3dl")))) | 52 | (base32 |
| 53 | "1p7lqvh64xpykh99014mz21q8fs3qyjym2qazhhbq8scwldv1i38")))) | ||
| 44 | (build-system gnu-build-system) | 54 | (build-system gnu-build-system) |
| 55 | (native-inputs | ||
| 56 | `(("perl" ,perl) | ||
| 57 | ("pkg-config" ,pkg-config))) | ||
| 58 | (inputs | ||
| 59 | `(("libx11" ,libx11) | ||
| 60 | ("gcc:lib" ,gcc-final "lib") ; for libiberty, needed for objdump support | ||
| 61 | ("zlib" ,zlib))) ; also needed for objdump support | ||
| 45 | (arguments | 62 | (arguments |
| 46 | `(#:modules ((guix build gnu-build-system) | 63 | `(#:modules ((guix build gnu-build-system) |
| 47 | (guix build utils) | 64 | (guix build utils) |
| 48 | (srfi srfi-1)) | 65 | (web server)) |
| 49 | #:phases (alist-replace | 66 | #:phases |
| 50 | 'configure | 67 | (modify-phases %standard-phases |
| 51 | (lambda* (#:key outputs #:allow-other-keys) | 68 | (add-after 'unpack 'patch-/bin/sh-references |
| 52 | ;; OCaml uses "-prefix <prefix>" rather than the usual | 69 | (lambda* (#:key inputs #:allow-other-keys) |
| 53 | ;; "--prefix=<prefix>". | 70 | (let* ((sh (string-append (assoc-ref inputs "bash") |
| 54 | (let ((out (assoc-ref outputs "out"))) | 71 | "/bin/sh")) |
| 55 | (zero? (system* "./configure" "-prefix" out | 72 | (quoted-sh (string-append "\"" sh "\""))) |
| 56 | "-mandir" | 73 | (with-fluids ((%default-port-encoding #f)) |
| 57 | (string-append out "/share/man"))))) | 74 | (for-each (lambda (file) |
| 58 | (alist-replace | 75 | (substitute* file |
| 59 | 'build | 76 | (("\"/bin/sh\"") |
| 60 | (lambda* (#:key outputs #:allow-other-keys) | 77 | (begin |
| 61 | ;; "make" does not do anything, we must use | 78 | (format (current-error-port) "\ |
| 62 | ;; "make world.opt". | 79 | patch-/bin/sh-references: ~a: changing `\"/bin/sh\"' to `~a'~%" |
| 63 | (zero? (system* "make" "world.opt"))) | 80 | file quoted-sh) |
| 64 | (alist-replace | 81 | quoted-sh)))) |
| 65 | 'check-after-install | 82 | (find-files "." "\\.ml$")) |
| 66 | (lambda* (#:key outputs #:allow-other-keys) | 83 | #t)))) |
| 67 | ;; There does not seem to be a "check" or "test" target. | 84 | (replace 'configure |
| 68 | (zero? (system "cd testsuite && make all"))) | 85 | (lambda* (#:key outputs #:allow-other-keys) |
| 69 | (let ((check (assq-ref %standard-phases 'check))) | 86 | (let* ((out (assoc-ref outputs "out")) |
| 70 | ;; OCaml assumes that "make install" is run before | 87 | (mandir (string-append out "/share/man"))) |
| 71 | ;; launching the tests. | 88 | ;; Custom configure script doesn't recognize |
| 72 | (alist-cons-after | 89 | ;; --prefix=<PREFIX> syntax (with equals sign). |
| 73 | 'install 'check-after-install | 90 | (zero? (system* "./configure" |
| 74 | check | 91 | "--prefix" out |
| 75 | (alist-delete 'check %standard-phases)))))))) | 92 | "--mandir" mandir))))) |
| 76 | (inputs `(("perl" ,perl))) | 93 | (replace 'build |
| 77 | (home-page "http://caml.inria.fr/") | 94 | (lambda _ |
| 95 | (zero? (system* "make" "-j" (number->string | ||
| 96 | (parallel-job-count)) | ||
| 97 | "world.opt")))) | ||
| 98 | (delete 'check) | ||
| 99 | (add-after 'install 'check | ||
| 100 | (lambda _ | ||
| 101 | (with-directory-excursion "testsuite" | ||
| 102 | (zero? (system* "make" "all"))))) | ||
| 103 | (add-before 'check 'prepare-socket-test | ||
| 104 | (lambda _ | ||
| 105 | (format (current-error-port) | ||
| 106 | "Spawning local test web server on port 8080~%") | ||
| 107 | (when (zero? (primitive-fork)) | ||
| 108 | (run-server (lambda (request request-body) | ||
| 109 | (values '((content-type . (text/plain))) | ||
| 110 | "Hello!")) | ||
| 111 | 'http '(#:port 8080))) | ||
| 112 | (let ((file "testsuite/tests/lib-threads/testsocket.ml")) | ||
| 113 | (format (current-error-port) | ||
| 114 | "Patching ~a to use localhost port 8080~%" | ||
| 115 | file) | ||
| 116 | (substitute* file | ||
| 117 | (("caml.inria.fr") "localhost") | ||
| 118 | (("80") "8080") | ||
| 119 | (("HTTP1.0") "HTTP/1.0")) | ||
| 120 | #t)))))) | ||
| 121 | (home-page "https://ocaml.org/") | ||
| 78 | (synopsis "The OCaml programming language") | 122 | (synopsis "The OCaml programming language") |
| 79 | (description | 123 | (description |
| 80 | "OCaml is a general purpose industrial-strength programming language with | 124 | "OCaml is a general purpose industrial-strength programming language with |
| 81 | an emphasis on expressiveness and safety. Developed for more than 20 years at | 125 | an emphasis on expressiveness and safety. Developed for more than 20 years at |
| 82 | Inria it benefits from one of the most advanced type systems and supports | 126 | Inria it benefits from one of the most advanced type systems and supports |
| 83 | functional, imperative and object-oriented styles of programming.") | 127 | functional, imperative and object-oriented styles of programming.") |
| 84 | (license (list qpl gpl2)))) | 128 | ;; The compiler is distributed under qpl1.0 with a change to choice of |
| 129 | ;; law: the license is governed by the laws of France. The library is | ||
| 130 | ;; distributed under lgpl2.0. | ||
| 131 | (license (list qpl lgpl2.0)))) | ||
| 85 | 132 | ||
| 86 | (define-public opam | 133 | (define-public opam |
| 87 | (package | 134 | (package |
| @@ -143,3 +190,198 @@ Git-friendly development workflow.") | |||
| 143 | 190 | ||
| 144 | ;; The 'LICENSE' file waives some requirements compared to LGPLv3. | 191 | ;; The 'LICENSE' file waives some requirements compared to LGPLv3. |
| 145 | (license lgpl3))) | 192 | (license lgpl3))) |
| 193 | |||
| 194 | (define-public camlp5 | ||
| 195 | (package | ||
| 196 | (name "camlp5") | ||
| 197 | (version "6.12") | ||
| 198 | (source (origin | ||
| 199 | (method url-fetch) | ||
| 200 | (uri (string-append "http://camlp5.gforge.inria.fr/distrib/src/" | ||
| 201 | name "-" version ".tgz")) | ||
| 202 | (sha256 | ||
| 203 | (base32 | ||
| 204 | "00jwgp6w4g64lfqjx77xziy532091fy00c42fsy0b4i892rch5mp")))) | ||
| 205 | (build-system gnu-build-system) | ||
| 206 | (inputs | ||
| 207 | `(("ocaml" ,ocaml))) | ||
| 208 | (arguments | ||
| 209 | `(#:tests? #f ; XXX TODO figure out how to run the tests | ||
| 210 | #:phases | ||
| 211 | (modify-phases %standard-phases | ||
| 212 | (replace 'configure | ||
| 213 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 214 | (let* ((out (assoc-ref outputs "out")) | ||
| 215 | (mandir (string-append out "/share/man"))) | ||
| 216 | ;; Custom configure script doesn't recognize | ||
| 217 | ;; --prefix=<PREFIX> syntax (with equals sign). | ||
| 218 | (zero? (system* "./configure" | ||
| 219 | "--prefix" out | ||
| 220 | "--mandir" mandir))))) | ||
| 221 | (replace 'build | ||
| 222 | (lambda _ | ||
| 223 | (zero? (system* "make" "-j" (number->string | ||
| 224 | (parallel-job-count)) | ||
| 225 | "world.opt"))))))) | ||
| 226 | (home-page "http://camlp5.gforge.inria.fr/") | ||
| 227 | (synopsis "Pre-processor Pretty Printer for OCaml") | ||
| 228 | (description | ||
| 229 | "Camlp5 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers | ||
| 230 | tools for syntax (Stream Parsers and Grammars) and the ability to modify the | ||
| 231 | concrete syntax of the language (Quotations, Syntax Extensions).") | ||
| 232 | ;; Most files are distributed under bsd-3, but ocaml_stuff/* is under qpl. | ||
| 233 | (license (list bsd-3 qpl)))) | ||
| 234 | |||
| 235 | (define-public hevea | ||
| 236 | (package | ||
| 237 | (name "hevea") | ||
| 238 | (version "2.23") | ||
| 239 | (source (origin | ||
| 240 | (method url-fetch) | ||
| 241 | (uri (string-append "http://hevea.inria.fr/distri/" | ||
| 242 | name "-" version ".tar.gz")) | ||
| 243 | (sha256 | ||
| 244 | (base32 | ||
| 245 | "1f9pj48518ixhjxbviv2zx27v4anp92zgg3x704g1s5cki2w33nv")))) | ||
| 246 | (build-system gnu-build-system) | ||
| 247 | (inputs | ||
| 248 | `(("ocaml" ,ocaml))) | ||
| 249 | (arguments | ||
| 250 | `(#:tests? #f ; no test suite | ||
| 251 | #:make-flags (list (string-append "PREFIX=" %output)) | ||
| 252 | #:phases (modify-phases %standard-phases | ||
| 253 | (delete 'configure)))) | ||
| 254 | (home-page "http://hevea.inria.fr/") | ||
| 255 | (synopsis "LaTeX to HTML translator") | ||
| 256 | (description | ||
| 257 | "HeVeA is a LaTeX to HTML translator that generates modern HTML 5. It is | ||
| 258 | written in Objective Caml.") | ||
| 259 | (license qpl))) | ||
| 260 | |||
| 261 | (define-public coq | ||
| 262 | (package | ||
| 263 | (name "coq") | ||
| 264 | (version "8.4pl6") | ||
| 265 | (source (origin | ||
| 266 | (method url-fetch) | ||
| 267 | (uri (string-append "https://coq.inria.fr/distrib/V" version | ||
| 268 | "/files/" name "-" version ".tar.gz")) | ||
| 269 | (sha256 | ||
| 270 | (base32 | ||
| 271 | "1mpbj4yf36kpjg2v2sln12i8dzqn8rag6fd07hslj2lpm4qs4h55")))) | ||
| 272 | (build-system gnu-build-system) | ||
| 273 | (native-inputs | ||
| 274 | `(("texlive" ,texlive) | ||
| 275 | ("hevea" ,hevea))) | ||
| 276 | (inputs | ||
| 277 | `(("ocaml" ,ocaml) | ||
| 278 | ("camlp5" ,camlp5))) | ||
| 279 | (arguments | ||
| 280 | `(#:phases | ||
| 281 | (modify-phases %standard-phases | ||
| 282 | (replace 'configure | ||
| 283 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 284 | (let* ((out (assoc-ref outputs "out")) | ||
| 285 | (mandir (string-append out "/share/man")) | ||
| 286 | (browser "icecat -remote \"OpenURL(%s,new-tab)\"")) | ||
| 287 | (zero? (system* "./configure" | ||
| 288 | "--prefix" out | ||
| 289 | "--mandir" mandir | ||
| 290 | "--browser" browser))))) | ||
| 291 | (replace 'build | ||
| 292 | (lambda _ | ||
| 293 | (zero? (system* "make" "-j" (number->string | ||
| 294 | (parallel-job-count)) | ||
| 295 | "world")))) | ||
| 296 | (delete 'check) | ||
| 297 | (add-after 'install 'check | ||
| 298 | (lambda _ | ||
| 299 | (with-directory-excursion "test-suite" | ||
| 300 | (zero? (system* "make")))))))) | ||
| 301 | (home-page "https://coq.inria.fr") | ||
| 302 | (synopsis "Proof assistant for higher-order logic") | ||
| 303 | (description | ||
| 304 | "Coq is a proof assistant for higher-order logic, which allows the | ||
| 305 | development of computer programs consistent with their formal specification. | ||
| 306 | It is developed using Objective Caml and Camlp5.") | ||
| 307 | ;; The code is distributed under lgpl2.1. | ||
| 308 | ;; Some of the documentation is distributed under opl1.0+. | ||
| 309 | (license (list lgpl2.1 opl1.0+)))) | ||
| 310 | |||
| 311 | (define-public proof-general | ||
| 312 | (package | ||
| 313 | (name "proof-general") | ||
| 314 | (version "4.2") | ||
| 315 | (source (origin | ||
| 316 | (method url-fetch) | ||
| 317 | (uri (string-append | ||
| 318 | "http://proofgeneral.inf.ed.ac.uk/releases/" | ||
| 319 | "ProofGeneral-" version ".tgz")) | ||
| 320 | (sha256 | ||
| 321 | (base32 | ||
| 322 | "09qb0myq66fw17v4ziz401ilsb5xlxz1nl2wsp69d0vrfy0bcrrm")))) | ||
| 323 | (build-system gnu-build-system) | ||
| 324 | (native-inputs | ||
| 325 | `(("which" ,which) | ||
| 326 | ("emacs" ,emacs-no-x) | ||
| 327 | ("texinfo" ,texinfo))) | ||
| 328 | (inputs | ||
| 329 | `(("host-emacs" ,emacs) | ||
| 330 | ("perl" ,perl) | ||
| 331 | ("coq" ,coq))) | ||
| 332 | (arguments | ||
| 333 | `(#:tests? #f ; no check target | ||
| 334 | #:make-flags (list (string-append "PREFIX=" %output) | ||
| 335 | (string-append "DEST_PREFIX=" %output)) | ||
| 336 | #:modules ((guix build gnu-build-system) | ||
| 337 | (guix build utils) | ||
| 338 | (guix build emacs-utils)) | ||
| 339 | #:imported-modules (,@%gnu-build-system-modules | ||
| 340 | (guix build emacs-utils)) | ||
| 341 | #:phases | ||
| 342 | (modify-phases %standard-phases | ||
| 343 | (delete 'configure) | ||
| 344 | (add-after 'unpack 'disable-byte-compile-error-on-warn | ||
| 345 | (lambda _ | ||
| 346 | (substitute* "Makefile" | ||
| 347 | (("\\(setq byte-compile-error-on-warn t\\)") | ||
| 348 | "(setq byte-compile-error-on-warn nil)")) | ||
| 349 | #t)) | ||
| 350 | (add-after 'unpack 'patch-hardcoded-paths | ||
| 351 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 352 | (let ((out (assoc-ref outputs "out")) | ||
| 353 | (coq (assoc-ref inputs "coq")) | ||
| 354 | (emacs (assoc-ref inputs "host-emacs"))) | ||
| 355 | (define (coq-prog name) | ||
| 356 | (string-append coq "/bin/" name)) | ||
| 357 | (emacs-substitute-variables "coq/coq.el" | ||
| 358 | ("coq-prog-name" (coq-prog "coqtop")) | ||
| 359 | ("coq-compiler" (coq-prog "coqc")) | ||
| 360 | ("coq-dependency-analyzer" (coq-prog "coqdep"))) | ||
| 361 | (substitute* "Makefile" | ||
| 362 | (("/sbin/install-info") "install-info")) | ||
| 363 | (substitute* "bin/proofgeneral" | ||
| 364 | (("^PGHOMEDEFAULT=.*" all) | ||
| 365 | (string-append all | ||
| 366 | "PGHOME=$PGHOMEDEFAULT\n" | ||
| 367 | "EMACS=" emacs "/bin/emacs"))) | ||
| 368 | #t))) | ||
| 369 | (add-after 'unpack 'clean | ||
| 370 | (lambda _ | ||
| 371 | ;; Delete the pre-compiled elc files for Emacs 23. | ||
| 372 | (zero? (system* "make" "clean")))) | ||
| 373 | (add-after 'install 'install-doc | ||
| 374 | (lambda* (#:key make-flags #:allow-other-keys) | ||
| 375 | ;; XXX FIXME avoid building/installing pdf files, | ||
| 376 | ;; due to unresolved errors building them. | ||
| 377 | (substitute* "Makefile" | ||
| 378 | ((" [^ ]*\\.pdf") "")) | ||
| 379 | (zero? (apply system* "make" "install-doc" | ||
| 380 | make-flags))))))) | ||
| 381 | (home-page "http://proofgeneral.inf.ed.ac.uk/") | ||
| 382 | (description "Generic front-end for proof assistants based on Emacs") | ||
| 383 | (synopsis | ||
| 384 | "Proof General is a major mode to turn Emacs into an interactive proof | ||
| 385 | assistant to write formal mathematical proofs using a variety of theorem | ||
| 386 | provers.") | ||
| 387 | (license gpl2+))) | ||
diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm index fe7961affb2..52bd0eea476 100644 --- a/gnu/packages/openldap.scm +++ b/gnu/packages/openldap.scm | |||
| @@ -37,11 +37,21 @@ | |||
| 37 | (version "2.4.40") | 37 | (version "2.4.40") |
| 38 | (source (origin | 38 | (source (origin |
| 39 | (method url-fetch) | 39 | (method url-fetch) |
| 40 | (uri (string-append | 40 | |
| 41 | "ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/openldap-" | 41 | ;; See <http://www.openldap.org/software/download/> for a list of |
| 42 | version ".tgz")) | 42 | ;; mirrors. |
| 43 | (sha256 (base32 | 43 | (uri (list (string-append |
| 44 | "1nyslrgwxwilgv5sixc37svls5rbvhsv9drb7hlrjr2vqaji29ni")))) | 44 | "ftp://mirror.switch.ch/mirror/OpenLDAP/" |
| 45 | "openldap-release/openldap-" version ".tgz") | ||
| 46 | (string-append | ||
| 47 | "ftp://ftp.OpenLDAP.org/pub/OpenLDAP/" | ||
| 48 | "openldap-release/openldap-" version ".tgz") | ||
| 49 | (string-append | ||
| 50 | "ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/" | ||
| 51 | "openldap-release/openldap-" version ".tgz"))) | ||
| 52 | (sha256 | ||
| 53 | (base32 | ||
| 54 | "1nyslrgwxwilgv5sixc37svls5rbvhsv9drb7hlrjr2vqaji29ni")))) | ||
| 45 | (build-system gnu-build-system) | 55 | (build-system gnu-build-system) |
| 46 | (inputs `(("bdb" ,bdb) | 56 | (inputs `(("bdb" ,bdb) |
| 47 | ("openssl" ,openssl) | 57 | ("openssl" ,openssl) |
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 75efd0c4480..db059691397 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #:use-module (gnu packages compression) | 29 | #:use-module (gnu packages compression) |
| 30 | #:use-module (gnu packages gnupg) | 30 | #:use-module (gnu packages gnupg) |
| 31 | #:use-module (gnu packages databases) | 31 | #:use-module (gnu packages databases) |
| 32 | #:use-module (gnu packages gnutls) | ||
| 32 | #:use-module (gnu packages graphviz) | 33 | #:use-module (gnu packages graphviz) |
| 33 | #:use-module (gnu packages pkg-config) | 34 | #:use-module (gnu packages pkg-config) |
| 34 | #:use-module (gnu packages autotools) | 35 | #:use-module (gnu packages autotools) |
| @@ -51,17 +52,17 @@ | |||
| 51 | arch "-linux" | 52 | arch "-linux" |
| 52 | "/20131110/guile-2.0.9.tar.xz"))) | 53 | "/20131110/guile-2.0.9.tar.xz"))) |
| 53 | 54 | ||
| 54 | (define-public guix-0.8.1 | 55 | (define-public guix-0.8.2 |
| 55 | (package | 56 | (package |
| 56 | (name "guix") | 57 | (name "guix") |
| 57 | (version "0.8.1") | 58 | (version "0.8.2") |
| 58 | (source (origin | 59 | (source (origin |
| 59 | (method url-fetch) | 60 | (method url-fetch) |
| 60 | (uri (string-append "ftp://alpha.gnu.org/gnu/guix/guix-" | 61 | (uri (string-append "ftp://alpha.gnu.org/gnu/guix/guix-" |
| 61 | version ".tar.gz")) | 62 | version ".tar.gz")) |
| 62 | (sha256 | 63 | (sha256 |
| 63 | (base32 | 64 | (base32 |
| 64 | "12h5ldj1yf0za6ladlr8h7nx2gqrv2dxcsiwyqayvrza93lijkf5")))) | 65 | "1a5gnkh17w7fgi5zy63ph64iqdvarkdqypkwgw2iifpqa6jq04zz")))) |
| 65 | (build-system gnu-build-system) | 66 | (build-system gnu-build-system) |
| 66 | (arguments | 67 | (arguments |
| 67 | `(#:configure-flags (list | 68 | `(#:configure-flags (list |
| @@ -130,7 +131,8 @@ | |||
| 130 | (base32 | 131 | (base32 |
| 131 | "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5")))))) | 132 | "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5")))))) |
| 132 | (propagated-inputs | 133 | (propagated-inputs |
| 133 | `(("guile-json" ,guile-json) | 134 | `(("gnutls" ,gnutls) ;for 'guix download' & co. |
| 135 | ("guile-json" ,guile-json) | ||
| 134 | ("geiser" ,geiser))) ;for guix.el | 136 | ("geiser" ,geiser))) ;for guix.el |
| 135 | 137 | ||
| 136 | (home-page "http://www.gnu.org/software/guix") | 138 | (home-page "http://www.gnu.org/software/guix") |
| @@ -148,9 +150,9 @@ the Nix package manager.") | |||
| 148 | ;; | 150 | ;; |
| 149 | ;; Note: use a short commit id; when using the long one, the limit on socket | 151 | ;; Note: use a short commit id; when using the long one, the limit on socket |
| 150 | ;; file names is exceeded while running the tests. | 152 | ;; file names is exceeded while running the tests. |
| 151 | (let ((commit "fc34dee")) | 153 | (let ((commit "c2ee19e")) |
| 152 | (package (inherit guix-0.8.1) | 154 | (package (inherit guix-0.8.2) |
| 153 | (version (string-append "0.8.1." commit)) | 155 | (version (string-append "0.8.2." commit)) |
| 154 | (source (origin | 156 | (source (origin |
| 155 | (method git-fetch) | 157 | (method git-fetch) |
| 156 | (uri (git-reference | 158 | (uri (git-reference |
| @@ -158,9 +160,9 @@ the Nix package manager.") | |||
| 158 | (commit commit))) | 160 | (commit commit))) |
| 159 | (sha256 | 161 | (sha256 |
| 160 | (base32 | 162 | (base32 |
| 161 | "0nx60wwiar0s4bgwrm3nrskc54jig3vw7yzwxkwilc43cnlgpkja")))) | 163 | "1gwc1gypgscxg2m3n2vd0mw4dmxr7vsisqgh3y0lr05q9z5742sj")))) |
| 162 | (arguments | 164 | (arguments |
| 163 | (substitute-keyword-arguments (package-arguments guix-0.8.1) | 165 | (substitute-keyword-arguments (package-arguments guix-0.8.2) |
| 164 | ((#:phases phases) | 166 | ((#:phases phases) |
| 165 | `(alist-cons-after | 167 | `(alist-cons-after |
| 166 | 'unpack 'bootstrap | 168 | 'unpack 'bootstrap |
| @@ -178,7 +180,7 @@ the Nix package manager.") | |||
| 178 | ("gettext" ,gnu-gettext) | 180 | ("gettext" ,gnu-gettext) |
| 179 | ("texinfo" ,texinfo) | 181 | ("texinfo" ,texinfo) |
| 180 | ("graphviz" ,graphviz) | 182 | ("graphviz" ,graphviz) |
| 181 | ,@(package-native-inputs guix-0.8.1)))))) | 183 | ,@(package-native-inputs guix-0.8.2)))))) |
| 182 | 184 | ||
| 183 | (define-public guix guix-devel) | 185 | (define-public guix guix-devel) |
| 184 | 186 | ||
diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index 70595b1bac8..05d641fc365 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | (define-public parallel | 28 | (define-public parallel |
| 29 | (package | 29 | (package |
| 30 | (name "parallel") | 30 | (name "parallel") |
| 31 | (version "20150322") | 31 | (version "20150422") |
| 32 | (source | 32 | (source |
| 33 | (origin | 33 | (origin |
| 34 | (method url-fetch) | 34 | (method url-fetch) |
| @@ -36,7 +36,7 @@ | |||
| 36 | version ".tar.bz2")) | 36 | version ".tar.bz2")) |
| 37 | (sha256 | 37 | (sha256 |
| 38 | (base32 | 38 | (base32 |
| 39 | "1zsj1bd4zbwb4n9i0jgzs7vd5wkyg3xvj6s1q6s5fyn0pff7j01c")))) | 39 | "1x6lvbw6msjkibadihzr2s0mbbcx2h2wxd723q5bgz6mcnsml346")))) |
| 40 | (build-system gnu-build-system) | 40 | (build-system gnu-build-system) |
| 41 | (inputs `(("perl" ,perl))) | 41 | (inputs `(("perl" ,perl))) |
| 42 | (home-page "http://www.gnu.org/software/parallel/") | 42 | (home-page "http://www.gnu.org/software/parallel/") |
diff --git a/gnu/packages/patches/bitlbee-configure-doc-fix.patch b/gnu/packages/patches/bitlbee-configure-doc-fix.patch new file mode 100644 index 00000000000..ade0b7f25c5 --- /dev/null +++ b/gnu/packages/patches/bitlbee-configure-doc-fix.patch | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | Fix the check for the prebuilt helpfile when xsltproc is not available. | ||
| 2 | |||
| 3 | --- bitlbee-3.4/configure.orig 2015-03-25 18:09:10.000000000 -0400 | ||
| 4 | +++ bitlbee-3.4/configure 2015-05-20 14:51:33.627975970 -0400 | ||
| 5 | @@ -650,8 +650,8 @@ | ||
| 6 | |||
| 7 | if [ "$doc" = "1" ]; then | ||
| 8 | if [ ! -e doc/user-guide/help.txt ] && \ | ||
| 9 | - ! type xmlto > /dev/null 2> /dev/null || \ | ||
| 10 | - ! type xsltproc > /dev/null 2> /dev/null | ||
| 11 | + (! type xmlto > /dev/null 2> /dev/null || \ | ||
| 12 | + ! type xsltproc > /dev/null 2> /dev/null) | ||
| 13 | then | ||
| 14 | echo | ||
| 15 | echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.' | ||
diff --git a/gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch b/gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch deleted file mode 100644 index d2391d461d0..00000000000 --- a/gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | This patch updates 'configure' as autoreconf would have done after | ||
| 2 | applying curl-support-capath-on-gnutls.patch. | ||
| 3 | |||
| 4 | --- a/configure 2015-03-22 01:11:23.178743705 +0100 | ||
| 5 | +++ b/configure 2015-02-25 00:05:37.000000000 +0100 | ||
| 6 | @@ -23952,8 +24432,8 @@ | ||
| 7 | ca="$want_ca" | ||
| 8 | capath="no" | ||
| 9 | elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then | ||
| 10 | - if test "x$OPENSSL_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then | ||
| 11 | - as_fn_error $? "--with-ca-path only works with openSSL or PolarSSL" "$LINENO" 5 | ||
| 12 | + if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then | ||
| 13 | + as_fn_error $? "--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL" "$LINENO" 5 | ||
| 14 | fi | ||
| 15 | capath="$want_capath" | ||
| 16 | ca="no" | ||
diff --git a/gnu/packages/patches/curl-support-capath-on-gnutls.patch b/gnu/packages/patches/curl-support-capath-on-gnutls.patch deleted file mode 100644 index d05dd021e8c..00000000000 --- a/gnu/packages/patches/curl-support-capath-on-gnutls.patch +++ /dev/null | |||
| @@ -1,102 +0,0 @@ | |||
| 1 | This patch adds support for CURLOPT_CAPATH to the GnuTLS backend. | ||
| 2 | |||
| 3 | From 5a1614cecdd57cab8b4ae3e9bc19dfff5ba77e80 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Alessandro Ghedini <alessandro@ghedini.me> | ||
| 5 | Date: Sun, 8 Mar 2015 20:11:06 +0100 | ||
| 6 | Subject: [PATCH] gtls: add support for CURLOPT_CAPATH | ||
| 7 | |||
| 8 | --- | ||
| 9 | acinclude.m4 | 4 ++-- | ||
| 10 | docs/libcurl/opts/CURLOPT_CAPATH.3 | 5 ++--- | ||
| 11 | lib/vtls/gtls.c | 22 ++++++++++++++++++++++ | ||
| 12 | lib/vtls/gtls.h | 3 +++ | ||
| 13 | 4 files changed, 29 insertions(+), 5 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/acinclude.m4 b/acinclude.m4 | ||
| 16 | index 6ed7ffb..ca01869 100644 | ||
| 17 | --- a/acinclude.m4 | ||
| 18 | +++ b/acinclude.m4 | ||
| 19 | @@ -2615,8 +2615,8 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), | ||
| 20 | capath="no" | ||
| 21 | elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then | ||
| 22 | dnl --with-ca-path given | ||
| 23 | - if test "x$OPENSSL_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then | ||
| 24 | - AC_MSG_ERROR([--with-ca-path only works with openSSL or PolarSSL]) | ||
| 25 | + if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then | ||
| 26 | + AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL]) | ||
| 27 | fi | ||
| 28 | capath="$want_capath" | ||
| 29 | ca="no" | ||
| 30 | diff --git a/docs/libcurl/opts/CURLOPT_CAPATH.3 b/docs/libcurl/opts/CURLOPT_CAPATH.3 | ||
| 31 | index 642953d..6695f9f 100644 | ||
| 32 | --- a/docs/libcurl/opts/CURLOPT_CAPATH.3 | ||
| 33 | +++ b/docs/libcurl/opts/CURLOPT_CAPATH.3 | ||
| 34 | @@ -43,9 +43,8 @@ All TLS based protocols: HTTPS, FTPS, IMAPS, POP3, SMTPS etc. | ||
| 35 | .SH EXAMPLE | ||
| 36 | TODO | ||
| 37 | .SH AVAILABILITY | ||
| 38 | -This option is OpenSSL-specific and does nothing if libcurl is built to use | ||
| 39 | -GnuTLS. NSS-powered libcurl provides the option only for backward | ||
| 40 | -compatibility. | ||
| 41 | +This option is supported by the OpenSSL, GnuTLS and PolarSSL backends. The NSS | ||
| 42 | +backend provides the option only for backward compatibility. | ||
| 43 | .SH RETURN VALUE | ||
| 44 | Returns CURLE_OK if TLS enabled, and CURLE_UNKNOWN_OPTION if not, or | ||
| 45 | CURLE_OUT_OF_MEMORY if there was insufficient heap space. | ||
| 46 | diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c | ||
| 47 | index 05aef19..c792540 100644 | ||
| 48 | --- a/lib/vtls/gtls.c | ||
| 49 | +++ b/lib/vtls/gtls.c | ||
| 50 | @@ -97,6 +97,10 @@ static bool gtls_inited = FALSE; | ||
| 51 | # if (GNUTLS_VERSION_NUMBER >= 0x03020d) | ||
| 52 | # define HAS_OCSP | ||
| 53 | # endif | ||
| 54 | + | ||
| 55 | +# if (GNUTLS_VERSION_NUMBER >= 0x030306) | ||
| 56 | +# define HAS_CAPATH | ||
| 57 | +# endif | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #ifdef HAS_OCSP | ||
| 61 | @@ -462,6 +466,24 @@ gtls_connect_step1(struct connectdata *conn, | ||
| 62 | rc, data->set.ssl.CAfile); | ||
| 63 | } | ||
| 64 | |||
| 65 | +#ifdef HAS_CAPATH | ||
| 66 | + if(data->set.ssl.CApath) { | ||
| 67 | + /* set the trusted CA cert directory */ | ||
| 68 | + rc = gnutls_certificate_set_x509_trust_dir(conn->ssl[sockindex].cred, | ||
| 69 | + data->set.ssl.CApath, | ||
| 70 | + GNUTLS_X509_FMT_PEM); | ||
| 71 | + if(rc < 0) { | ||
| 72 | + infof(data, "error reading ca cert file %s (%s)\n", | ||
| 73 | + data->set.ssl.CAfile, gnutls_strerror(rc)); | ||
| 74 | + if(data->set.ssl.verifypeer) | ||
| 75 | + return CURLE_SSL_CACERT_BADFILE; | ||
| 76 | + } | ||
| 77 | + else | ||
| 78 | + infof(data, "found %d certificates in %s\n", | ||
| 79 | + rc, data->set.ssl.CApath); | ||
| 80 | + } | ||
| 81 | +#endif | ||
| 82 | + | ||
| 83 | if(data->set.ssl.CRLfile) { | ||
| 84 | /* set the CRL list file */ | ||
| 85 | rc = gnutls_certificate_set_x509_crl_file(conn->ssl[sockindex].cred, | ||
| 86 | diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h | ||
| 87 | index c3867e5..af1cb5b 100644 | ||
| 88 | --- a/lib/vtls/gtls.h | ||
| 89 | +++ b/lib/vtls/gtls.h | ||
| 90 | @@ -54,6 +54,9 @@ bool Curl_gtls_cert_status_request(void); | ||
| 91 | /* Set the API backend definition to GnuTLS */ | ||
| 92 | #define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS | ||
| 93 | |||
| 94 | +/* this backend supports the CAPATH option */ | ||
| 95 | +#define have_curlssl_ca_path 1 | ||
| 96 | + | ||
| 97 | /* API setup for GnuTLS */ | ||
| 98 | #define curlssl_init Curl_gtls_init | ||
| 99 | #define curlssl_cleanup Curl_gtls_cleanup | ||
| 100 | -- | ||
| 101 | 2.2.1 | ||
| 102 | |||
diff --git a/gnu/packages/patches/fltk-shared-lib-defines.patch b/gnu/packages/patches/fltk-shared-lib-defines.patch new file mode 100644 index 00000000000..d36a50ff5e3 --- /dev/null +++ b/gnu/packages/patches/fltk-shared-lib-defines.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | This patch from upstream revision 10588. | ||
| 2 | |||
| 3 | --- fltk-1.3.3/src/Xutf8.h | ||
| 4 | +++ fltk-1.3.3/src/Xutf8.h | ||
| 5 | @@ -25,6 +25,7 @@ | ||
| 6 | #include <X11/Xlib.h> | ||
| 7 | #include <X11/Xlocale.h> | ||
| 8 | #include <X11/Xutil.h> | ||
| 9 | +#include <FL/Fl_Export.H> | ||
| 10 | |||
| 11 | typedef struct { | ||
| 12 | int nb_font; | ||
| 13 | @@ -98,8 +99,8 @@ | ||
| 14 | XUtf8FontStruct *font_set, | ||
| 15 | unsigned int ucs); | ||
| 16 | |||
| 17 | -int | ||
| 18 | -XGetUtf8FontAndGlyph( | ||
| 19 | +FL_EXPORT int | ||
| 20 | +fl_XGetUtf8FontAndGlyph( | ||
| 21 | XUtf8FontStruct *font_set, | ||
| 22 | unsigned int ucs, | ||
| 23 | XFontStruct **fnt, | ||
| 24 | --- fltk-1.3.3/src/gl_draw.cxx | ||
| 25 | +++ fltk-1.3.3/src/gl_draw.cxx | ||
| 26 | @@ -114,7 +114,7 @@ | ||
| 27 | for (int i = 0; i < 0x400; i++) { | ||
| 28 | XFontStruct *font = NULL; | ||
| 29 | unsigned short id; | ||
| 30 | - XGetUtf8FontAndGlyph(gl_fontsize->font, ii, &font, &id); | ||
| 31 | + fl_XGetUtf8FontAndGlyph(gl_fontsize->font, ii, &font, &id); | ||
| 32 | if (font) glXUseXFont(font->fid, id, 1, gl_fontsize->listbase+ii); | ||
| 33 | ii++; | ||
| 34 | } | ||
| 35 | --- fltk-1.3.3/src/xutf8/utf8Wrap.c | ||
| 36 | +++ fltk-1.3.3/src/xutf8/utf8Wrap.c | ||
| 37 | @@ -816,10 +816,10 @@ | ||
| 38 | /** get the X font and glyph ID of a UCS char **/ | ||
| 39 | /*****************************************************************************/ | ||
| 40 | int | ||
| 41 | -XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set, | ||
| 42 | - unsigned int ucs, | ||
| 43 | - XFontStruct **fnt, | ||
| 44 | - unsigned short *id) { | ||
| 45 | +fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set, | ||
| 46 | + unsigned int ucs, | ||
| 47 | + XFontStruct **fnt, | ||
| 48 | + unsigned short *id) { | ||
| 49 | |||
| 50 | /* int x; */ | ||
| 51 | int *encodings; /* encodings array */ | ||
diff --git a/gnu/packages/patches/fuse-CVE-2015-3202.patch b/gnu/packages/patches/fuse-CVE-2015-3202.patch new file mode 100644 index 00000000000..7c64de76833 --- /dev/null +++ b/gnu/packages/patches/fuse-CVE-2015-3202.patch | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | The following patch was copied from Debian. | ||
| 2 | |||
| 3 | Description: Fix CVE-2015-3202 | ||
| 4 | Missing scrubbing of the environment before executing a mount or umount | ||
| 5 | of a filesystem. | ||
| 6 | Origin: upstream | ||
| 7 | Author: Miklos Szeredi <miklos@szeredi.hu> | ||
| 8 | Last-Update: 2015-05-19 | ||
| 9 | |||
| 10 | --- | ||
| 11 | lib/mount_util.c | 23 +++++++++++++++++------ | ||
| 12 | 1 file changed, 17 insertions(+), 6 deletions(-) | ||
| 13 | |||
| 14 | --- a/lib/mount_util.c | ||
| 15 | +++ b/lib/mount_util.c | ||
| 16 | @@ -95,10 +95,12 @@ static int add_mount(const char *prognam | ||
| 17 | goto out_restore; | ||
| 18 | } | ||
| 19 | if (res == 0) { | ||
| 20 | + char *env = NULL; | ||
| 21 | + | ||
| 22 | sigprocmask(SIG_SETMASK, &oldmask, NULL); | ||
| 23 | setuid(geteuid()); | ||
| 24 | - execl("/bin/mount", "/bin/mount", "--no-canonicalize", "-i", | ||
| 25 | - "-f", "-t", type, "-o", opts, fsname, mnt, NULL); | ||
| 26 | + execle("/bin/mount", "/bin/mount", "--no-canonicalize", "-i", | ||
| 27 | + "-f", "-t", type, "-o", opts, fsname, mnt, NULL, &env); | ||
| 28 | fprintf(stderr, "%s: failed to execute /bin/mount: %s\n", | ||
| 29 | progname, strerror(errno)); | ||
| 30 | exit(1); | ||
| 31 | @@ -146,10 +148,17 @@ static int exec_umount(const char *progn | ||
| 32 | goto out_restore; | ||
| 33 | } | ||
| 34 | if (res == 0) { | ||
| 35 | + char *env = NULL; | ||
| 36 | + | ||
| 37 | sigprocmask(SIG_SETMASK, &oldmask, NULL); | ||
| 38 | setuid(geteuid()); | ||
| 39 | - execl("/bin/umount", "/bin/umount", "-i", rel_mnt, | ||
| 40 | - lazy ? "-l" : NULL, NULL); | ||
| 41 | + if (lazy) { | ||
| 42 | + execle("/bin/umount", "/bin/umount", "-i", rel_mnt, | ||
| 43 | + "-l", NULL, &env); | ||
| 44 | + } else { | ||
| 45 | + execle("/bin/umount", "/bin/umount", "-i", rel_mnt, | ||
| 46 | + NULL, &env); | ||
| 47 | + } | ||
| 48 | fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", | ||
| 49 | progname, strerror(errno)); | ||
| 50 | exit(1); | ||
| 51 | @@ -205,10 +214,12 @@ static int remove_mount(const char *prog | ||
| 52 | goto out_restore; | ||
| 53 | } | ||
| 54 | if (res == 0) { | ||
| 55 | + char *env = NULL; | ||
| 56 | + | ||
| 57 | sigprocmask(SIG_SETMASK, &oldmask, NULL); | ||
| 58 | setuid(geteuid()); | ||
| 59 | - execl("/bin/umount", "/bin/umount", "--no-canonicalize", "-i", | ||
| 60 | - "--fake", mnt, NULL); | ||
| 61 | + execle("/bin/umount", "/bin/umount", "--no-canonicalize", "-i", | ||
| 62 | + "--fake", mnt, NULL, &env); | ||
| 63 | fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", | ||
| 64 | progname, strerror(errno)); | ||
| 65 | exit(1); | ||
diff --git a/gnu/packages/patches/gcc-5.0-libvtv-runpath.patch b/gnu/packages/patches/gcc-5.0-libvtv-runpath.patch new file mode 100644 index 00000000000..9a9bc5ca530 --- /dev/null +++ b/gnu/packages/patches/gcc-5.0-libvtv-runpath.patch | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | GCC 4.9 and later have libvtv and, just like libstdc++ (see | ||
| 2 | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354), it doesn't | ||
| 3 | have $libdir in its RUNPATH, but it NEEDs libgcc_s. This patch | ||
| 4 | fixes that. | ||
| 5 | |||
| 6 | --- gcc-5.1.0/libvtv/Makefile.in 2014-10-30 09:28:58.000000000 +0100 | ||
| 7 | +++ gcc-5.1.0/libvtv/Makefile.in 2015-04-30 09:51:04.161129705 +0200 | ||
| 8 | @@ -15,6 +15,7 @@ | ||
| 9 | |||
| 10 | @SET_MAKE@ | ||
| 11 | |||
| 12 | +libvtv_la_LDFLAGS = -Wl,-rpath=$(libdir) | ||
| 13 | |||
| 14 | VPATH = @srcdir@ | ||
| 15 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
diff --git a/gnu/packages/patches/gnutls-fix-duplicate-manpages.patch b/gnu/packages/patches/gnutls-fix-duplicate-manpages.patch deleted file mode 100644 index 95a25560e5b..00000000000 --- a/gnu/packages/patches/gnutls-fix-duplicate-manpages.patch +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | Remove duplicate manpage entries from Makefile. | ||
| 2 | |||
| 3 | --- gnutls-3.4.0/doc/manpages/Makefile.am.orig 2015-04-06 04:48:30.000000000 -0400 | ||
| 4 | +++ gnutls-3.4.0/doc/manpages/Makefile.am 2015-04-12 16:52:58.029694525 -0400 | ||
| 5 | @@ -134,11 +134,8 @@ | ||
| 6 | APIMANS += gnutls_certificate_get_peers_subkey_id.3 | ||
| 7 | APIMANS += gnutls_certificate_get_trust_list.3 | ||
| 8 | APIMANS += gnutls_certificate_get_verify_flags.3 | ||
| 9 | -APIMANS += gnutls_certificate_get_verify_flags.3 | ||
| 10 | -APIMANS += gnutls_certificate_get_x509_crt.3 | ||
| 11 | APIMANS += gnutls_certificate_get_x509_crt.3 | ||
| 12 | APIMANS += gnutls_certificate_get_x509_key.3 | ||
| 13 | -APIMANS += gnutls_certificate_get_x509_key.3 | ||
| 14 | APIMANS += gnutls_certificate_send_x509_rdn_sequence.3 | ||
| 15 | APIMANS += gnutls_certificate_server_set_request.3 | ||
| 16 | APIMANS += gnutls_certificate_set_dh_params.3 | ||
| 17 | --- gnutls-3.4.0/doc/manpages/Makefile.in.orig 2015-04-08 02:08:30.000000000 -0400 | ||
| 18 | +++ gnutls-3.4.0/doc/manpages/Makefile.in 2015-04-12 16:53:13.319694530 -0400 | ||
| 19 | @@ -1275,11 +1275,8 @@ | ||
| 20 | gnutls_certificate_get_peers_subkey_id.3 \ | ||
| 21 | gnutls_certificate_get_trust_list.3 \ | ||
| 22 | gnutls_certificate_get_verify_flags.3 \ | ||
| 23 | - gnutls_certificate_get_verify_flags.3 \ | ||
| 24 | - gnutls_certificate_get_x509_crt.3 \ | ||
| 25 | gnutls_certificate_get_x509_crt.3 \ | ||
| 26 | gnutls_certificate_get_x509_key.3 \ | ||
| 27 | - gnutls_certificate_get_x509_key.3 \ | ||
| 28 | gnutls_certificate_send_x509_rdn_sequence.3 \ | ||
| 29 | gnutls_certificate_server_set_request.3 \ | ||
| 30 | gnutls_certificate_set_dh_params.3 \ | ||
diff --git a/gnu/packages/patches/guix-test-networking.patch b/gnu/packages/patches/guix-test-networking.patch deleted file mode 100644 index a8d1f4fd2f1..00000000000 --- a/gnu/packages/patches/guix-test-networking.patch +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | Skip that test when the network is unreachable. | ||
| 2 | |||
| 3 | diff --git a/tests/packages.scm b/tests/packages.scm | ||
| 4 | index 04e3b0b..6ac215b 100644 | ||
| 5 | --- a/tests/packages.scm | ||
| 6 | +++ b/tests/packages.scm | ||
| 7 | @@ -139,6 +139,8 @@ | ||
| 8 | (and (direct-store-path? source) | ||
| 9 | (string-suffix? "utils.scm" source)))) | ||
| 10 | |||
| 11 | +(unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)) | ||
| 12 | + (test-skip 1)) | ||
| 13 | (test-equal "package-source-derivation, snippet" | ||
| 14 | "OK" | ||
| 15 | (let* ((file (search-bootstrap-binary "guile-2.0.9.tar.xz" | ||
diff --git a/gnu/packages/patches/hop-linker-flags.patch b/gnu/packages/patches/hop-linker-flags.patch new file mode 100644 index 00000000000..f1f5dbfbd92 --- /dev/null +++ b/gnu/packages/patches/hop-linker-flags.patch | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | Make hop's link rules honor flags set by the --blflags configure argument. | ||
| 2 | |||
| 3 | --- hop-2.4.0/src/Makefile 2015-05-05 19:41:04.800151036 -0500 | ||
| 4 | +++ hop-2.4.0/src/Makefile 2015-05-05 19:40:40.916150417 -0500 | ||
| 5 | @@ -69,10 +69,10 @@ | ||
| 6 | $(MAKE) link.$(LINK) DEST=$@ | ||
| 7 | |||
| 8 | link.dynamic: | ||
| 9 | - @ $(call link,$(BIGLOO),$(BCFLAGS),$(BCFLAGSDEV),$(OBJECTS),-o,$(DEST)) | ||
| 10 | + @ $(call link,$(BIGLOO),$(BCFLAGS) $(BLFLAGS),$(BCFLAGSDEV),$(OBJECTS),-o,$(DEST)) | ||
| 11 | |||
| 12 | link.static: | ||
| 13 | - @ $(call link,$(BIGLOO),$(BCFLAGS),$(BCFLAGSDEV),-static-all-bigloo $(OBJECTS),-o,$(DEST)) | ||
| 14 | + @ $(call link,$(BIGLOO),$(BCFLAGS) $(BLFLAGS),$(BCFLAGSDEV),-static-all-bigloo $(OBJECTS),-o,$(DEST)) | ||
| 15 | |||
| 16 | link.library: | ||
| 17 | echo "***ERROR: link.library not currently supported!" | ||
| 18 | --- hop-2.4.0/hopc/Makefile 2013-01-30 07:17:59.000000000 -0600 | ||
| 19 | +++ hop-2.4.0/hopc/Makefile 2015-05-05 19:45:21.876157699 -0500 | ||
| 20 | @@ -62,7 +62,7 @@ | ||
| 21 | mkdir -p $@ | ||
| 22 | |||
| 23 | $(BUILDBINDIR)/$(EXEC): .afile .etags $(OBJECTS) | ||
| 24 | - @ $(call link,$(BIGLOO),$(BCFLAGS),,$(OBJECTS),-o,$@) | ||
| 25 | + @ $(call link,$(BIGLOO),$(BCFLAGS) $(BLFLAGS),$(BCFLAGSDEV),$(OBJECTS),-o,$@) | ||
| 26 | |||
| 27 | $(BUILDBINDIR)/$(EXEC).jar: .afile .etags .jfile $(BGL_CLASSES) META-INF/MANIFEST.MF jvm-stdlibs jvm-share jvm-lib | ||
| 28 | $(JAR) $@ META-INF/MANIFEST.MF -C o/class_s . | ||
| 29 | --- hop-2.4.0/hophz/Makefile 2013-01-30 07:17:59.000000000 -0600 | ||
| 30 | +++ hop-2.4.0/hophz/Makefile 2015-05-05 19:59:42.996180030 -0500 | ||
| 31 | @@ -16,9 +16,6 @@ | ||
| 32 | -include ../etc/Makefile.hopconfig | ||
| 33 | -include ../etc/Makefile.version | ||
| 34 | |||
| 35 | -BLFLAGS = | ||
| 36 | -BLINKFLAGS = -suffix hop | ||
| 37 | - | ||
| 38 | #*---------------------------------------------------------------------*/ | ||
| 39 | #* Target and Project */ | ||
| 40 | #*---------------------------------------------------------------------*/ | ||
| 41 | @@ -72,7 +69,7 @@ | ||
| 42 | mkdir -p $@ | ||
| 43 | |||
| 44 | $(BUILDBINDIR)/$(EXEC): .afile .etags $(OBJECTS) | ||
| 45 | - @ $(call link,$(BIGLOO),$(BCFLAGS),$(BLINKFLAGS),$(OBJECTS),-o,$@) | ||
| 46 | + @ $(call link,$(BIGLOO),$(BCFLAGS) $(BLFLAGS),$(BCFLAGSDEV),$(OBJECTS),-o,$@) | ||
| 47 | |||
| 48 | $(BUILDBINDIR)/$(EXEC).jar: .afile .etags .jfile $(BGL_CLASSES) META-INF/MANIFEST.MF jvm-stdlibs jvm-share jvm-lib | ||
| 49 | @ $(JAR) $@ META-INF/MANIFEST.MF -C o/class_s . | ||
| 50 | --- hop-2.4.0/hopsh/Makefile 2013-01-30 07:17:59.000000000 -0600 | ||
| 51 | +++ hop-2.4.0/hopsh/Makefile 2015-05-05 19:46:36.060159626 -0500 | ||
| 52 | @@ -60,7 +60,7 @@ | ||
| 53 | mkdir -p $@ | ||
| 54 | |||
| 55 | $(BUILDBINDIR)/$(EXEC): .afile .etags $(OBJECTS) | ||
| 56 | - @ $(call link,$(BIGLOO),$(BCFLAGS),$(BCFLAGSDEV),$(OBJECTS),-o,$@) | ||
| 57 | + @ $(call link,$(BIGLOO),$(BCFLAGS) $(BLFLAGS),$(BCFLAGSDEV),$(OBJECTS),-o,$@) | ||
| 58 | |||
| 59 | $(BUILDBINDIR)/$(EXEC).jar: .afile .etags .jfile $(BGL_CLASSES) META-INF/MANIFEST.MF jvm-stdlibs jvm-share jvm-lib | ||
| 60 | @ $(JAR) $@ META-INF/MANIFEST.MF -C o/class_s . | ||
diff --git a/gnu/packages/patches/inetutils-syslogd.patch b/gnu/packages/patches/inetutils-syslogd.patch deleted file mode 100644 index 0bf9eb7fc60..00000000000 --- a/gnu/packages/patches/inetutils-syslogd.patch +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | From <http://lists.gnu.org/archive/html/bug-inetutils/2015-04/msg00001.html>. | ||
| 2 | |||
| 3 | 2015-04-01 Ludovic Courtès <ludo@gnu.org> | ||
| 4 | |||
| 5 | * src/syslogd.c (load_conffile): Use 'bcopy' instead of 'strcpy' | ||
| 6 | since the two regions may overlap. | ||
| 7 | Reported by Alex Kost <alezost@gmail.com> | ||
| 8 | at <http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00780.html>. | ||
| 9 | |||
| 10 | --- a/src/syslogd.c | ||
| 11 | +++ b/src/syslogd.c | ||
| 12 | @@ -1989,7 +1989,7 @@ load_conffile (const char *filename, struct filed **nextp) | ||
| 13 | if (*p == '\0' || *p == '#') | ||
| 14 | continue; | ||
| 15 | |||
| 16 | - strcpy (cline, p); | ||
| 17 | + bcopy (p, cline, strlen (p) + 1); | ||
| 18 | |||
| 19 | /* Cut the trailing spaces. */ | ||
| 20 | for (p = strchr (cline, '\0'); isspace (*--p);) | ||
diff --git a/gnu/packages/patches/libtool-skip-tests.patch b/gnu/packages/patches/libtool-skip-tests.patch deleted file mode 100644 index 9191d404879..00000000000 --- a/gnu/packages/patches/libtool-skip-tests.patch +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | Because our GCC 'lib' spec automatically adds '-rpath' for each '-L' | ||
| 2 | and a couple more '-rpath, there are two test failures: | ||
| 3 | one in demo.test, and one in destdir.at. Disable these. | ||
| 4 | |||
| 5 | Also skip the nopic test on ARM and MIPS systems. | ||
| 6 | |||
| 7 | --- libtool-2.4.6/tests/demo.at.orig 2015-01-16 13:52:04.000000000 -0500 | ||
| 8 | +++ libtool-2.4.6/tests/demo.at 2015-02-16 10:48:51.435851966 -0500 | ||
| 9 | @@ -510,7 +510,7 @@ | ||
| 10 | AT_SETUP([force non-PIC objects]) | ||
| 11 | |||
| 12 | AT_CHECK([case $host in | ||
| 13 | -hppa*|x86_64*|s390*) | ||
| 14 | +hppa*|x86_64*|s390*|arm*|mips*) | ||
| 15 | # These hosts cannot use non-PIC shared libs | ||
| 16 | exit 77 ;; | ||
| 17 | *-solaris*|*-sunos*) | ||
| 18 | --- libtool-2.4.6/tests/testsuite.orig 2015-02-15 11:15:25.000000000 -0500 | ||
| 19 | +++ libtool-2.4.6/tests/testsuite 2015-02-16 10:50:58.736483216 -0500 | ||
| 20 | @@ -8741,7 +8741,7 @@ | ||
| 21 | |||
| 22 | { set +x | ||
| 23 | $as_echo "$at_srcdir/demo.at:535: case \$host in | ||
| 24 | -hppa*|x86_64*|s390*) | ||
| 25 | +hppa*|x86_64*|s390*|arm*|mips*) | ||
| 26 | # These hosts cannot use non-PIC shared libs | ||
| 27 | exit 77 ;; | ||
| 28 | *-solaris*|*-sunos*) | ||
| 29 | @@ -8766,7 +8766,7 @@ | ||
| 30 | " | ||
| 31 | at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535" | ||
| 32 | ( $at_check_trace; case $host in | ||
| 33 | -hppa*|x86_64*|s390*) | ||
| 34 | +hppa*|x86_64*|s390*|arm*|mips*) | ||
| 35 | # These hosts cannot use non-PIC shared libs | ||
| 36 | exit 77 ;; | ||
| 37 | *-solaris*|*-sunos*) | ||
| 38 | @@ -9298,7 +9298,7 @@ | ||
| 39 | #AT_START_34 | ||
| 40 | at_fn_group_banner 34 'demo.at:548' \ | ||
| 41 | "hardcoding library path" " " 4 | ||
| 42 | -at_xfail=no | ||
| 43 | +at_xfail=yes | ||
| 44 | test no = "$ACLOCAL" && at_xfail=yes | ||
| 45 | test no = "$AUTOHEADER" && at_xfail=yes | ||
| 46 | test no = "$AUTOMAKE" && at_xfail=yes | ||
| 47 | @@ -27243,7 +27243,7 @@ | ||
| 48 | #AT_START_98 | ||
| 49 | at_fn_group_banner 98 'destdir.at:75' \ | ||
| 50 | "DESTDIR with in-package deplibs" " " 8 | ||
| 51 | -at_xfail=no | ||
| 52 | +at_xfail=yes | ||
| 53 | eval `$LIBTOOL --config | $GREP '^fast_install='` | ||
| 54 | case $fast_install in no) :;; *) false;; esac && at_xfail=yes | ||
| 55 | ( | ||
diff --git a/gnu/packages/patches/linux-libre-libreboot-fix.patch b/gnu/packages/patches/linux-libre-libreboot-fix.patch deleted file mode 100644 index d340a99fcb2..00000000000 --- a/gnu/packages/patches/linux-libre-libreboot-fix.patch +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | This patch fixes linux-libre-3.19.x on Libreboot X60 machines. | ||
| 2 | Copied from https://bugzilla.kernel.org/show_bug.cgi?id=93171#c25 | ||
| 3 | |||
| 4 | --- a/drivers/gpu/drm/i915/i915_irq.c | ||
| 5 | +++ a/drivers/gpu/drm/i915/i915_irq.c | ||
| 6 | @@ -3598,14 +3598,12 @@ static int i8xx_irq_postinstall(struct drm_device *dev) | ||
| 7 | ~(I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | | ||
| 8 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT | | ||
| 9 | I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT | | ||
| 10 | - I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT | | ||
| 11 | - I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); | ||
| 12 | + I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT); | ||
| 13 | I915_WRITE16(IMR, dev_priv->irq_mask); | ||
| 14 | |||
| 15 | I915_WRITE16(IER, | ||
| 16 | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | | ||
| 17 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT | | ||
| 18 | - I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT | | ||
| 19 | I915_USER_INTERRUPT); | ||
| 20 | POSTING_READ16(IER); | ||
| 21 | |||
| 22 | @@ -3767,14 +3765,12 @@ static int i915_irq_postinstall(struct drm_device *dev) | ||
| 23 | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | | ||
| 24 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT | | ||
| 25 | I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT | | ||
| 26 | - I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT | | ||
| 27 | - I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); | ||
| 28 | + I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT); | ||
| 29 | |||
| 30 | enable_mask = | ||
| 31 | I915_ASLE_INTERRUPT | | ||
| 32 | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | | ||
| 33 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT | | ||
| 34 | - I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT | | ||
| 35 | I915_USER_INTERRUPT; | ||
| 36 | |||
| 37 | if (I915_HAS_HOTPLUG(dev)) { | ||
diff --git a/gnu/packages/patches/maxima-defsystem-mkdir.patch b/gnu/packages/patches/maxima-defsystem-mkdir.patch new file mode 100644 index 00000000000..bc42e51a32d --- /dev/null +++ b/gnu/packages/patches/maxima-defsystem-mkdir.patch | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | Change 'ensure-directories-exist' to look for 'mkdir' in $PATH, not in /bin. | ||
| 2 | |||
| 3 | --- maxima-5.36.1/lisp-utils/defsystem.lisp.orig 2014-11-22 16:21:30.000000000 -0500 | ||
| 4 | +++ maxima-5.36.1/lisp-utils/defsystem.lisp 2015-05-25 21:53:31.223648483 -0400 | ||
| 5 | @@ -4627,7 +4627,7 @@ | ||
| 6 | (cmd (if (member :win32 *features*) | ||
| 7 | (format nil "mkdir \"~a\"" | ||
| 8 | (coerce (subst #\\ #\/ (coerce (namestring dir) 'list)) 'string)) | ||
| 9 | - (format nil "/bin/mkdir -p ~S" (namestring dir))))) | ||
| 10 | + (format nil "mkdir -p ~S" (namestring dir))))) | ||
| 11 | (unless (directory dir) | ||
| 12 | (lisp:system cmd)) | ||
| 13 | ;; The second return value is supposed to be T if directories were | ||
diff --git a/gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch b/gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch deleted file mode 100644 index 2f8b159870c..00000000000 --- a/gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | From resolution of upstream python issue #20901: http://bugs.python.org/issue20901 | ||
| 2 | |||
| 3 | diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py | ||
| 4 | --- Lib/sqlite3/test/hooks.py | ||
| 5 | +++ Lib/sqlite3/test/hooks.py | ||
| 6 | @@ -162,7 +162,7 @@ class ProgressTests(unittest.TestCase): | ||
| 7 | create table bar (a, b) | ||
| 8 | """) | ||
| 9 | second_count = len(progress_calls) | ||
| 10 | - self.assertGreater(first_count, second_count) | ||
| 11 | + self.assertGreaterEqual(first_count, second_count) | ||
| 12 | |||
| 13 | def CheckCancelOperation(self): | ||
| 14 | """ | ||
| 15 | |||
diff --git a/gnu/packages/patches/qemu-CVE-2015-3209.patch b/gnu/packages/patches/qemu-CVE-2015-3209.patch new file mode 100644 index 00000000000..0bb726698cf --- /dev/null +++ b/gnu/packages/patches/qemu-CVE-2015-3209.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From 9f7c594c006289ad41169b854d70f5da6e400a2a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Petr Matousek <pmatouse@redhat.com> | ||
| 3 | Date: Sun, 24 May 2015 10:53:44 +0200 | ||
| 4 | Subject: [PATCH] pcnet: force the buffer access to be in bounds during tx | ||
| 5 | |||
| 6 | 4096 is the maximum length per TMD and it is also currently the size of | ||
| 7 | the relay buffer pcnet driver uses for sending the packet data to QEMU | ||
| 8 | for further processing. With packet spanning multiple TMDs it can | ||
| 9 | happen that the overall packet size will be bigger than sizeof(buffer), | ||
| 10 | which results in memory corruption. | ||
| 11 | |||
| 12 | Fix this by only allowing to queue maximum sizeof(buffer) bytes. | ||
| 13 | |||
| 14 | This is CVE-2015-3209. | ||
| 15 | |||
| 16 | [Fixed 3-space indentation to QEMU's 4-space coding standard. | ||
| 17 | --Stefan] | ||
| 18 | |||
| 19 | Signed-off-by: Petr Matousek <pmatouse@redhat.com> | ||
| 20 | Reported-by: Matt Tait <matttait@google.com> | ||
| 21 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
| 22 | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
| 23 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
| 24 | --- | ||
| 25 | hw/net/pcnet.c | 8 ++++++++ | ||
| 26 | 1 file changed, 8 insertions(+) | ||
| 27 | |||
| 28 | diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c | ||
| 29 | index bdfd38f..68b9981 100644 | ||
| 30 | --- a/hw/net/pcnet.c | ||
| 31 | +++ b/hw/net/pcnet.c | ||
| 32 | @@ -1241,6 +1241,14 @@ static void pcnet_transmit(PCNetState *s) | ||
| 33 | } | ||
| 34 | |||
| 35 | bcnt = 4096 - GET_FIELD(tmd.length, TMDL, BCNT); | ||
| 36 | + | ||
| 37 | + /* if multi-tmd packet outsizes s->buffer then skip it silently. | ||
| 38 | + Note: this is not what real hw does */ | ||
| 39 | + if (s->xmit_pos + bcnt > sizeof(s->buffer)) { | ||
| 40 | + s->xmit_pos = -1; | ||
| 41 | + goto txdone; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | s->phys_mem_read(s->dma_opaque, PHYSADDR(s, tmd.tbadr), | ||
| 45 | s->buffer + s->xmit_pos, bcnt, CSR_BSWP(s)); | ||
| 46 | s->xmit_pos += bcnt; | ||
| 47 | -- | ||
| 48 | 2.2.1 | ||
| 49 | |||
diff --git a/gnu/packages/patches/qemu-CVE-2015-3456.patch b/gnu/packages/patches/qemu-CVE-2015-3456.patch new file mode 100644 index 00000000000..9514f7c3e51 --- /dev/null +++ b/gnu/packages/patches/qemu-CVE-2015-3456.patch | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | From e907746266721f305d67bc0718795fedee2e824c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Petr Matousek <pmatouse@redhat.com> | ||
| 3 | Date: Wed, 6 May 2015 09:48:59 +0200 | ||
| 4 | Subject: [PATCH] fdc: force the fifo access to be in bounds of the allocated | ||
| 5 | buffer | ||
| 6 | |||
| 7 | During processing of certain commands such as FD_CMD_READ_ID and | ||
| 8 | FD_CMD_DRIVE_SPECIFICATION_COMMAND the fifo memory access could | ||
| 9 | get out of bounds leading to memory corruption with values coming | ||
| 10 | from the guest. | ||
| 11 | |||
| 12 | Fix this by making sure that the index is always bounded by the | ||
| 13 | allocated memory. | ||
| 14 | |||
| 15 | This is CVE-2015-3456. | ||
| 16 | |||
| 17 | Signed-off-by: Petr Matousek <pmatouse@redhat.com> | ||
| 18 | Reviewed-by: John Snow <jsnow@redhat.com> | ||
| 19 | Signed-off-by: John Snow <jsnow@redhat.com> | ||
| 20 | --- | ||
| 21 | hw/block/fdc.c | 17 +++++++++++------ | ||
| 22 | 1 file changed, 11 insertions(+), 6 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/hw/block/fdc.c b/hw/block/fdc.c | ||
| 25 | index f72a392..d8a8edd 100644 | ||
| 26 | --- a/hw/block/fdc.c | ||
| 27 | +++ b/hw/block/fdc.c | ||
| 28 | @@ -1497,7 +1497,7 @@ static uint32_t fdctrl_read_data(FDCtrl *fdctrl) | ||
| 29 | { | ||
| 30 | FDrive *cur_drv; | ||
| 31 | uint32_t retval = 0; | ||
| 32 | - int pos; | ||
| 33 | + uint32_t pos; | ||
| 34 | |||
| 35 | cur_drv = get_cur_drv(fdctrl); | ||
| 36 | fdctrl->dsr &= ~FD_DSR_PWRDOWN; | ||
| 37 | @@ -1506,8 +1506,8 @@ static uint32_t fdctrl_read_data(FDCtrl *fdctrl) | ||
| 38 | return 0; | ||
| 39 | } | ||
| 40 | pos = fdctrl->data_pos; | ||
| 41 | + pos %= FD_SECTOR_LEN; | ||
| 42 | if (fdctrl->msr & FD_MSR_NONDMA) { | ||
| 43 | - pos %= FD_SECTOR_LEN; | ||
| 44 | if (pos == 0) { | ||
| 45 | if (fdctrl->data_pos != 0) | ||
| 46 | if (!fdctrl_seek_to_next_sect(fdctrl, cur_drv)) { | ||
| 47 | @@ -1852,10 +1852,13 @@ static void fdctrl_handle_option(FDCtrl *fdctrl, int direction) | ||
| 48 | static void fdctrl_handle_drive_specification_command(FDCtrl *fdctrl, int direction) | ||
| 49 | { | ||
| 50 | FDrive *cur_drv = get_cur_drv(fdctrl); | ||
| 51 | + uint32_t pos; | ||
| 52 | |||
| 53 | - if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) { | ||
| 54 | + pos = fdctrl->data_pos - 1; | ||
| 55 | + pos %= FD_SECTOR_LEN; | ||
| 56 | + if (fdctrl->fifo[pos] & 0x80) { | ||
| 57 | /* Command parameters done */ | ||
| 58 | - if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) { | ||
| 59 | + if (fdctrl->fifo[pos] & 0x40) { | ||
| 60 | fdctrl->fifo[0] = fdctrl->fifo[1]; | ||
| 61 | fdctrl->fifo[2] = 0; | ||
| 62 | fdctrl->fifo[3] = 0; | ||
| 63 | @@ -1955,7 +1958,7 @@ static uint8_t command_to_handler[256]; | ||
| 64 | static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value) | ||
| 65 | { | ||
| 66 | FDrive *cur_drv; | ||
| 67 | - int pos; | ||
| 68 | + uint32_t pos; | ||
| 69 | |||
| 70 | /* Reset mode */ | ||
| 71 | if (!(fdctrl->dor & FD_DOR_nRESET)) { | ||
| 72 | @@ -2004,7 +2007,9 @@ static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value) | ||
| 73 | } | ||
| 74 | |||
| 75 | FLOPPY_DPRINTF("%s: %02x\n", __func__, value); | ||
| 76 | - fdctrl->fifo[fdctrl->data_pos++] = value; | ||
| 77 | + pos = fdctrl->data_pos++; | ||
| 78 | + pos %= FD_SECTOR_LEN; | ||
| 79 | + fdctrl->fifo[pos] = value; | ||
| 80 | if (fdctrl->data_pos == fdctrl->data_len) { | ||
| 81 | /* We now have all parameters | ||
| 82 | * and will be able to treat the command | ||
| 83 | -- | ||
| 84 | 2.2.1 | ||
| 85 | |||
diff --git a/gnu/packages/patches/r-fix-15899.patch b/gnu/packages/patches/r-fix-15899.patch new file mode 100644 index 00000000000..40593d34e62 --- /dev/null +++ b/gnu/packages/patches/r-fix-15899.patch | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | Without the "extern" keyword external applications linking against R (such as | ||
| 2 | Shogun, for example) might not be linkable. | ||
| 3 | |||
| 4 | See https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15899 for details | ||
| 5 | about this bug. | ||
| 6 | |||
| 7 | --- a/src/include/Rinterface.h (revision 66251) | ||
| 8 | +++ b/src/include/Rinterface.h (working copy) | ||
| 9 | @@ -84,7 +84,7 @@ | ||
| 10 | void fpu_setup(Rboolean); | ||
| 11 | |||
| 12 | /* in unix/system.c */ | ||
| 13 | -int R_running_as_main_program; | ||
| 14 | +extern int R_running_as_main_program; | ||
| 15 | |||
| 16 | #ifdef CSTACK_DEFNS | ||
| 17 | /* duplicating Defn.h */ | ||
diff --git a/gnu/packages/patches/rsem-makefile.patch b/gnu/packages/patches/rsem-makefile.patch new file mode 100644 index 00000000000..5481dc685f1 --- /dev/null +++ b/gnu/packages/patches/rsem-makefile.patch | |||
| @@ -0,0 +1,682 @@ | |||
| 1 | This patch simplifies the Makefile, making it much easier to build rsem | ||
| 2 | without the bundled version of samtools. It has already been submitted | ||
| 3 | upstream: https://github.com/bli25wisc/RSEM/pull/11 | ||
| 4 | |||
| 5 | From 161894e91a16c7e15af57e4fcfe8cb613711c7fa Mon Sep 17 00:00:00 2001 | ||
| 6 | From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | ||
| 7 | Date: Wed, 22 Apr 2015 14:51:07 +0200 | ||
| 8 | Subject: [PATCH 1/7] remove all headers from Makefile | ||
| 9 | |||
| 10 | --- | ||
| 11 | Makefile | 95 +++++++++++----------------------------------------------------- | ||
| 12 | 1 file changed, 16 insertions(+), 79 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/Makefile b/Makefile | ||
| 15 | index 54e2603..3a55ed8 100644 | ||
| 16 | --- a/Makefile | ||
| 17 | +++ b/Makefile | ||
| 18 | @@ -10,133 +10,70 @@ all : $(PROGRAMS) | ||
| 19 | sam/libbam.a : | ||
| 20 | cd sam ; ${MAKE} all | ||
| 21 | |||
| 22 | -Transcript.h : utils.h | ||
| 23 | - | ||
| 24 | -Transcripts.h : utils.h my_assert.h Transcript.h | ||
| 25 | - | ||
| 26 | -rsem-extract-reference-transcripts : utils.h my_assert.h GTFItem.h Transcript.h Transcripts.h extractRef.cpp | ||
| 27 | +rsem-extract-reference-transcripts : extractRef.cpp | ||
| 28 | $(CC) -Wall -O3 extractRef.cpp -o rsem-extract-reference-transcripts | ||
| 29 | |||
| 30 | -rsem-synthesis-reference-transcripts : utils.h my_assert.h Transcript.h Transcripts.h synthesisRef.cpp | ||
| 31 | +rsem-synthesis-reference-transcripts : synthesisRef.cpp | ||
| 32 | $(CC) -Wall -O3 synthesisRef.cpp -o rsem-synthesis-reference-transcripts | ||
| 33 | |||
| 34 | -BowtieRefSeqPolicy.h : RefSeqPolicy.h | ||
| 35 | - | ||
| 36 | -RefSeq.h : utils.h | ||
| 37 | - | ||
| 38 | -Refs.h : utils.h RefSeq.h RefSeqPolicy.h PolyARules.h | ||
| 39 | - | ||
| 40 | - | ||
| 41 | rsem-preref : preRef.o | ||
| 42 | $(CC) preRef.o -o rsem-preref | ||
| 43 | |||
| 44 | -preRef.o : utils.h RefSeq.h Refs.h PolyARules.h RefSeqPolicy.h AlignerRefSeqPolicy.h preRef.cpp | ||
| 45 | +preRef.o : preRef.cpp | ||
| 46 | $(CC) $(COFLAGS) preRef.cpp | ||
| 47 | |||
| 48 | - | ||
| 49 | -SingleRead.h : Read.h | ||
| 50 | - | ||
| 51 | -SingleReadQ.h : Read.h | ||
| 52 | - | ||
| 53 | -PairedEndRead.h : Read.h SingleRead.h | ||
| 54 | - | ||
| 55 | -PairedEndReadQ.h : Read.h SingleReadQ.h | ||
| 56 | - | ||
| 57 | - | ||
| 58 | -PairedEndHit.h : SingleHit.h | ||
| 59 | - | ||
| 60 | -HitContainer.h : GroupInfo.h | ||
| 61 | - | ||
| 62 | - | ||
| 63 | -SamParser.h : sam/sam.h sam/bam.h utils.h my_assert.h SingleRead.h SingleReadQ.h PairedEndRead.h PairedEndReadQ.h SingleHit.h PairedEndHit.h Transcripts.h | ||
| 64 | - | ||
| 65 | - | ||
| 66 | rsem-parse-alignments : parseIt.o sam/libbam.a | ||
| 67 | $(CC) -o rsem-parse-alignments parseIt.o sam/libbam.a -lz -lpthread | ||
| 68 | |||
| 69 | -parseIt.o : utils.h GroupInfo.h Read.h SingleRead.h SingleReadQ.h PairedEndRead.h PairedEndReadQ.h SingleHit.h PairedEndHit.h HitContainer.h SamParser.h Transcripts.h sam/sam.h sam/bam.h parseIt.cpp | ||
| 70 | +parseIt.o : parseIt.cpp | ||
| 71 | $(CC) -Wall -O2 -c -I. parseIt.cpp | ||
| 72 | |||
| 73 | - | ||
| 74 | -rsem-build-read-index : utils.h buildReadIndex.cpp | ||
| 75 | +rsem-build-read-index : buildReadIndex.cpp | ||
| 76 | $(CC) -O3 buildReadIndex.cpp -o rsem-build-read-index | ||
| 77 | |||
| 78 | - | ||
| 79 | -simul.h : boost/random.hpp | ||
| 80 | - | ||
| 81 | -ReadReader.h : SingleRead.h SingleReadQ.h PairedEndRead.h PairedEndReadQ.h ReadIndex.h | ||
| 82 | - | ||
| 83 | -SingleModel.h : utils.h my_assert.h Orientation.h LenDist.h RSPD.h Profile.h NoiseProfile.h ModelParams.h RefSeq.h Refs.h SingleRead.h SingleHit.h ReadReader.h simul.h | ||
| 84 | - | ||
| 85 | -SingleQModel.h : utils.h my_assert.h Orientation.h LenDist.h RSPD.h QualDist.h QProfile.h NoiseQProfile.h ModelParams.h RefSeq.h Refs.h SingleReadQ.h SingleHit.h ReadReader.h simul.h | ||
| 86 | - | ||
| 87 | -PairedEndModel.h : utils.h my_assert.h Orientation.h LenDist.h RSPD.h Profile.h NoiseProfile.h ModelParams.h RefSeq.h Refs.h SingleRead.h PairedEndRead.h PairedEndHit.h ReadReader.h simul.h | ||
| 88 | - | ||
| 89 | -PairedEndQModel.h : utils.h my_assert.h Orientation.h LenDist.h RSPD.h QualDist.h QProfile.h NoiseQProfile.h ModelParams.h RefSeq.h Refs.h SingleReadQ.h PairedEndReadQ.h PairedEndHit.h ReadReader.h simul.h | ||
| 90 | - | ||
| 91 | -HitWrapper.h : HitContainer.h | ||
| 92 | - | ||
| 93 | -sam_rsem_aux.h : sam/bam.h | ||
| 94 | - | ||
| 95 | -sam_rsem_cvt.h : sam/bam.h Transcript.h Transcripts.h | ||
| 96 | - | ||
| 97 | -BamWriter.h : sam/sam.h sam/bam.h sam_rsem_aux.h sam_rsem_cvt.h SingleHit.h PairedEndHit.h HitWrapper.h Transcript.h Transcripts.h | ||
| 98 | - | ||
| 99 | -sampling.h : boost/random.hpp | ||
| 100 | - | ||
| 101 | -WriteResults.h : utils.h my_assert.h GroupInfo.h Transcript.h Transcripts.h RefSeq.h Refs.h Model.h SingleModel.h SingleQModel.h PairedEndModel.h PairedEndQModel.h | ||
| 102 | - | ||
| 103 | rsem-run-em : EM.o sam/libbam.a | ||
| 104 | $(CC) -o rsem-run-em EM.o sam/libbam.a -lz -lpthread | ||
| 105 | |||
| 106 | -EM.o : utils.h my_assert.h Read.h SingleRead.h SingleReadQ.h PairedEndRead.h PairedEndReadQ.h SingleHit.h PairedEndHit.h Model.h SingleModel.h SingleQModel.h PairedEndModel.h PairedEndQModel.h Refs.h GroupInfo.h HitContainer.h ReadIndex.h ReadReader.h Orientation.h LenDist.h RSPD.h QualDist.h QProfile.h NoiseQProfile.h ModelParams.h RefSeq.h RefSeqPolicy.h PolyARules.h Profile.h NoiseProfile.h Transcript.h Transcripts.h HitWrapper.h BamWriter.h sam/bam.h sam/sam.h simul.h sam_rsem_aux.h sampling.h boost/random.hpp WriteResults.h EM.cpp | ||
| 107 | +EM.o : EM.cpp | ||
| 108 | $(CC) $(COFLAGS) EM.cpp | ||
| 109 | |||
| 110 | -bc_aux.h : sam/bam.h | ||
| 111 | - | ||
| 112 | -BamConverter.h : utils.h my_assert.h sam/sam.h sam/bam.h sam_rsem_aux.h sam_rsem_cvt.h bc_aux.h Transcript.h Transcripts.h | ||
| 113 | - | ||
| 114 | -rsem-tbam2gbam : utils.h Transcripts.h Transcript.h bc_aux.h BamConverter.h sam/sam.h sam/bam.h sam/libbam.a sam_rsem_aux.h sam_rsem_cvt.h tbam2gbam.cpp sam/libbam.a | ||
| 115 | +rsem-tbam2gbam : tbam2gbam.cpp sam/libbam.a | ||
| 116 | $(CC) -O3 -Wall tbam2gbam.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 117 | |||
| 118 | -rsem-bam2wig : utils.h my_assert.h wiggle.h wiggle.o sam/libbam.a bam2wig.cpp | ||
| 119 | +rsem-bam2wig : wiggle.o sam/libbam.a bam2wig.cpp | ||
| 120 | $(CC) -O3 -Wall bam2wig.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 121 | |||
| 122 | -rsem-bam2readdepth : utils.h my_assert.h wiggle.h wiggle.o sam/libbam.a bam2readdepth.cpp | ||
| 123 | +rsem-bam2readdepth : wiggle.o sam/libbam.a bam2readdepth.cpp | ||
| 124 | $(CC) -O3 -Wall bam2readdepth.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 125 | |||
| 126 | -wiggle.o: sam/bam.h sam/sam.h wiggle.cpp wiggle.h | ||
| 127 | +wiggle.o: wiggle.cpp | ||
| 128 | $(CC) $(COFLAGS) wiggle.cpp | ||
| 129 | |||
| 130 | rsem-simulate-reads : simulation.o | ||
| 131 | $(CC) -o rsem-simulate-reads simulation.o | ||
| 132 | |||
| 133 | -simulation.o : utils.h Read.h SingleRead.h SingleReadQ.h PairedEndRead.h PairedEndReadQ.h Model.h SingleModel.h SingleQModel.h PairedEndModel.h PairedEndQModel.h Refs.h RefSeq.h GroupInfo.h Transcript.h Transcripts.h Orientation.h LenDist.h RSPD.h QualDist.h QProfile.h NoiseQProfile.h Profile.h NoiseProfile.h simul.h boost/random.hpp WriteResults.h simulation.cpp | ||
| 134 | +simulation.o : simulation.cpp | ||
| 135 | $(CC) $(COFLAGS) simulation.cpp | ||
| 136 | |||
| 137 | rsem-run-gibbs : Gibbs.o | ||
| 138 | $(CC) -o rsem-run-gibbs Gibbs.o -lpthread | ||
| 139 | |||
| 140 | -#some header files are omitted | ||
| 141 | -Gibbs.o : utils.h my_assert.h boost/random.hpp sampling.h Model.h SingleModel.h SingleQModel.h PairedEndModel.h PairedEndQModel.h RefSeq.h RefSeqPolicy.h PolyARules.h Refs.h GroupInfo.h WriteResults.h Gibbs.cpp | ||
| 142 | +Gibbs.o : Gibbs.cpp | ||
| 143 | $(CC) $(COFLAGS) Gibbs.cpp | ||
| 144 | |||
| 145 | -Buffer.h : my_assert.h | ||
| 146 | - | ||
| 147 | rsem-calculate-credibility-intervals : calcCI.o | ||
| 148 | $(CC) -o rsem-calculate-credibility-intervals calcCI.o -lpthread | ||
| 149 | |||
| 150 | -#some header files are omitted | ||
| 151 | -calcCI.o : utils.h my_assert.h boost/random.hpp sampling.h Model.h SingleModel.h SingleQModel.h PairedEndModel.h PairedEndQModel.h RefSeq.h RefSeqPolicy.h PolyARules.h Refs.h GroupInfo.h WriteResults.h Buffer.h calcCI.cpp | ||
| 152 | +calcCI.o : calcCI.cpp | ||
| 153 | $(CC) $(COFLAGS) calcCI.cpp | ||
| 154 | |||
| 155 | -rsem-get-unique : sam/bam.h sam/sam.h getUnique.cpp sam/libbam.a | ||
| 156 | +rsem-get-unique : getUnique.cpp sam/libbam.a | ||
| 157 | $(CC) -O3 -Wall getUnique.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 158 | |||
| 159 | -rsem-sam-validator : sam/bam.h sam/sam.h my_assert.h samValidator.cpp sam/libbam.a | ||
| 160 | +rsem-sam-validator : samValidator.cpp sam/libbam.a | ||
| 161 | $(CC) -O3 -Wall samValidator.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 162 | |||
| 163 | -rsem-scan-for-paired-end-reads : sam/bam.h sam/sam.h my_assert.h scanForPairedEndReads.cpp sam/libbam.a | ||
| 164 | +rsem-scan-for-paired-end-reads : scanForPairedEndReads.cpp sam/libbam.a | ||
| 165 | $(CC) -O3 -Wall scanForPairedEndReads.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 166 | |||
| 167 | ebseq : | ||
| 168 | |||
| 169 | From ec136638a727632e20abfaeb65c22c46d15ca8c4 Mon Sep 17 00:00:00 2001 | ||
| 170 | From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | ||
| 171 | Date: Wed, 22 Apr 2015 15:06:41 +0200 | ||
| 172 | Subject: [PATCH 2/7] include current dir, ./sam and ./boost by default | ||
| 173 | |||
| 174 | --- | ||
| 175 | Makefile | 48 ++++++++++++++++++++++++------------------------ | ||
| 176 | 1 file changed, 24 insertions(+), 24 deletions(-) | ||
| 177 | |||
| 178 | diff --git a/Makefile b/Makefile | ||
| 179 | index 3a55ed8..1dd97ca 100644 | ||
| 180 | --- a/Makefile | ||
| 181 | +++ b/Makefile | ||
| 182 | @@ -1,6 +1,6 @@ | ||
| 183 | CC = g++ | ||
| 184 | -CFLAGS = -Wall -c -I. | ||
| 185 | -COFLAGS = -Wall -O3 -ffast-math -c -I. | ||
| 186 | +CFLAGS = -Wall -I. -I./sam -I./boost | ||
| 187 | +COFLAGS = -O3 -ffast-math -c | ||
| 188 | PROGRAMS = rsem-extract-reference-transcripts rsem-synthesis-reference-transcripts rsem-preref rsem-parse-alignments rsem-build-read-index rsem-run-em rsem-tbam2gbam rsem-run-gibbs rsem-calculate-credibility-intervals rsem-simulate-reads rsem-bam2wig rsem-get-unique rsem-bam2readdepth rsem-sam-validator rsem-scan-for-paired-end-reads | ||
| 189 | |||
| 190 | .PHONY : all ebseq clean | ||
| 191 | @@ -11,70 +11,70 @@ sam/libbam.a : | ||
| 192 | cd sam ; ${MAKE} all | ||
| 193 | |||
| 194 | rsem-extract-reference-transcripts : extractRef.cpp | ||
| 195 | - $(CC) -Wall -O3 extractRef.cpp -o rsem-extract-reference-transcripts | ||
| 196 | + $(CC) $(CFLAGS) -O3 extractRef.cpp -o rsem-extract-reference-transcripts | ||
| 197 | |||
| 198 | rsem-synthesis-reference-transcripts : synthesisRef.cpp | ||
| 199 | - $(CC) -Wall -O3 synthesisRef.cpp -o rsem-synthesis-reference-transcripts | ||
| 200 | + $(CC) $(CFLAGS) -O3 synthesisRef.cpp -o rsem-synthesis-reference-transcripts | ||
| 201 | |||
| 202 | rsem-preref : preRef.o | ||
| 203 | - $(CC) preRef.o -o rsem-preref | ||
| 204 | + $(CC) $(CFLAGS) preRef.o -o rsem-preref | ||
| 205 | |||
| 206 | preRef.o : preRef.cpp | ||
| 207 | - $(CC) $(COFLAGS) preRef.cpp | ||
| 208 | + $(CC) $(CFLAGS) $(COFLAGS) preRef.cpp | ||
| 209 | |||
| 210 | rsem-parse-alignments : parseIt.o sam/libbam.a | ||
| 211 | - $(CC) -o rsem-parse-alignments parseIt.o sam/libbam.a -lz -lpthread | ||
| 212 | + $(CC) $(CFLAGS) -o rsem-parse-alignments parseIt.o sam/libbam.a -lz -lpthread | ||
| 213 | |||
| 214 | parseIt.o : parseIt.cpp | ||
| 215 | - $(CC) -Wall -O2 -c -I. parseIt.cpp | ||
| 216 | + $(CC) $(CFLAGS) -O2 -c parseIt.cpp | ||
| 217 | |||
| 218 | rsem-build-read-index : buildReadIndex.cpp | ||
| 219 | - $(CC) -O3 buildReadIndex.cpp -o rsem-build-read-index | ||
| 220 | + $(CC) $(CFLAGS) -O3 buildReadIndex.cpp -o rsem-build-read-index | ||
| 221 | |||
| 222 | rsem-run-em : EM.o sam/libbam.a | ||
| 223 | - $(CC) -o rsem-run-em EM.o sam/libbam.a -lz -lpthread | ||
| 224 | + $(CC) $(CFLAGS) -o rsem-run-em EM.o sam/libbam.a -lz -lpthread | ||
| 225 | |||
| 226 | EM.o : EM.cpp | ||
| 227 | - $(CC) $(COFLAGS) EM.cpp | ||
| 228 | + $(CC) $(CFLAGS) $(COFLAGS) EM.cpp | ||
| 229 | |||
| 230 | rsem-tbam2gbam : tbam2gbam.cpp sam/libbam.a | ||
| 231 | - $(CC) -O3 -Wall tbam2gbam.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 232 | + $(CC) $(CFLAGS) -O3 tbam2gbam.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 233 | |||
| 234 | rsem-bam2wig : wiggle.o sam/libbam.a bam2wig.cpp | ||
| 235 | - $(CC) -O3 -Wall bam2wig.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 236 | + $(CC) $(CFLAGS) -O3 bam2wig.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 237 | |||
| 238 | rsem-bam2readdepth : wiggle.o sam/libbam.a bam2readdepth.cpp | ||
| 239 | - $(CC) -O3 -Wall bam2readdepth.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 240 | + $(CC) $(CFLAGS) -O3 bam2readdepth.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 241 | |||
| 242 | wiggle.o: wiggle.cpp | ||
| 243 | - $(CC) $(COFLAGS) wiggle.cpp | ||
| 244 | + $(CC) $(CFLAGS) $(COFLAGS) wiggle.cpp | ||
| 245 | |||
| 246 | rsem-simulate-reads : simulation.o | ||
| 247 | - $(CC) -o rsem-simulate-reads simulation.o | ||
| 248 | + $(CC) $(CFLAGS) -o rsem-simulate-reads simulation.o | ||
| 249 | |||
| 250 | simulation.o : simulation.cpp | ||
| 251 | - $(CC) $(COFLAGS) simulation.cpp | ||
| 252 | + $(CC) $(CFLAGS) $(COFLAGS) simulation.cpp | ||
| 253 | |||
| 254 | rsem-run-gibbs : Gibbs.o | ||
| 255 | - $(CC) -o rsem-run-gibbs Gibbs.o -lpthread | ||
| 256 | + $(CC) $(CFLAGS) -o rsem-run-gibbs Gibbs.o -lpthread | ||
| 257 | |||
| 258 | Gibbs.o : Gibbs.cpp | ||
| 259 | - $(CC) $(COFLAGS) Gibbs.cpp | ||
| 260 | + $(CC) $(CFLAGS) $(COFLAGS) Gibbs.cpp | ||
| 261 | |||
| 262 | rsem-calculate-credibility-intervals : calcCI.o | ||
| 263 | - $(CC) -o rsem-calculate-credibility-intervals calcCI.o -lpthread | ||
| 264 | + $(CC) $(CFLAGS) -o rsem-calculate-credibility-intervals calcCI.o -lpthread | ||
| 265 | |||
| 266 | calcCI.o : calcCI.cpp | ||
| 267 | - $(CC) $(COFLAGS) calcCI.cpp | ||
| 268 | + $(CC) $(CFLAGS) $(COFLAGS) calcCI.cpp | ||
| 269 | |||
| 270 | rsem-get-unique : getUnique.cpp sam/libbam.a | ||
| 271 | - $(CC) -O3 -Wall getUnique.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 272 | + $(CC) $(CFLAGS) -O3 getUnique.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 273 | |||
| 274 | rsem-sam-validator : samValidator.cpp sam/libbam.a | ||
| 275 | - $(CC) -O3 -Wall samValidator.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 276 | + $(CC) $(CFLAGS) -O3 samValidator.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 277 | |||
| 278 | rsem-scan-for-paired-end-reads : scanForPairedEndReads.cpp sam/libbam.a | ||
| 279 | - $(CC) -O3 -Wall scanForPairedEndReads.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 280 | + $(CC) $(CFLAGS) -O3 scanForPairedEndReads.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 281 | |||
| 282 | ebseq : | ||
| 283 | cd EBSeq ; ${MAKE} all | ||
| 284 | |||
| 285 | From d366614ea50f79fdd93e3c76383ccb6fcdeaa8e0 Mon Sep 17 00:00:00 2001 | ||
| 286 | From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | ||
| 287 | Date: Wed, 22 Apr 2015 15:10:49 +0200 | ||
| 288 | Subject: [PATCH 3/7] separate object rules from rules for executables | ||
| 289 | |||
| 290 | --- | ||
| 291 | Makefile | 50 ++++++++++++++++++++++++++------------------------ | ||
| 292 | 1 file changed, 26 insertions(+), 24 deletions(-) | ||
| 293 | |||
| 294 | diff --git a/Makefile b/Makefile | ||
| 295 | index 1dd97ca..ae4de3b 100644 | ||
| 296 | --- a/Makefile | ||
| 297 | +++ b/Makefile | ||
| 298 | @@ -10,6 +10,32 @@ all : $(PROGRAMS) | ||
| 299 | sam/libbam.a : | ||
| 300 | cd sam ; ${MAKE} all | ||
| 301 | |||
| 302 | +ebseq : | ||
| 303 | + cd EBSeq ; ${MAKE} all | ||
| 304 | + | ||
| 305 | + | ||
| 306 | +calcCI.o : calcCI.cpp | ||
| 307 | + $(CC) $(CFLAGS) $(COFLAGS) calcCI.cpp | ||
| 308 | + | ||
| 309 | +EM.o : EM.cpp | ||
| 310 | + $(CC) $(CFLAGS) $(COFLAGS) EM.cpp | ||
| 311 | + | ||
| 312 | +Gibbs.o : Gibbs.cpp | ||
| 313 | + $(CC) $(CFLAGS) $(COFLAGS) Gibbs.cpp | ||
| 314 | + | ||
| 315 | +preRef.o : preRef.cpp | ||
| 316 | + $(CC) $(CFLAGS) $(COFLAGS) preRef.cpp | ||
| 317 | + | ||
| 318 | +parseIt.o : parseIt.cpp | ||
| 319 | + $(CC) $(CFLAGS) -O2 -c parseIt.cpp | ||
| 320 | + | ||
| 321 | +simulation.o : simulation.cpp | ||
| 322 | + $(CC) $(CFLAGS) $(COFLAGS) simulation.cpp | ||
| 323 | + | ||
| 324 | +wiggle.o: wiggle.cpp | ||
| 325 | + $(CC) $(CFLAGS) $(COFLAGS) wiggle.cpp | ||
| 326 | + | ||
| 327 | + | ||
| 328 | rsem-extract-reference-transcripts : extractRef.cpp | ||
| 329 | $(CC) $(CFLAGS) -O3 extractRef.cpp -o rsem-extract-reference-transcripts | ||
| 330 | |||
| 331 | @@ -19,24 +45,15 @@ rsem-synthesis-reference-transcripts : synthesisRef.cpp | ||
| 332 | rsem-preref : preRef.o | ||
| 333 | $(CC) $(CFLAGS) preRef.o -o rsem-preref | ||
| 334 | |||
| 335 | -preRef.o : preRef.cpp | ||
| 336 | - $(CC) $(CFLAGS) $(COFLAGS) preRef.cpp | ||
| 337 | - | ||
| 338 | rsem-parse-alignments : parseIt.o sam/libbam.a | ||
| 339 | $(CC) $(CFLAGS) -o rsem-parse-alignments parseIt.o sam/libbam.a -lz -lpthread | ||
| 340 | |||
| 341 | -parseIt.o : parseIt.cpp | ||
| 342 | - $(CC) $(CFLAGS) -O2 -c parseIt.cpp | ||
| 343 | - | ||
| 344 | rsem-build-read-index : buildReadIndex.cpp | ||
| 345 | $(CC) $(CFLAGS) -O3 buildReadIndex.cpp -o rsem-build-read-index | ||
| 346 | |||
| 347 | rsem-run-em : EM.o sam/libbam.a | ||
| 348 | $(CC) $(CFLAGS) -o rsem-run-em EM.o sam/libbam.a -lz -lpthread | ||
| 349 | |||
| 350 | -EM.o : EM.cpp | ||
| 351 | - $(CC) $(CFLAGS) $(COFLAGS) EM.cpp | ||
| 352 | - | ||
| 353 | rsem-tbam2gbam : tbam2gbam.cpp sam/libbam.a | ||
| 354 | $(CC) $(CFLAGS) -O3 tbam2gbam.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 355 | |||
| 356 | @@ -46,27 +63,15 @@ rsem-bam2wig : wiggle.o sam/libbam.a bam2wig.cpp | ||
| 357 | rsem-bam2readdepth : wiggle.o sam/libbam.a bam2readdepth.cpp | ||
| 358 | $(CC) $(CFLAGS) -O3 bam2readdepth.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 359 | |||
| 360 | -wiggle.o: wiggle.cpp | ||
| 361 | - $(CC) $(CFLAGS) $(COFLAGS) wiggle.cpp | ||
| 362 | - | ||
| 363 | rsem-simulate-reads : simulation.o | ||
| 364 | $(CC) $(CFLAGS) -o rsem-simulate-reads simulation.o | ||
| 365 | |||
| 366 | -simulation.o : simulation.cpp | ||
| 367 | - $(CC) $(CFLAGS) $(COFLAGS) simulation.cpp | ||
| 368 | - | ||
| 369 | rsem-run-gibbs : Gibbs.o | ||
| 370 | $(CC) $(CFLAGS) -o rsem-run-gibbs Gibbs.o -lpthread | ||
| 371 | |||
| 372 | -Gibbs.o : Gibbs.cpp | ||
| 373 | - $(CC) $(CFLAGS) $(COFLAGS) Gibbs.cpp | ||
| 374 | - | ||
| 375 | rsem-calculate-credibility-intervals : calcCI.o | ||
| 376 | $(CC) $(CFLAGS) -o rsem-calculate-credibility-intervals calcCI.o -lpthread | ||
| 377 | |||
| 378 | -calcCI.o : calcCI.cpp | ||
| 379 | - $(CC) $(CFLAGS) $(COFLAGS) calcCI.cpp | ||
| 380 | - | ||
| 381 | rsem-get-unique : getUnique.cpp sam/libbam.a | ||
| 382 | $(CC) $(CFLAGS) -O3 getUnique.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 383 | |||
| 384 | @@ -76,9 +81,6 @@ rsem-sam-validator : samValidator.cpp sam/libbam.a | ||
| 385 | rsem-scan-for-paired-end-reads : scanForPairedEndReads.cpp sam/libbam.a | ||
| 386 | $(CC) $(CFLAGS) -O3 scanForPairedEndReads.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 387 | |||
| 388 | -ebseq : | ||
| 389 | - cd EBSeq ; ${MAKE} all | ||
| 390 | - | ||
| 391 | clean : | ||
| 392 | rm -f *.o *~ $(PROGRAMS) | ||
| 393 | cd sam ; ${MAKE} clean | ||
| 394 | |||
| 395 | From 6ba1c33cccdf7c8e7df7a3189e7db204be3b1e8d Mon Sep 17 00:00:00 2001 | ||
| 396 | From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | ||
| 397 | Date: Wed, 22 Apr 2015 15:28:30 +0200 | ||
| 398 | Subject: [PATCH 4/7] add ./sam to library directories, link with -lbam | ||
| 399 | |||
| 400 | --- | ||
| 401 | Makefile | 36 ++++++++++++++++++------------------ | ||
| 402 | 1 file changed, 18 insertions(+), 18 deletions(-) | ||
| 403 | |||
| 404 | diff --git a/Makefile b/Makefile | ||
| 405 | index ae4de3b..a87cc4d 100644 | ||
| 406 | --- a/Makefile | ||
| 407 | +++ b/Makefile | ||
| 408 | @@ -1,11 +1,11 @@ | ||
| 409 | CC = g++ | ||
| 410 | -CFLAGS = -Wall -I. -I./sam -I./boost | ||
| 411 | +CFLAGS = -Wall -I. -I./sam -I./boost -L./sam | ||
| 412 | COFLAGS = -O3 -ffast-math -c | ||
| 413 | PROGRAMS = rsem-extract-reference-transcripts rsem-synthesis-reference-transcripts rsem-preref rsem-parse-alignments rsem-build-read-index rsem-run-em rsem-tbam2gbam rsem-run-gibbs rsem-calculate-credibility-intervals rsem-simulate-reads rsem-bam2wig rsem-get-unique rsem-bam2readdepth rsem-sam-validator rsem-scan-for-paired-end-reads | ||
| 414 | |||
| 415 | .PHONY : all ebseq clean | ||
| 416 | |||
| 417 | -all : $(PROGRAMS) | ||
| 418 | +all : sam/libbam.a $(PROGRAMS) | ||
| 419 | |||
| 420 | sam/libbam.a : | ||
| 421 | cd sam ; ${MAKE} all | ||
| 422 | @@ -45,23 +45,23 @@ rsem-synthesis-reference-transcripts : synthesisRef.cpp | ||
| 423 | rsem-preref : preRef.o | ||
| 424 | $(CC) $(CFLAGS) preRef.o -o rsem-preref | ||
| 425 | |||
| 426 | -rsem-parse-alignments : parseIt.o sam/libbam.a | ||
| 427 | - $(CC) $(CFLAGS) -o rsem-parse-alignments parseIt.o sam/libbam.a -lz -lpthread | ||
| 428 | +rsem-parse-alignments : parseIt.o | ||
| 429 | + $(CC) $(CFLAGS) -o rsem-parse-alignments parseIt.o -lbam -lz -lpthread | ||
| 430 | |||
| 431 | rsem-build-read-index : buildReadIndex.cpp | ||
| 432 | $(CC) $(CFLAGS) -O3 buildReadIndex.cpp -o rsem-build-read-index | ||
| 433 | |||
| 434 | -rsem-run-em : EM.o sam/libbam.a | ||
| 435 | - $(CC) $(CFLAGS) -o rsem-run-em EM.o sam/libbam.a -lz -lpthread | ||
| 436 | +rsem-run-em : EM.o | ||
| 437 | + $(CC) $(CFLAGS) -o rsem-run-em EM.o -lbam -lz -lpthread | ||
| 438 | |||
| 439 | -rsem-tbam2gbam : tbam2gbam.cpp sam/libbam.a | ||
| 440 | - $(CC) $(CFLAGS) -O3 tbam2gbam.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 441 | +rsem-tbam2gbam : tbam2gbam.cpp | ||
| 442 | + $(CC) $(CFLAGS) -O3 tbam2gbam.cpp -lbam -lz -lpthread -o $@ | ||
| 443 | |||
| 444 | -rsem-bam2wig : wiggle.o sam/libbam.a bam2wig.cpp | ||
| 445 | - $(CC) $(CFLAGS) -O3 bam2wig.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 446 | +rsem-bam2wig : wiggle.o bam2wig.cpp | ||
| 447 | + $(CC) $(CFLAGS) -O3 bam2wig.cpp wiggle.o -lbam -lz -lpthread -o $@ | ||
| 448 | |||
| 449 | -rsem-bam2readdepth : wiggle.o sam/libbam.a bam2readdepth.cpp | ||
| 450 | - $(CC) $(CFLAGS) -O3 bam2readdepth.cpp wiggle.o sam/libbam.a -lz -lpthread -o $@ | ||
| 451 | +rsem-bam2readdepth : wiggle.o bam2readdepth.cpp | ||
| 452 | + $(CC) $(CFLAGS) -O3 bam2readdepth.cpp wiggle.o -lbam -lz -lpthread -o $@ | ||
| 453 | |||
| 454 | rsem-simulate-reads : simulation.o | ||
| 455 | $(CC) $(CFLAGS) -o rsem-simulate-reads simulation.o | ||
| 456 | @@ -72,14 +72,14 @@ rsem-run-gibbs : Gibbs.o | ||
| 457 | rsem-calculate-credibility-intervals : calcCI.o | ||
| 458 | $(CC) $(CFLAGS) -o rsem-calculate-credibility-intervals calcCI.o -lpthread | ||
| 459 | |||
| 460 | -rsem-get-unique : getUnique.cpp sam/libbam.a | ||
| 461 | - $(CC) $(CFLAGS) -O3 getUnique.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 462 | +rsem-get-unique : getUnique.cpp | ||
| 463 | + $(CC) $(CFLAGS) -O3 getUnique.cpp -lbam -lz -lpthread -o $@ | ||
| 464 | |||
| 465 | -rsem-sam-validator : samValidator.cpp sam/libbam.a | ||
| 466 | - $(CC) $(CFLAGS) -O3 samValidator.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 467 | +rsem-sam-validator : samValidator.cpp | ||
| 468 | + $(CC) $(CFLAGS) -O3 samValidator.cpp -lbam -lz -lpthread -o $@ | ||
| 469 | |||
| 470 | -rsem-scan-for-paired-end-reads : scanForPairedEndReads.cpp sam/libbam.a | ||
| 471 | - $(CC) $(CFLAGS) -O3 scanForPairedEndReads.cpp sam/libbam.a -lz -lpthread -o $@ | ||
| 472 | +rsem-scan-for-paired-end-reads : scanForPairedEndReads.cpp | ||
| 473 | + $(CC) $(CFLAGS) -O3 scanForPairedEndReads.cpp -lbam -lz -lpthread -o $@ | ||
| 474 | |||
| 475 | clean : | ||
| 476 | rm -f *.o *~ $(PROGRAMS) | ||
| 477 | |||
| 478 | From 5402b88c269df79ee245c1c59e15f3c8282a0220 Mon Sep 17 00:00:00 2001 | ||
| 479 | From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | ||
| 480 | Date: Wed, 22 Apr 2015 15:33:02 +0200 | ||
| 481 | Subject: [PATCH 5/7] do not repeat target name, use $@ instead | ||
| 482 | |||
| 483 | --- | ||
| 484 | Makefile | 18 +++++++++--------- | ||
| 485 | 1 file changed, 9 insertions(+), 9 deletions(-) | ||
| 486 | |||
| 487 | diff --git a/Makefile b/Makefile | ||
| 488 | index a87cc4d..7ec90a3 100644 | ||
| 489 | --- a/Makefile | ||
| 490 | +++ b/Makefile | ||
| 491 | @@ -37,22 +37,22 @@ wiggle.o: wiggle.cpp | ||
| 492 | |||
| 493 | |||
| 494 | rsem-extract-reference-transcripts : extractRef.cpp | ||
| 495 | - $(CC) $(CFLAGS) -O3 extractRef.cpp -o rsem-extract-reference-transcripts | ||
| 496 | + $(CC) $(CFLAGS) -O3 extractRef.cpp -o $@ | ||
| 497 | |||
| 498 | rsem-synthesis-reference-transcripts : synthesisRef.cpp | ||
| 499 | - $(CC) $(CFLAGS) -O3 synthesisRef.cpp -o rsem-synthesis-reference-transcripts | ||
| 500 | + $(CC) $(CFLAGS) -O3 synthesisRef.cpp -o $@ | ||
| 501 | |||
| 502 | rsem-preref : preRef.o | ||
| 503 | - $(CC) $(CFLAGS) preRef.o -o rsem-preref | ||
| 504 | + $(CC) $(CFLAGS) preRef.o -o $@ | ||
| 505 | |||
| 506 | rsem-parse-alignments : parseIt.o | ||
| 507 | - $(CC) $(CFLAGS) -o rsem-parse-alignments parseIt.o -lbam -lz -lpthread | ||
| 508 | + $(CC) $(CFLAGS) -o $@ parseIt.o -lbam -lz -lpthread | ||
| 509 | |||
| 510 | rsem-build-read-index : buildReadIndex.cpp | ||
| 511 | - $(CC) $(CFLAGS) -O3 buildReadIndex.cpp -o rsem-build-read-index | ||
| 512 | + $(CC) $(CFLAGS) -O3 buildReadIndex.cpp -o $@ | ||
| 513 | |||
| 514 | rsem-run-em : EM.o | ||
| 515 | - $(CC) $(CFLAGS) -o rsem-run-em EM.o -lbam -lz -lpthread | ||
| 516 | + $(CC) $(CFLAGS) -o $@ EM.o -lbam -lz -lpthread | ||
| 517 | |||
| 518 | rsem-tbam2gbam : tbam2gbam.cpp | ||
| 519 | $(CC) $(CFLAGS) -O3 tbam2gbam.cpp -lbam -lz -lpthread -o $@ | ||
| 520 | @@ -64,13 +64,13 @@ rsem-bam2readdepth : wiggle.o bam2readdepth.cpp | ||
| 521 | $(CC) $(CFLAGS) -O3 bam2readdepth.cpp wiggle.o -lbam -lz -lpthread -o $@ | ||
| 522 | |||
| 523 | rsem-simulate-reads : simulation.o | ||
| 524 | - $(CC) $(CFLAGS) -o rsem-simulate-reads simulation.o | ||
| 525 | + $(CC) $(CFLAGS) -o $@ simulation.o | ||
| 526 | |||
| 527 | rsem-run-gibbs : Gibbs.o | ||
| 528 | - $(CC) $(CFLAGS) -o rsem-run-gibbs Gibbs.o -lpthread | ||
| 529 | + $(CC) $(CFLAGS) -o $@ Gibbs.o -lpthread | ||
| 530 | |||
| 531 | rsem-calculate-credibility-intervals : calcCI.o | ||
| 532 | - $(CC) $(CFLAGS) -o rsem-calculate-credibility-intervals calcCI.o -lpthread | ||
| 533 | + $(CC) $(CFLAGS) -o $@ calcCI.o -lpthread | ||
| 534 | |||
| 535 | rsem-get-unique : getUnique.cpp | ||
| 536 | $(CC) $(CFLAGS) -O3 getUnique.cpp -lbam -lz -lpthread -o $@ | ||
| 537 | |||
| 538 | From f60784bc7aa303cc825bd87dd3f5d7d26c51bded Mon Sep 17 00:00:00 2001 | ||
| 539 | From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | ||
| 540 | Date: Wed, 22 Apr 2015 15:44:53 +0200 | ||
| 541 | Subject: [PATCH 6/7] use automatic variables to refer to prerequisites | ||
| 542 | |||
| 543 | --- | ||
| 544 | Makefile | 44 ++++++++++++++++++++++---------------------- | ||
| 545 | 1 file changed, 22 insertions(+), 22 deletions(-) | ||
| 546 | |||
| 547 | diff --git a/Makefile b/Makefile | ||
| 548 | index 7ec90a3..6540d81 100644 | ||
| 549 | --- a/Makefile | ||
| 550 | +++ b/Makefile | ||
| 551 | @@ -15,71 +15,71 @@ ebseq : | ||
| 552 | |||
| 553 | |||
| 554 | calcCI.o : calcCI.cpp | ||
| 555 | - $(CC) $(CFLAGS) $(COFLAGS) calcCI.cpp | ||
| 556 | + $(CC) $(CFLAGS) $(COFLAGS) $< | ||
| 557 | |||
| 558 | EM.o : EM.cpp | ||
| 559 | - $(CC) $(CFLAGS) $(COFLAGS) EM.cpp | ||
| 560 | + $(CC) $(CFLAGS) $(COFLAGS) $< | ||
| 561 | |||
| 562 | Gibbs.o : Gibbs.cpp | ||
| 563 | - $(CC) $(CFLAGS) $(COFLAGS) Gibbs.cpp | ||
| 564 | + $(CC) $(CFLAGS) $(COFLAGS) $< | ||
| 565 | |||
| 566 | preRef.o : preRef.cpp | ||
| 567 | - $(CC) $(CFLAGS) $(COFLAGS) preRef.cpp | ||
| 568 | + $(CC) $(CFLAGS) $(COFLAGS) $< | ||
| 569 | |||
| 570 | parseIt.o : parseIt.cpp | ||
| 571 | - $(CC) $(CFLAGS) -O2 -c parseIt.cpp | ||
| 572 | + $(CC) $(CFLAGS) -O2 -c $< | ||
| 573 | |||
| 574 | simulation.o : simulation.cpp | ||
| 575 | - $(CC) $(CFLAGS) $(COFLAGS) simulation.cpp | ||
| 576 | + $(CC) $(CFLAGS) $(COFLAGS) $< | ||
| 577 | |||
| 578 | wiggle.o: wiggle.cpp | ||
| 579 | - $(CC) $(CFLAGS) $(COFLAGS) wiggle.cpp | ||
| 580 | + $(CC) $(CFLAGS) $(COFLAGS) $< | ||
| 581 | |||
| 582 | |||
| 583 | rsem-extract-reference-transcripts : extractRef.cpp | ||
| 584 | - $(CC) $(CFLAGS) -O3 extractRef.cpp -o $@ | ||
| 585 | + $(CC) $(CFLAGS) -O3 $< -o $@ | ||
| 586 | |||
| 587 | rsem-synthesis-reference-transcripts : synthesisRef.cpp | ||
| 588 | - $(CC) $(CFLAGS) -O3 synthesisRef.cpp -o $@ | ||
| 589 | + $(CC) $(CFLAGS) -O3 $< -o $@ | ||
| 590 | |||
| 591 | rsem-preref : preRef.o | ||
| 592 | - $(CC) $(CFLAGS) preRef.o -o $@ | ||
| 593 | + $(CC) $(CFLAGS) $< -o $@ | ||
| 594 | |||
| 595 | rsem-parse-alignments : parseIt.o | ||
| 596 | - $(CC) $(CFLAGS) -o $@ parseIt.o -lbam -lz -lpthread | ||
| 597 | + $(CC) $(CFLAGS) -o $@ $< -lbam -lz -lpthread | ||
| 598 | |||
| 599 | rsem-build-read-index : buildReadIndex.cpp | ||
| 600 | - $(CC) $(CFLAGS) -O3 buildReadIndex.cpp -o $@ | ||
| 601 | + $(CC) $(CFLAGS) -O3 $< -o $@ | ||
| 602 | |||
| 603 | rsem-run-em : EM.o | ||
| 604 | - $(CC) $(CFLAGS) -o $@ EM.o -lbam -lz -lpthread | ||
| 605 | + $(CC) $(CFLAGS) -o $@ $< -lbam -lz -lpthread | ||
| 606 | |||
| 607 | rsem-tbam2gbam : tbam2gbam.cpp | ||
| 608 | - $(CC) $(CFLAGS) -O3 tbam2gbam.cpp -lbam -lz -lpthread -o $@ | ||
| 609 | + $(CC) $(CFLAGS) -O3 $< -lbam -lz -lpthread -o $@ | ||
| 610 | |||
| 611 | rsem-bam2wig : wiggle.o bam2wig.cpp | ||
| 612 | - $(CC) $(CFLAGS) -O3 bam2wig.cpp wiggle.o -lbam -lz -lpthread -o $@ | ||
| 613 | + $(CC) $(CFLAGS) -O3 $^ -lbam -lz -lpthread -o $@ | ||
| 614 | |||
| 615 | rsem-bam2readdepth : wiggle.o bam2readdepth.cpp | ||
| 616 | - $(CC) $(CFLAGS) -O3 bam2readdepth.cpp wiggle.o -lbam -lz -lpthread -o $@ | ||
| 617 | + $(CC) $(CFLAGS) -O3 $^ -lbam -lz -lpthread -o $@ | ||
| 618 | |||
| 619 | rsem-simulate-reads : simulation.o | ||
| 620 | - $(CC) $(CFLAGS) -o $@ simulation.o | ||
| 621 | + $(CC) $(CFLAGS) -o $@ $< | ||
| 622 | |||
| 623 | rsem-run-gibbs : Gibbs.o | ||
| 624 | - $(CC) $(CFLAGS) -o $@ Gibbs.o -lpthread | ||
| 625 | + $(CC) $(CFLAGS) -o $@ $< -lpthread | ||
| 626 | |||
| 627 | rsem-calculate-credibility-intervals : calcCI.o | ||
| 628 | - $(CC) $(CFLAGS) -o $@ calcCI.o -lpthread | ||
| 629 | + $(CC) $(CFLAGS) -o $@ $< -lpthread | ||
| 630 | |||
| 631 | rsem-get-unique : getUnique.cpp | ||
| 632 | - $(CC) $(CFLAGS) -O3 getUnique.cpp -lbam -lz -lpthread -o $@ | ||
| 633 | + $(CC) $(CFLAGS) -O3 $< -lbam -lz -lpthread -o $@ | ||
| 634 | |||
| 635 | rsem-sam-validator : samValidator.cpp | ||
| 636 | - $(CC) $(CFLAGS) -O3 samValidator.cpp -lbam -lz -lpthread -o $@ | ||
| 637 | + $(CC) $(CFLAGS) -O3 $< -lbam -lz -lpthread -o $@ | ||
| 638 | |||
| 639 | rsem-scan-for-paired-end-reads : scanForPairedEndReads.cpp | ||
| 640 | - $(CC) $(CFLAGS) -O3 scanForPairedEndReads.cpp -lbam -lz -lpthread -o $@ | ||
| 641 | + $(CC) $(CFLAGS) -O3 $< -lbam -lz -lpthread -o $@ | ||
| 642 | |||
| 643 | clean : | ||
| 644 | rm -f *.o *~ $(PROGRAMS) | ||
| 645 | |||
| 646 | From 0cf9721077f67fb4ca15fdc59cbfbf24a944debd Mon Sep 17 00:00:00 2001 | ||
| 647 | From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | ||
| 648 | Date: Wed, 22 Apr 2015 15:49:19 +0200 | ||
| 649 | Subject: [PATCH 7/7] split long line | ||
| 650 | |||
| 651 | --- | ||
| 652 | Makefile | 17 ++++++++++++++++- | ||
| 653 | 1 file changed, 16 insertions(+), 1 deletion(-) | ||
| 654 | |||
| 655 | diff --git a/Makefile b/Makefile | ||
| 656 | index 6540d81..0ab04a5 100644 | ||
| 657 | --- a/Makefile | ||
| 658 | +++ b/Makefile | ||
| 659 | @@ -1,7 +1,22 @@ | ||
| 660 | CC = g++ | ||
| 661 | CFLAGS = -Wall -I. -I./sam -I./boost -L./sam | ||
| 662 | COFLAGS = -O3 -ffast-math -c | ||
| 663 | -PROGRAMS = rsem-extract-reference-transcripts rsem-synthesis-reference-transcripts rsem-preref rsem-parse-alignments rsem-build-read-index rsem-run-em rsem-tbam2gbam rsem-run-gibbs rsem-calculate-credibility-intervals rsem-simulate-reads rsem-bam2wig rsem-get-unique rsem-bam2readdepth rsem-sam-validator rsem-scan-for-paired-end-reads | ||
| 664 | +PROGRAMS = \ | ||
| 665 | + rsem-extract-reference-transcripts \ | ||
| 666 | + rsem-synthesis-reference-transcripts \ | ||
| 667 | + rsem-preref \ | ||
| 668 | + rsem-parse-alignments \ | ||
| 669 | + rsem-build-read-index \ | ||
| 670 | + rsem-run-em \ | ||
| 671 | + rsem-tbam2gbam \ | ||
| 672 | + rsem-run-gibbs \ | ||
| 673 | + rsem-calculate-credibility-intervals \ | ||
| 674 | + rsem-simulate-reads \ | ||
| 675 | + rsem-bam2wig \ | ||
| 676 | + rsem-get-unique \ | ||
| 677 | + rsem-bam2readdepth \ | ||
| 678 | + rsem-sam-validator \ | ||
| 679 | + rsem-scan-for-paired-end-reads | ||
| 680 | |||
| 681 | .PHONY : all ebseq clean | ||
| 682 | |||
diff --git a/gnu/packages/patches/serf-comment-style-fix.patch b/gnu/packages/patches/serf-comment-style-fix.patch new file mode 100644 index 00000000000..5d336fb3c83 --- /dev/null +++ b/gnu/packages/patches/serf-comment-style-fix.patch | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | r2443 | andreas.stieger@gmx.de | 2014-10-21 17:42:56 -0400 (Tue, 21 Oct 2014) | 7 lines | ||
| 2 | |||
| 3 | Follow-up to r2419: Correct comment style | ||
| 4 | |||
| 5 | * test/test_buckets.c | ||
| 6 | (deflate_compress): Correct comment style not supported by strict | ||
| 7 | compilers, fails on /branches/1.3.x | ||
| 8 | |||
| 9 | Index: test/test_buckets.c | ||
| 10 | =================================================================== | ||
| 11 | --- test/test_buckets.c (revision 2442) | ||
| 12 | +++ test/test_buckets.c (revision 2443) | ||
| 13 | @@ -1323,9 +1323,9 @@ | ||
| 14 | |||
| 15 | /* The largest buffer we should need is 0.1% larger than the | ||
| 16 | uncompressed data, + 12 bytes. This info comes from zlib.h. | ||
| 17 | + buf_size = orig_len + (orig_len / 1000) + 12; | ||
| 18 | Note: This isn't sufficient when using Z_NO_FLUSH and extremely compressed | ||
| 19 | data. Use a buffer bigger than what we need. */ | ||
| 20 | -// buf_size = orig_len + (orig_len / 1000) + 12; | ||
| 21 | buf_size = 100000; | ||
| 22 | |||
| 23 | write_buf = apr_palloc(pool, buf_size); | ||
diff --git a/gnu/packages/patches/serf-deflate-buckets-test-fix.patch b/gnu/packages/patches/serf-deflate-buckets-test-fix.patch new file mode 100644 index 00000000000..be8be1b1e89 --- /dev/null +++ b/gnu/packages/patches/serf-deflate-buckets-test-fix.patch | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | r2445 | chemodax | 2014-10-23 12:15:22 -0400 (Thu, 23 Oct 2014) | 6 lines | ||
| 2 | |||
| 3 | Reduce memory usage by deflate buckets test. | ||
| 4 | |||
| 5 | * test/test_buckets.c | ||
| 6 | (deflate_buckets): Add POOL argument and use it instead of tb->pool. | ||
| 7 | (test_deflate_buckets): Use iterpool for deflate_buckets() call. | ||
| 8 | |||
| 9 | Index: test/test_buckets.c | ||
| 10 | =================================================================== | ||
| 11 | --- test/test_buckets.c (revision 2444) | ||
| 12 | +++ test/test_buckets.c (revision 2445) | ||
| 13 | @@ -1400,12 +1400,12 @@ | ||
| 14 | expected_len); | ||
| 15 | } | ||
| 16 | |||
| 17 | -static void deflate_buckets(CuTest *tc, int nr_of_loops) | ||
| 18 | +static void deflate_buckets(CuTest *tc, int nr_of_loops, apr_pool_t *pool) | ||
| 19 | { | ||
| 20 | const char *msg = "12345678901234567890123456789012345678901234567890"; | ||
| 21 | |||
| 22 | test_baton_t *tb = tc->testBaton; | ||
| 23 | - serf_bucket_alloc_t *alloc = serf_bucket_allocator_create(tb->pool, NULL, | ||
| 24 | + serf_bucket_alloc_t *alloc = serf_bucket_allocator_create(pool, NULL, | ||
| 25 | NULL); | ||
| 26 | z_stream zdestr; | ||
| 27 | int i; | ||
| 28 | @@ -1424,8 +1424,8 @@ | ||
| 29 | { | ||
| 30 | serf_config_t *config; | ||
| 31 | |||
| 32 | - serf_context_t *ctx = serf_context_create(tb->pool); | ||
| 33 | - /* status = */ serf__config_store_get_config(ctx, NULL, &config, tb->pool); | ||
| 34 | + serf_context_t *ctx = serf_context_create(pool); | ||
| 35 | + /* status = */ serf__config_store_get_config(ctx, NULL, &config, pool); | ||
| 36 | |||
| 37 | serf_bucket_set_config(defbkt, config); | ||
| 38 | } | ||
| 39 | @@ -1447,11 +1447,11 @@ | ||
| 40 | if (i == nr_of_loops - 1) { | ||
| 41 | CuAssertIntEquals(tc, APR_SUCCESS, | ||
| 42 | deflate_compress(&data, &len, &zdestr, msg, | ||
| 43 | - strlen(msg), 1, tb->pool)); | ||
| 44 | + strlen(msg), 1, pool)); | ||
| 45 | } else { | ||
| 46 | CuAssertIntEquals(tc, APR_SUCCESS, | ||
| 47 | deflate_compress(&data, &len, &zdestr, msg, | ||
| 48 | - strlen(msg), 0, tb->pool)); | ||
| 49 | + strlen(msg), 0, pool)); | ||
| 50 | } | ||
| 51 | |||
| 52 | if (len == 0) | ||
| 53 | @@ -1469,10 +1469,15 @@ | ||
| 54 | static void test_deflate_buckets(CuTest *tc) | ||
| 55 | { | ||
| 56 | int i; | ||
| 57 | + apr_pool_t *iterpool; | ||
| 58 | + test_baton_t *tb = tc->testBaton; | ||
| 59 | |||
| 60 | + apr_pool_create(&iterpool, tb->pool); | ||
| 61 | for (i = 1; i < 1000; i++) { | ||
| 62 | - deflate_buckets(tc, i); | ||
| 63 | + apr_pool_clear(iterpool); | ||
| 64 | + deflate_buckets(tc, i, iterpool); | ||
| 65 | } | ||
| 66 | + apr_pool_destroy(iterpool); | ||
| 67 | } | ||
| 68 | |||
| 69 | static apr_status_t discard_data(serf_bucket_t *bkt, | ||
diff --git a/gnu/packages/patches/subversion-sqlite-3.8.9-fix.patch b/gnu/packages/patches/subversion-sqlite-3.8.9-fix.patch new file mode 100644 index 00000000000..92d8a85c8f6 --- /dev/null +++ b/gnu/packages/patches/subversion-sqlite-3.8.9-fix.patch | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | This upstream patch (r1672295) is needed to fix a test failure when built | ||
| 2 | against sqlite 3.8.9. See: | ||
| 3 | |||
| 4 | https://mail-archives.apache.org/mod_mbox/subversion-dev/201504.mbox/%3C5526D197.6020808@gmx.de%3E | ||
| 5 | |||
| 6 | |||
| 7 | r1672295 | rhuijben | 2015-04-09 07:31:12 -0400 (Thu, 09 Apr 2015) | 15 lines | ||
| 8 | |||
| 9 | Optimize STMT_SELECT_EXTERNALS_DEFINED when using Sqlite 3.8.9, by | ||
| 10 | adding two more rows to the sqlite_stat1 table. | ||
| 11 | |||
| 12 | This fixes a test failure in wc-queries-test.c, but actual users most | ||
| 13 | likely don't notice a difference as a tablescan on an EXTERNALS tables | ||
| 14 | index is not that expensive, given that most working copies don't have | ||
| 15 | many externals. | ||
| 16 | |||
| 17 | * subversion/libsvn_wc/wc-metadata.sql | ||
| 18 | (STMT_INSTALL_SCHEMA_STATISTICS): Add two rows. | ||
| 19 | |||
| 20 | * subversion/tests/libsvn_wc/wc-queries-test.c | ||
| 21 | (test_schema_statistics): Add a dummy externals row to allow | ||
| 22 | verifying schema. | ||
| 23 | |||
| 24 | Index: subversion/tests/libsvn_wc/wc-queries-test.c | ||
| 25 | =================================================================== | ||
| 26 | --- subversion/tests/libsvn_wc/wc-queries-test.c (revision 1672294) | ||
| 27 | +++ subversion/tests/libsvn_wc/wc-queries-test.c (revision 1672295) | ||
| 28 | @@ -927,6 +927,15 @@ | ||
| 29 | "VALUES (1, '', '')", | ||
| 30 | NULL, NULL, NULL)); | ||
| 31 | |||
| 32 | + SQLITE_ERR( | ||
| 33 | + sqlite3_exec(sdb, | ||
| 34 | + "INSERT INTO EXTERNALS (wc_id, local_relpath," | ||
| 35 | + " parent_relpath, repos_id," | ||
| 36 | + " presence, kind, def_local_relpath," | ||
| 37 | + " def_repos_relpath) " | ||
| 38 | + "VALUES (1, 'subdir', '', 1, 'normal', 'dir', '', '')", | ||
| 39 | + NULL, NULL, NULL)); | ||
| 40 | + | ||
| 41 | /* These are currently not necessary for query optimization, but it's better | ||
| 42 | to tell Sqlite how we intend to use this table anyway */ | ||
| 43 | SQLITE_ERR( | ||
| 44 | Index: subversion/libsvn_wc/wc-metadata.sql | ||
| 45 | =================================================================== | ||
| 46 | --- subversion/libsvn_wc/wc-metadata.sql (revision 1672294) | ||
| 47 | +++ subversion/libsvn_wc/wc-metadata.sql (revision 1672295) | ||
| 48 | @@ -619,6 +619,11 @@ | ||
| 49 | INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES | ||
| 50 | ('WC_LOCK', 'sqlite_autoindex_WC_LOCK_1', '100 100 1'); | ||
| 51 | |||
| 52 | +INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES | ||
| 53 | + ('EXTERNALS','sqlite_autoindex_EXTERNALS_1', '100 100 1'); | ||
| 54 | +INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES | ||
| 55 | + ('EXTERNALS','I_EXTERNALS_DEFINED', '100 100 3 1'); | ||
| 56 | + | ||
| 57 | /* sqlite_autoindex_WORK_QUEUE_1 doesn't exist because WORK_QUEUE is | ||
| 58 | a INTEGER PRIMARY KEY AUTOINCREMENT table */ | ||
| 59 | |||
diff --git a/gnu/packages/patches/tvtime-gcc41.patch b/gnu/packages/patches/tvtime-gcc41.patch new file mode 100644 index 00000000000..d6e42721b84 --- /dev/null +++ b/gnu/packages/patches/tvtime-gcc41.patch | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | Source: https://projects.archlinux.org/svntogit/community.git/tree/trunk/tvtime-1.0.2-gcc41.patch?h=packages/tvtime | ||
| 2 | |||
| 3 | --- tvtime-1.0.1/plugins/greedyh.asm 2005-08-14 18:16:43.000000000 +0200 | ||
| 4 | +++ tvtime-1.0.1-gcc41/plugins/greedyh.asm 2005-11-28 17:53:09.210774544 +0100 | ||
| 5 | @@ -18,7 +18,7 @@ | ||
| 6 | |||
| 7 | #include "x86-64_macros.inc" | ||
| 8 | |||
| 9 | -void DScalerFilterGreedyH::FUNCT_NAME(TDeinterlaceInfo* pInfo) | ||
| 10 | +void FUNCT_NAME(TDeinterlaceInfo* pInfo) | ||
| 11 | { | ||
| 12 | int64_t i; | ||
| 13 | bool InfoIsOdd = (pInfo->PictureHistory[0]->Flags & PICTURE_INTERLACED_ODD) ? 1 : 0; | ||
| 14 | diff -Naur tvtime-1.0.1/plugins/tomsmocomp/TomsMoCompAll2.inc tvtime-1.0.1-gcc41/plugins/tomsmocomp/TomsMoCompAll2.inc | ||
| 15 | --- tvtime-1.0.1/plugins/tomsmocomp/TomsMoCompAll2.inc 2004-10-20 17:31:05.000000000 +0200 | ||
| 16 | +++ tvtime-1.0.1-gcc41/plugins/tomsmocomp/TomsMoCompAll2.inc 2005-11-28 17:53:33.251119856 +0100 | ||
| 17 | @@ -5,9 +5,9 @@ | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #ifdef USE_STRANGE_BOB | ||
| 21 | -#define SEARCH_EFFORT_FUNC(n) DScalerFilterTomsMoComp::SEFUNC(n##_SB) | ||
| 22 | +#define SEARCH_EFFORT_FUNC(n) SEFUNC(n##_SB) | ||
| 23 | #else | ||
| 24 | -#define SEARCH_EFFORT_FUNC(n) DScalerFilterTomsMoComp::SEFUNC(n) | ||
| 25 | +#define SEARCH_EFFORT_FUNC(n) SEFUNC(n) | ||
| 26 | #endif | ||
| 27 | |||
| 28 | int SEARCH_EFFORT_FUNC(0) // we don't try at all ;-) | ||
| 29 | diff -Naur tvtime-1.0.1/plugins/tomsmocomp.cpp tvtime-1.0.1-gcc41/plugins/tomsmocomp.cpp | ||
| 30 | --- tvtime-1.0.1/plugins/tomsmocomp.cpp 2004-10-20 19:38:04.000000000 +0200 | ||
| 31 | +++ tvtime-1.0.1-gcc41/plugins/tomsmocomp.cpp 2005-11-28 17:52:53.862107896 +0100 | ||
| 32 | @@ -31,7 +31,7 @@ | ||
| 33 | |||
| 34 | #define IS_MMX | ||
| 35 | #define SSE_TYPE MMX | ||
| 36 | -#define FUNCT_NAME DScalerFilterTomsMoComp::filterDScaler_MMX | ||
| 37 | +#define FUNCT_NAME filterDScaler_MMX | ||
| 38 | #include "tomsmocomp/TomsMoCompAll.inc" | ||
| 39 | #undef IS_MMX | ||
| 40 | #undef SSE_TYPE | ||
| 41 | @@ -39,7 +39,7 @@ | ||
| 42 | |||
| 43 | #define IS_3DNOW | ||
| 44 | #define SSE_TYPE 3DNOW | ||
| 45 | -#define FUNCT_NAME DScalerFilterTomsMoComp::filterDScaler_3DNOW | ||
| 46 | +#define FUNCT_NAME filterDScaler_3DNOW | ||
| 47 | #include "tomsmocomp/TomsMoCompAll.inc" | ||
| 48 | #undef IS_3DNOW | ||
| 49 | #undef SSE_TYPE | ||
| 50 | @@ -47,7 +47,7 @@ | ||
| 51 | |||
| 52 | #define IS_SSE | ||
| 53 | #define SSE_TYPE SSE | ||
| 54 | -#define FUNCT_NAME DScalerFilterTomsMoComp::filterDScaler_SSE | ||
| 55 | +#define FUNCT_NAME filterDScaler_SSE | ||
| 56 | #include "tomsmocomp/TomsMoCompAll.inc" | ||
| 57 | #undef IS_SSE | ||
| 58 | #undef SSE_TYPE | ||
diff --git a/gnu/packages/patches/tvtime-pngoutput.patch b/gnu/packages/patches/tvtime-pngoutput.patch new file mode 100644 index 00000000000..0d14f77ca13 --- /dev/null +++ b/gnu/packages/patches/tvtime-pngoutput.patch | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | Source: https://sources.debian.net/src/tvtime/1.0.2-14/debian/patches/libpng.diff | ||
| 2 | |||
| 3 | From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | ||
| 4 | Date: Mon, 14 May 2012 19:01:31 +0900 | ||
| 5 | Prepares the package for libpng 1.5. Closes: #650582. | ||
| 6 | |||
| 7 | --- tvtime-1.0.2.orig/src/pngoutput.c | ||
| 8 | +++ tvtime-1.0.2/src/pngoutput.c | ||
| 9 | @@ -18,5 +18,6 @@ | ||
| 10 | |||
| 11 | #include <stdio.h> | ||
| 12 | #include <stdlib.h> | ||
| 13 | +#include <zlib.h> | ||
| 14 | #include <png.h> | ||
| 15 | #include "pngoutput.h" | ||
diff --git a/gnu/packages/patches/tvtime-videodev2.patch b/gnu/packages/patches/tvtime-videodev2.patch new file mode 100644 index 00000000000..74131f25d03 --- /dev/null +++ b/gnu/packages/patches/tvtime-videodev2.patch | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | Fix compilation error: non-existing header file. | ||
| 2 | |||
| 3 | This is an excerpt from the debian patch: | ||
| 4 | http://http.debian.net/debian/pool/main/t/tvtime/tvtime_1.0.2-14.diff.gz | ||
| 5 | |||
| 6 | --- tvtime-1.0.2.orig/src/videodev2.h | ||
| 7 | +++ tvtime-1.0.2/src/videodev2.h | ||
| 8 | @@ -16,7 +16,6 @@ | ||
| 9 | #ifdef __KERNEL__ | ||
| 10 | #include <linux/time.h> /* need struct timeval */ | ||
| 11 | #endif | ||
| 12 | -#include <linux/compiler.h> /* need __user */ | ||
| 13 | |||
| 14 | /* for kernel versions 2.4.26 and below: */ | ||
| 15 | #ifndef __user | ||
diff --git a/gnu/packages/patches/tvtime-xmltv.patch b/gnu/packages/patches/tvtime-xmltv.patch new file mode 100644 index 00000000000..2f4afc6e5af --- /dev/null +++ b/gnu/packages/patches/tvtime-xmltv.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | Fix compilation error: conflicting types for 'locale_t'. | ||
| 2 | |||
| 3 | This is an excerpt from the debian patch ... | ||
| 4 | http://http.debian.net/debian/pool/main/t/tvtime/tvtime_1.0.2-14.diff.gz | ||
| 5 | |||
| 6 | --- tvtime-1.0.2.orig/src/xmltv.c | ||
| 7 | +++ tvtime-1.0.2/src/xmltv.c | ||
| 8 | @@ -118,9 +118,9 @@ | ||
| 9 | typedef struct { | ||
| 10 | const char *code; | ||
| 11 | const char *name; | ||
| 12 | -} locale_t; | ||
| 13 | +} tvtime_locale_t; | ||
| 14 | |||
| 15 | -static locale_t locale_table[] = { | ||
| 16 | +static tvtime_locale_t locale_table[] = { | ||
| 17 | {"AA", "Afar"}, {"AB", "Abkhazian"}, {"AF", "Afrikaans"}, | ||
| 18 | {"AM", "Amharic"}, {"AR", "Arabic"}, {"AS", "Assamese"}, | ||
| 19 | {"AY", "Aymara"}, {"AZ", "Azerbaijani"}, {"BA", "Bashkir"}, | ||
| 20 | @@ -168,7 +168,7 @@ | ||
| 21 | {"XH", "Xhosa"}, {"YO", "Yoruba"}, {"ZH", "Chinese"}, | ||
| 22 | {"ZU", "Zulu"} }; | ||
| 23 | |||
| 24 | -const int num_locales = sizeof( locale_table ) / sizeof( locale_t ); | ||
| 25 | +const int num_locales = sizeof( locale_table ) / sizeof( tvtime_locale_t ); | ||
| 26 | |||
| 27 | /** | ||
| 28 | * Timezone parsing code based loosely on the algorithm in | ||
diff --git a/gnu/packages/patches/udev-gir-libtool.patch b/gnu/packages/patches/udev-gir-libtool.patch deleted file mode 100644 index 7504f87eb89..00000000000 --- a/gnu/packages/patches/udev-gir-libtool.patch +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | Without this patch, 'ld' as invoked by 'g-ir-scanner' fails to find -lgudev-1.0 | ||
| 2 | This is because libtool puts it in $(top_builddir)/.libs. | ||
| 3 | |||
| 4 | This patch forces 'g-ir-scanner' to use libtool, which enables it to find | ||
| 5 | libgudev-1.0.la. | ||
| 6 | |||
| 7 | --- udev-182/Makefile.in 2014-06-22 14:55:07.000000000 +0200 | ||
| 8 | +++ udev-182/Makefile.in 2014-06-22 14:55:15.000000000 +0200 | ||
| 9 | @@ -3622,7 +3622,7 @@ test-sys-distclean: | ||
| 10 | @ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --namespace GUdev \ | ||
| 11 | @ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --nsversion=1.0 \ | ||
| 12 | @ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --include=GObject-2.0 \ | ||
| 13 | -@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library=gudev-1.0 \ | ||
| 14 | +@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library=gudev-1.0 --libtool=$(top_builddir)/libtool \ | ||
| 15 | @ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library-path=$(top_builddir)/src \ | ||
| 16 | @ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library-path=$(top_builddir)/src/gudev \ | ||
| 17 | @ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --output $@ \ | ||
diff --git a/gnu/packages/patches/wicd-template-instantiation.patch b/gnu/packages/patches/wicd-template-instantiation.patch new file mode 100644 index 00000000000..16d8fa6e1d8 --- /dev/null +++ b/gnu/packages/patches/wicd-template-instantiation.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | Wicd 1.7.3 fails to instantiate template lines that have several | ||
| 2 | variable references. For instance, the line: | ||
| 3 | |||
| 4 | wep_key$_KEY_INDEX=$_KEY | ||
| 5 | |||
| 6 | which is found in in the 'wep-hex' template, expands to these two | ||
| 7 | lines: | ||
| 8 | |||
| 9 | wep_key0=$_KEY | ||
| 10 | wep_key0=123456789ab | ||
| 11 | |||
| 12 | This patch fixes that by only emitting the fully substituted line. | ||
| 13 | |||
| 14 | Patch by Ludovic Courtès <ludo@gnu.org>. | ||
| 15 | |||
| 16 | --- a/wicd/misc.py 2012-11-17 00:07:08 +0000 | ||
| 17 | +++ b/wicd/misc.py 2015-05-09 11:22:37 +0000 | ||
| 18 | @@ -321,11 +321,11 @@ def ParseEncryption(network): | ||
| 19 | rep_val = '0' | ||
| 20 | if rep_val: | ||
| 21 | line = line.replace("$_%s" % cur_val, str(rep_val)) | ||
| 22 | - config_file = ''.join([config_file, line]) | ||
| 23 | else: | ||
| 24 | print "Ignoring template line: '%s'" % line | ||
| 25 | else: | ||
| 26 | print "Weird parsing error occurred" | ||
| 27 | + config_file = ''.join([config_file, line]) | ||
| 28 | else: # Just a regular entry. | ||
| 29 | config_file = ''.join([config_file, line]) | ||
diff --git a/gnu/packages/patches/wpa-supplicant-2015-2-fix.patch b/gnu/packages/patches/wpa-supplicant-2015-2-fix.patch new file mode 100644 index 00000000000..cd097006d21 --- /dev/null +++ b/gnu/packages/patches/wpa-supplicant-2015-2-fix.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | Patch copied from http://w1.fi/security/2015-2/ | ||
| 2 | |||
| 3 | From 5acd23f4581da58683f3cf5e36cb71bbe4070bd7 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Jouni Malinen <j@w1.fi> | ||
| 5 | Date: Tue, 28 Apr 2015 17:08:33 +0300 | ||
| 6 | Subject: [PATCH] WPS: Fix HTTP chunked transfer encoding parser | ||
| 7 | |||
| 8 | strtoul() return value may end up overflowing the int h->chunk_size and | ||
| 9 | resulting in a negative value to be stored as the chunk_size. This could | ||
| 10 | result in the following memcpy operation using a very large length | ||
| 11 | argument which would result in a buffer overflow and segmentation fault. | ||
| 12 | |||
| 13 | This could have been used to cause a denial service by any device that | ||
| 14 | has been authorized for network access (either wireless or wired). This | ||
| 15 | would affect both the WPS UPnP functionality in a WPS AP (hostapd with | ||
| 16 | upnp_iface parameter set in the configuration) and WPS ER | ||
| 17 | (wpa_supplicant with WPS_ER_START control interface command used). | ||
| 18 | |||
| 19 | Validate the parsed chunk length value to avoid this. In addition to | ||
| 20 | rejecting negative values, we can also reject chunk size that would be | ||
| 21 | larger than the maximum configured body length. | ||
| 22 | |||
| 23 | Thanks to Kostya Kortchinsky of Google security team for discovering and | ||
| 24 | reporting this issue. | ||
| 25 | |||
| 26 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 27 | --- | ||
| 28 | src/wps/httpread.c | 7 +++++++ | ||
| 29 | 1 file changed, 7 insertions(+) | ||
| 30 | |||
| 31 | diff --git a/src/wps/httpread.c b/src/wps/httpread.c | ||
| 32 | index 2f08f37..d2855e3 100644 | ||
| 33 | --- a/src/wps/httpread.c | ||
| 34 | +++ b/src/wps/httpread.c | ||
| 35 | @@ -533,6 +533,13 @@ static void httpread_read_handler(int sd, void *eloop_ctx, void *sock_ctx) | ||
| 36 | if (!isxdigit(*cbp)) | ||
| 37 | goto bad; | ||
| 38 | h->chunk_size = strtoul(cbp, NULL, 16); | ||
| 39 | + if (h->chunk_size < 0 || | ||
| 40 | + h->chunk_size > h->max_bytes) { | ||
| 41 | + wpa_printf(MSG_DEBUG, | ||
| 42 | + "httpread: Invalid chunk size %d", | ||
| 43 | + h->chunk_size); | ||
| 44 | + goto bad; | ||
| 45 | + } | ||
| 46 | /* throw away chunk header | ||
| 47 | * so we have only real data | ||
| 48 | */ | ||
| 49 | -- | ||
| 50 | 1.9.1 | ||
| 51 | |||
diff --git a/gnu/packages/patches/wpa-supplicant-2015-3-fix.patch b/gnu/packages/patches/wpa-supplicant-2015-3-fix.patch new file mode 100644 index 00000000000..de042f0c490 --- /dev/null +++ b/gnu/packages/patches/wpa-supplicant-2015-3-fix.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | Patch copied from http://w1.fi/security/2015-3/ | ||
| 2 | |||
| 3 | From ef566a4d4f74022e1fdb0a2addfe81e6de9f4aae Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Jouni Malinen <j@w1.fi> | ||
| 5 | Date: Wed, 29 Apr 2015 02:21:53 +0300 | ||
| 6 | Subject: [PATCH] AP WMM: Fix integer underflow in WMM Action frame parser | ||
| 7 | |||
| 8 | The length of the WMM Action frame was not properly validated and the | ||
| 9 | length of the information elements (int left) could end up being | ||
| 10 | negative. This would result in reading significantly past the stack | ||
| 11 | buffer while parsing the IEs in ieee802_11_parse_elems() and while doing | ||
| 12 | so, resulting in segmentation fault. | ||
| 13 | |||
| 14 | This can result in an invalid frame being used for a denial of service | ||
| 15 | attack (hostapd process killed) against an AP with a driver that uses | ||
| 16 | hostapd for management frame processing (e.g., all mac80211-based | ||
| 17 | drivers). | ||
| 18 | |||
| 19 | Thanks to Kostya Kortchinsky of Google security team for discovering and | ||
| 20 | reporting this issue. | ||
| 21 | |||
| 22 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 23 | --- | ||
| 24 | src/ap/wmm.c | 3 +++ | ||
| 25 | 1 file changed, 3 insertions(+) | ||
| 26 | |||
| 27 | diff --git a/src/ap/wmm.c b/src/ap/wmm.c | ||
| 28 | index 6d4177c..314e244 100644 | ||
| 29 | --- a/src/ap/wmm.c | ||
| 30 | +++ b/src/ap/wmm.c | ||
| 31 | @@ -274,6 +274,9 @@ void hostapd_wmm_action(struct hostapd_data *hapd, | ||
| 32 | return; | ||
| 33 | } | ||
| 34 | |||
| 35 | + if (left < 0) | ||
| 36 | + return; /* not a valid WMM Action frame */ | ||
| 37 | + | ||
| 38 | /* extract the tspec info element */ | ||
| 39 | if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) { | ||
| 40 | hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, | ||
| 41 | -- | ||
| 42 | 1.9.1 | ||
| 43 | |||
diff --git a/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt1.patch b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt1.patch new file mode 100644 index 00000000000..7ebf5f4cc1c --- /dev/null +++ b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt1.patch | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | Patch copied from http://w1.fi/security/2015-4/ | ||
| 2 | |||
| 3 | From dd2f043c9c43d156494e33d7ce22db96e6ef42c7 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Jouni Malinen <j@w1.fi> | ||
| 5 | Date: Fri, 1 May 2015 16:37:45 +0300 | ||
| 6 | Subject: [PATCH 1/5] EAP-pwd peer: Fix payload length validation for Commit | ||
| 7 | and Confirm | ||
| 8 | |||
| 9 | The length of the received Commit and Confirm message payloads was not | ||
| 10 | checked before reading them. This could result in a buffer read | ||
| 11 | overflow when processing an invalid message. | ||
| 12 | |||
| 13 | Fix this by verifying that the payload is of expected length before | ||
| 14 | processing it. In addition, enforce correct state transition sequence to | ||
| 15 | make sure there is no unexpected behavior if receiving a Commit/Confirm | ||
| 16 | message before the previous exchanges have been completed. | ||
| 17 | |||
| 18 | Thanks to Kostya Kortchinsky of Google security team for discovering and | ||
| 19 | reporting this issue. | ||
| 20 | |||
| 21 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 22 | --- | ||
| 23 | src/eap_peer/eap_pwd.c | 29 +++++++++++++++++++++++++++++ | ||
| 24 | 1 file changed, 29 insertions(+) | ||
| 25 | |||
| 26 | diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c | ||
| 27 | index f2b0926..a629437 100644 | ||
| 28 | --- a/src/eap_peer/eap_pwd.c | ||
| 29 | +++ b/src/eap_peer/eap_pwd.c | ||
| 30 | @@ -355,6 +355,23 @@ eap_pwd_perform_commit_exchange(struct eap_sm *sm, struct eap_pwd_data *data, | ||
| 31 | BIGNUM *mask = NULL, *x = NULL, *y = NULL, *cofactor = NULL; | ||
| 32 | u16 offset; | ||
| 33 | u8 *ptr, *scalar = NULL, *element = NULL; | ||
| 34 | + size_t prime_len, order_len; | ||
| 35 | + | ||
| 36 | + if (data->state != PWD_Commit_Req) { | ||
| 37 | + ret->ignore = TRUE; | ||
| 38 | + goto fin; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + prime_len = BN_num_bytes(data->grp->prime); | ||
| 42 | + order_len = BN_num_bytes(data->grp->order); | ||
| 43 | + | ||
| 44 | + if (payload_len != 2 * prime_len + order_len) { | ||
| 45 | + wpa_printf(MSG_INFO, | ||
| 46 | + "EAP-pwd: Unexpected Commit payload length %u (expected %u)", | ||
| 47 | + (unsigned int) payload_len, | ||
| 48 | + (unsigned int) (2 * prime_len + order_len)); | ||
| 49 | + goto fin; | ||
| 50 | + } | ||
| 51 | |||
| 52 | if (((data->private_value = BN_new()) == NULL) || | ||
| 53 | ((data->my_element = EC_POINT_new(data->grp->group)) == NULL) || | ||
| 54 | @@ -554,6 +571,18 @@ eap_pwd_perform_confirm_exchange(struct eap_sm *sm, struct eap_pwd_data *data, | ||
| 55 | u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr; | ||
| 56 | int offset; | ||
| 57 | |||
| 58 | + if (data->state != PWD_Confirm_Req) { | ||
| 59 | + ret->ignore = TRUE; | ||
| 60 | + goto fin; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + if (payload_len != SHA256_MAC_LEN) { | ||
| 64 | + wpa_printf(MSG_INFO, | ||
| 65 | + "EAP-pwd: Unexpected Confirm payload length %u (expected %u)", | ||
| 66 | + (unsigned int) payload_len, SHA256_MAC_LEN); | ||
| 67 | + goto fin; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | /* | ||
| 71 | * first build up the ciphersuite which is group | random_function | | ||
| 72 | * prf | ||
| 73 | -- | ||
| 74 | 1.9.1 | ||
| 75 | |||
diff --git a/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt2.patch b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt2.patch new file mode 100644 index 00000000000..c11e4175d93 --- /dev/null +++ b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt2.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | Patch copied from http://w1.fi/security/2015-4/ | ||
| 2 | |||
| 3 | From e28a58be26184c2a23f80b410e0997ef1bd5d578 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Jouni Malinen <j@w1.fi> | ||
| 5 | Date: Fri, 1 May 2015 16:40:44 +0300 | ||
| 6 | Subject: [PATCH 2/5] EAP-pwd server: Fix payload length validation for Commit | ||
| 7 | and Confirm | ||
| 8 | |||
| 9 | The length of the received Commit and Confirm message payloads was not | ||
| 10 | checked before reading them. This could result in a buffer read | ||
| 11 | overflow when processing an invalid message. | ||
| 12 | |||
| 13 | Fix this by verifying that the payload is of expected length before | ||
| 14 | processing it. In addition, enforce correct state transition sequence to | ||
| 15 | make sure there is no unexpected behavior if receiving a Commit/Confirm | ||
| 16 | message before the previous exchanges have been completed. | ||
| 17 | |||
| 18 | Thanks to Kostya Kortchinsky of Google security team for discovering and | ||
| 19 | reporting this issue. | ||
| 20 | |||
| 21 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 22 | --- | ||
| 23 | src/eap_server/eap_server_pwd.c | 19 +++++++++++++++++++ | ||
| 24 | 1 file changed, 19 insertions(+) | ||
| 25 | |||
| 26 | diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c | ||
| 27 | index 66bd5d2..3189105 100644 | ||
| 28 | --- a/src/eap_server/eap_server_pwd.c | ||
| 29 | +++ b/src/eap_server/eap_server_pwd.c | ||
| 30 | @@ -656,9 +656,21 @@ eap_pwd_process_commit_resp(struct eap_sm *sm, struct eap_pwd_data *data, | ||
| 31 | BIGNUM *x = NULL, *y = NULL, *cofactor = NULL; | ||
| 32 | EC_POINT *K = NULL, *point = NULL; | ||
| 33 | int res = 0; | ||
| 34 | + size_t prime_len, order_len; | ||
| 35 | |||
| 36 | wpa_printf(MSG_DEBUG, "EAP-pwd: Received commit response"); | ||
| 37 | |||
| 38 | + prime_len = BN_num_bytes(data->grp->prime); | ||
| 39 | + order_len = BN_num_bytes(data->grp->order); | ||
| 40 | + | ||
| 41 | + if (payload_len != 2 * prime_len + order_len) { | ||
| 42 | + wpa_printf(MSG_INFO, | ||
| 43 | + "EAP-pwd: Unexpected Commit payload length %u (expected %u)", | ||
| 44 | + (unsigned int) payload_len, | ||
| 45 | + (unsigned int) (2 * prime_len + order_len)); | ||
| 46 | + goto fin; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | if (((data->peer_scalar = BN_new()) == NULL) || | ||
| 50 | ((data->k = BN_new()) == NULL) || | ||
| 51 | ((cofactor = BN_new()) == NULL) || | ||
| 52 | @@ -774,6 +786,13 @@ eap_pwd_process_confirm_resp(struct eap_sm *sm, struct eap_pwd_data *data, | ||
| 53 | u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr; | ||
| 54 | int offset; | ||
| 55 | |||
| 56 | + if (payload_len != SHA256_MAC_LEN) { | ||
| 57 | + wpa_printf(MSG_INFO, | ||
| 58 | + "EAP-pwd: Unexpected Confirm payload length %u (expected %u)", | ||
| 59 | + (unsigned int) payload_len, SHA256_MAC_LEN); | ||
| 60 | + goto fin; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | /* build up the ciphersuite: group | random_function | prf */ | ||
| 64 | grp = htons(data->group_num); | ||
| 65 | ptr = (u8 *) &cs; | ||
| 66 | -- | ||
| 67 | 1.9.1 | ||
| 68 | |||
diff --git a/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt3.patch b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt3.patch new file mode 100644 index 00000000000..963dac92700 --- /dev/null +++ b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt3.patch | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | Patch copied from http://w1.fi/security/2015-4/ | ||
| 2 | |||
| 3 | From 477c74395acd0123340457ba6f15ab345d42016e Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Jouni Malinen <j@w1.fi> | ||
| 5 | Date: Sat, 2 May 2015 19:23:04 +0300 | ||
| 6 | Subject: [PATCH 3/5] EAP-pwd peer: Fix Total-Length parsing for fragment | ||
| 7 | reassembly | ||
| 8 | |||
| 9 | The remaining number of bytes in the message could be smaller than the | ||
| 10 | Total-Length field size, so the length needs to be explicitly checked | ||
| 11 | prior to reading the field and decrementing the len variable. This could | ||
| 12 | have resulted in the remaining length becoming negative and interpreted | ||
| 13 | as a huge positive integer. | ||
| 14 | |||
| 15 | In addition, check that there is no already started fragment in progress | ||
| 16 | before allocating a new buffer for reassembling fragments. This avoid a | ||
| 17 | potential memory leak when processing invalid message. | ||
| 18 | |||
| 19 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 20 | --- | ||
| 21 | src/eap_peer/eap_pwd.c | 12 ++++++++++++ | ||
| 22 | 1 file changed, 12 insertions(+) | ||
| 23 | |||
| 24 | diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c | ||
| 25 | index a629437..1d2079b 100644 | ||
| 26 | --- a/src/eap_peer/eap_pwd.c | ||
| 27 | +++ b/src/eap_peer/eap_pwd.c | ||
| 28 | @@ -866,11 +866,23 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, | ||
| 29 | * if it's the first fragment there'll be a length field | ||
| 30 | */ | ||
| 31 | if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) { | ||
| 32 | + if (len < 2) { | ||
| 33 | + wpa_printf(MSG_DEBUG, | ||
| 34 | + "EAP-pwd: Frame too short to contain Total-Length field"); | ||
| 35 | + ret->ignore = TRUE; | ||
| 36 | + return NULL; | ||
| 37 | + } | ||
| 38 | tot_len = WPA_GET_BE16(pos); | ||
| 39 | wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments whose " | ||
| 40 | "total length = %d", tot_len); | ||
| 41 | if (tot_len > 15000) | ||
| 42 | return NULL; | ||
| 43 | + if (data->inbuf) { | ||
| 44 | + wpa_printf(MSG_DEBUG, | ||
| 45 | + "EAP-pwd: Unexpected new fragment start when previous fragment is still in use"); | ||
| 46 | + ret->ignore = TRUE; | ||
| 47 | + return NULL; | ||
| 48 | + } | ||
| 49 | data->inbuf = wpabuf_alloc(tot_len); | ||
| 50 | if (data->inbuf == NULL) { | ||
| 51 | wpa_printf(MSG_INFO, "Out of memory to buffer " | ||
| 52 | -- | ||
| 53 | 1.9.1 | ||
| 54 | |||
diff --git a/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt4.patch b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt4.patch new file mode 100644 index 00000000000..3d945382bcd --- /dev/null +++ b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt4.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | Patch copied from http://w1.fi/security/2015-4/ | ||
| 2 | |||
| 3 | From 3035cc2894e08319b905bd6561e8bddc8c2db9fa Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Jouni Malinen <j@w1.fi> | ||
| 5 | Date: Sat, 2 May 2015 19:26:06 +0300 | ||
| 6 | Subject: [PATCH 4/5] EAP-pwd server: Fix Total-Length parsing for fragment | ||
| 7 | reassembly | ||
| 8 | |||
| 9 | The remaining number of bytes in the message could be smaller than the | ||
| 10 | Total-Length field size, so the length needs to be explicitly checked | ||
| 11 | prior to reading the field and decrementing the len variable. This could | ||
| 12 | have resulted in the remaining length becoming negative and interpreted | ||
| 13 | as a huge positive integer. | ||
| 14 | |||
| 15 | In addition, check that there is no already started fragment in progress | ||
| 16 | before allocating a new buffer for reassembling fragments. This avoid a | ||
| 17 | potential memory leak when processing invalid message. | ||
| 18 | |||
| 19 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 20 | --- | ||
| 21 | src/eap_server/eap_server_pwd.c | 10 ++++++++++ | ||
| 22 | 1 file changed, 10 insertions(+) | ||
| 23 | |||
| 24 | diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c | ||
| 25 | index 3189105..2bfc3c2 100644 | ||
| 26 | --- a/src/eap_server/eap_server_pwd.c | ||
| 27 | +++ b/src/eap_server/eap_server_pwd.c | ||
| 28 | @@ -942,11 +942,21 @@ static void eap_pwd_process(struct eap_sm *sm, void *priv, | ||
| 29 | * the first fragment has a total length | ||
| 30 | */ | ||
| 31 | if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) { | ||
| 32 | + if (len < 2) { | ||
| 33 | + wpa_printf(MSG_DEBUG, | ||
| 34 | + "EAP-pwd: Frame too short to contain Total-Length field"); | ||
| 35 | + return; | ||
| 36 | + } | ||
| 37 | tot_len = WPA_GET_BE16(pos); | ||
| 38 | wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments, total " | ||
| 39 | "length = %d", tot_len); | ||
| 40 | if (tot_len > 15000) | ||
| 41 | return; | ||
| 42 | + if (data->inbuf) { | ||
| 43 | + wpa_printf(MSG_DEBUG, | ||
| 44 | + "EAP-pwd: Unexpected new fragment start when previous fragment is still in use"); | ||
| 45 | + return; | ||
| 46 | + } | ||
| 47 | data->inbuf = wpabuf_alloc(tot_len); | ||
| 48 | if (data->inbuf == NULL) { | ||
| 49 | wpa_printf(MSG_INFO, "EAP-pwd: Out of memory to " | ||
| 50 | -- | ||
| 51 | 1.9.1 | ||
| 52 | |||
diff --git a/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt5.patch b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt5.patch new file mode 100644 index 00000000000..30f71974ad5 --- /dev/null +++ b/gnu/packages/patches/wpa-supplicant-2015-4-fix-pt5.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | Patch copied from http://w1.fi/security/2015-4/ | ||
| 2 | |||
| 3 | From 28a069a545b06b99eb55ad53f63f2c99e65a98f6 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Jouni Malinen <j@w1.fi> | ||
| 5 | Date: Sat, 2 May 2015 19:26:28 +0300 | ||
| 6 | Subject: [PATCH 5/5] EAP-pwd peer: Fix asymmetric fragmentation behavior | ||
| 7 | |||
| 8 | The L (Length) and M (More) flags needs to be cleared before deciding | ||
| 9 | whether the locally generated response requires fragmentation. This | ||
| 10 | fixes an issue where these flags from the server could have been invalid | ||
| 11 | for the following message. In some cases, this could have resulted in | ||
| 12 | triggering the wpabuf security check that would terminate the process | ||
| 13 | due to invalid buffer allocation. | ||
| 14 | |||
| 15 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 16 | --- | ||
| 17 | src/eap_peer/eap_pwd.c | 1 + | ||
| 18 | 1 file changed, 1 insertion(+) | ||
| 19 | |||
| 20 | diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c | ||
| 21 | index 1d2079b..e58b13a 100644 | ||
| 22 | --- a/src/eap_peer/eap_pwd.c | ||
| 23 | +++ b/src/eap_peer/eap_pwd.c | ||
| 24 | @@ -968,6 +968,7 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, | ||
| 25 | /* | ||
| 26 | * we have output! Do we need to fragment it? | ||
| 27 | */ | ||
| 28 | + lm_exch = EAP_PWD_GET_EXCHANGE(lm_exch); | ||
| 29 | len = wpabuf_len(data->outbuf); | ||
| 30 | if ((len + EAP_PWD_HDR_SIZE) > data->mtu) { | ||
| 31 | resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_PWD, data->mtu, | ||
| 32 | -- | ||
| 33 | 1.9.1 | ||
| 34 | |||
diff --git a/gnu/packages/pcre.scm b/gnu/packages/pcre.scm index 3181ba7592e..86d3ca38741 100644 --- a/gnu/packages/pcre.scm +++ b/gnu/packages/pcre.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> | 2 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> |
| 3 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 6 | ;;; |
| @@ -28,14 +28,14 @@ | |||
| 28 | (define-public pcre | 28 | (define-public pcre |
| 29 | (package | 29 | (package |
| 30 | (name "pcre") | 30 | (name "pcre") |
| 31 | (version "8.36") | 31 | (version "8.37") |
| 32 | (source (origin | 32 | (source (origin |
| 33 | (method url-fetch) | 33 | (method url-fetch) |
| 34 | (uri (string-append "mirror://sourceforge/pcre/pcre/" | 34 | (uri (string-append "mirror://sourceforge/pcre/pcre/" |
| 35 | version "/pcre-" version ".tar.bz2")) | 35 | version "/pcre-" version ".tar.bz2")) |
| 36 | (sha256 | 36 | (sha256 |
| 37 | (base32 | 37 | (base32 |
| 38 | "1fs5p1z67m9f4xnyil3s4lhgyld78f7m4d1yawpyhh0cvrbk90zg")))) | 38 | "17bqykp604p7376wj3q2nmjdhrb6v1ny8q08zdwi7qvc02l9wrsi")))) |
| 39 | (build-system gnu-build-system) | 39 | (build-system gnu-build-system) |
| 40 | (inputs `(("bzip2" ,bzip2) | 40 | (inputs `(("bzip2" ,bzip2) |
| 41 | ("readline" ,readline) | 41 | ("readline" ,readline) |
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index bca577eb351..7023b9aa65b 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm | |||
| @@ -282,7 +282,7 @@ by using the poppler rendering engine.") | |||
| 282 | (define-public zathura | 282 | (define-public zathura |
| 283 | (package | 283 | (package |
| 284 | (name "zathura") | 284 | (name "zathura") |
| 285 | (version "0.3.2") | 285 | (version "0.3.3") |
| 286 | (source (origin | 286 | (source (origin |
| 287 | (method url-fetch) | 287 | (method url-fetch) |
| 288 | (uri | 288 | (uri |
| @@ -290,7 +290,7 @@ by using the poppler rendering engine.") | |||
| 290 | version ".tar.gz")) | 290 | version ".tar.gz")) |
| 291 | (sha256 | 291 | (sha256 |
| 292 | (base32 | 292 | (base32 |
| 293 | "1qk5s7cyqp4l673yhma5igk9g24p5jyqyy81fdk7q7xjqlym19px")) | 293 | "1rywx09qn6ap5hb1z31wxby4lzdrqdbldm51pjk1ifflr37xwirk")) |
| 294 | (patches | 294 | (patches |
| 295 | (list | 295 | (list |
| 296 | (search-patch "zathura-plugindir-environment-variable.patch"))))) | 296 | (search-patch "zathura-plugindir-environment-variable.patch"))))) |
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 09e57578d8e..45ca94b2796 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm | |||
| @@ -1129,6 +1129,30 @@ on one page. This results in wanting to page through various pages of data. | |||
| 1129 | The maths behind this is unfortunately fiddly, hence this module.") | 1129 | The maths behind this is unfortunately fiddly, hence this module.") |
| 1130 | (license (package-license perl)))) | 1130 | (license (package-license perl)))) |
| 1131 | 1131 | ||
| 1132 | (define-public perl-data-stag | ||
| 1133 | (package | ||
| 1134 | (name "perl-data-stag") | ||
| 1135 | (version "0.14") | ||
| 1136 | (source | ||
| 1137 | (origin | ||
| 1138 | (method url-fetch) | ||
| 1139 | (uri (string-append "mirror://cpan/authors/id/C/CM/CMUNGALL/" | ||
| 1140 | "Data-Stag-" version ".tar.gz")) | ||
| 1141 | (sha256 | ||
| 1142 | (base32 | ||
| 1143 | "0ncf4l39ka23nb01jlm6rzxdb5pqbip01x0m38bnvf1gim825caa")))) | ||
| 1144 | (build-system perl-build-system) | ||
| 1145 | (propagated-inputs | ||
| 1146 | `(("perl-io-string" ,perl-io-string))) | ||
| 1147 | (home-page "http://search.cpan.org/dist/Data-Stag") | ||
| 1148 | (synopsis "Structured tags datastructures") | ||
| 1149 | (description | ||
| 1150 | "This module is for manipulating data as hierarchical tag/value | ||
| 1151 | pairs (Structured TAGs or Simple Tree AGgreggates). These datastructures can | ||
| 1152 | be represented as nested arrays, which have the advantage of being native to | ||
| 1153 | Perl.") | ||
| 1154 | (license (package-license perl)))) | ||
| 1155 | |||
| 1132 | (define-public perl-data-stream-bulk | 1156 | (define-public perl-data-stream-bulk |
| 1133 | (package | 1157 | (package |
| 1134 | (name "perl-data-stream-bulk") | 1158 | (name "perl-data-stream-bulk") |
| @@ -2442,6 +2466,25 @@ easier to develop interactive applications: is_interactive(), interactive(), | |||
| 2442 | and busy()") | 2466 | and busy()") |
| 2443 | (license (package-license perl)))) | 2467 | (license (package-license perl)))) |
| 2444 | 2468 | ||
| 2469 | (define-public perl-io-string | ||
| 2470 | (package | ||
| 2471 | (name "perl-io-string") | ||
| 2472 | (version "1.08") | ||
| 2473 | (source | ||
| 2474 | (origin | ||
| 2475 | (method url-fetch) | ||
| 2476 | (uri (string-append "mirror://cpan/authors/id/G/GA/GAAS/" | ||
| 2477 | "IO-String-" version ".tar.gz")) | ||
| 2478 | (sha256 | ||
| 2479 | (base32 | ||
| 2480 | "18755m410yl70s17rgq3m0hyxl8r5mr47vsq1rw7141d8kc4lgra")))) | ||
| 2481 | (build-system perl-build-system) | ||
| 2482 | (home-page "http://search.cpan.org/~gaas/IO-String-1.08/") | ||
| 2483 | (synopsis "Emulate file interface for in-core strings") | ||
| 2484 | (description "IO::String is an IO::File (and IO::Handle) compatible class | ||
| 2485 | that reads or writes data from in-core strings.") | ||
| 2486 | (license (package-license perl)))) | ||
| 2487 | |||
| 2445 | (define-public perl-io-stringy | 2488 | (define-public perl-io-stringy |
| 2446 | (package | 2489 | (package |
| 2447 | (name "perl-io-stringy") | 2490 | (name "perl-io-stringy") |
| @@ -2583,7 +2626,7 @@ versa using either JSON::XS or JSON::PP.") | |||
| 2583 | (source | 2626 | (source |
| 2584 | (origin | 2627 | (origin |
| 2585 | (method url-fetch) | 2628 | (method url-fetch) |
| 2586 | (uri (string-append "mirros://cpan/authors/id/E/ET/ETHER/" | 2629 | (uri (string-append "mirror://cpan/authors/id/E/ET/ETHER/" |
| 2587 | "JSON-Any-" version ".tar.gz")) | 2630 | "JSON-Any-" version ".tar.gz")) |
| 2588 | (sha256 | 2631 | (sha256 |
| 2589 | (base32 | 2632 | (base32 |
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 29b47f357c4..914c2dc23cc 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | (define-module (gnu packages python) | 27 | (define-module (gnu packages python) |
| 28 | #:use-module ((guix licenses) | 28 | #:use-module ((guix licenses) |
| 29 | #:select (asl2.0 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style | 29 | #:select (asl2.0 bsd-4 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style |
| 30 | gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ | 30 | gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ |
| 31 | psfl public-domain x11-style)) | 31 | psfl public-domain x11-style)) |
| 32 | #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:) | 32 | #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:) |
| @@ -45,6 +45,7 @@ | |||
| 45 | #:use-module (gnu packages libffi) | 45 | #:use-module (gnu packages libffi) |
| 46 | #:use-module (gnu packages maths) | 46 | #:use-module (gnu packages maths) |
| 47 | #:use-module (gnu packages multiprecision) | 47 | #:use-module (gnu packages multiprecision) |
| 48 | #:use-module (gnu packages networking) | ||
| 48 | #:use-module (gnu packages ncurses) | 49 | #:use-module (gnu packages ncurses) |
| 49 | #:use-module (gnu packages openssl) | 50 | #:use-module (gnu packages openssl) |
| 50 | #:use-module (gnu packages perl) | 51 | #:use-module (gnu packages perl) |
| @@ -628,6 +629,44 @@ datetime module, available in Python 2.3+.") | |||
| 628 | "Parse human-readable date/time text") | 629 | "Parse human-readable date/time text") |
| 629 | (license asl2.0))) | 630 | (license asl2.0))) |
| 630 | 631 | ||
| 632 | (define-public python-pandas | ||
| 633 | (package | ||
| 634 | (name "python-pandas") | ||
| 635 | (version "0.16.0") | ||
| 636 | (source | ||
| 637 | (origin | ||
| 638 | (method url-fetch) | ||
| 639 | (uri (string-append "https://pypi.python.org/packages/source/p/" | ||
| 640 | "pandas/pandas-" version ".tar.gz")) | ||
| 641 | (sha256 | ||
| 642 | (base32 "1wfrp8dx1zcsry6f09ndza6qm1yr7f163211f4l9vjlnhxpxw4s0")))) | ||
| 643 | (build-system python-build-system) | ||
| 644 | (arguments | ||
| 645 | `(;; Three tests fail: | ||
| 646 | ;; - test_read_google | ||
| 647 | ;; - test_read_yahoo | ||
| 648 | ;; - test_month_range_union_tz_dateutil | ||
| 649 | #:tests? #f)) | ||
| 650 | (propagated-inputs | ||
| 651 | `(("python-numpy" ,python-numpy) | ||
| 652 | ("python-pytz" ,python-pytz) | ||
| 653 | ("python-dateutil" ,python-dateutil-2))) | ||
| 654 | (native-inputs | ||
| 655 | `(("python-nose" ,python-nose) | ||
| 656 | ("python-setuptools" ,python-setuptools))) | ||
| 657 | (home-page "http://pandas.pydata.org") | ||
| 658 | (synopsis "Data structures for data analysis, time series, and statistics") | ||
| 659 | (description | ||
| 660 | "Pandas is a Python package providing fast, flexible, and expressive data | ||
| 661 | structures designed to make working with structured (tabular, | ||
| 662 | multidimensional, potentially heterogeneous) and time series data both easy | ||
| 663 | and intuitive. It aims to be the fundamental high-level building block for | ||
| 664 | doing practical, real world data analysis in Python.") | ||
| 665 | (license bsd-3))) | ||
| 666 | |||
| 667 | (define-public python2-pandas | ||
| 668 | (package-with-python2 python-pandas)) | ||
| 669 | |||
| 631 | (define-public python-tzlocal | 670 | (define-public python-tzlocal |
| 632 | (package | 671 | (package |
| 633 | (name "python-tzlocal") | 672 | (name "python-tzlocal") |
| @@ -1023,14 +1062,14 @@ syntax.") | |||
| 1023 | (define-public scons | 1062 | (define-public scons |
| 1024 | (package | 1063 | (package |
| 1025 | (name "scons") | 1064 | (name "scons") |
| 1026 | (version "2.1.0") | 1065 | (version "2.3.4") |
| 1027 | (source (origin | 1066 | (source (origin |
| 1028 | (method url-fetch) | 1067 | (method url-fetch) |
| 1029 | (uri (string-append "mirror://sourceforge/scons/scons-" | 1068 | (uri (string-append "mirror://sourceforge/scons/scons-" |
| 1030 | version ".tar.gz")) | 1069 | version ".tar.gz")) |
| 1031 | (sha256 | 1070 | (sha256 |
| 1032 | (base32 | 1071 | (base32 |
| 1033 | "07cjn4afb2cljjrd3cr7xf062qq58z8q96f58z6yplhdyqafsfa1")))) | 1072 | "0hdlci43wjz8maryj83mz04ir6rwcdrrzpd7cpzvdlzycqhdfmsb")))) |
| 1034 | (build-system python-build-system) | 1073 | (build-system python-build-system) |
| 1035 | (arguments | 1074 | (arguments |
| 1036 | ;; With Python 3.x, fails to build with a syntax error. | 1075 | ;; With Python 3.x, fails to build with a syntax error. |
| @@ -1598,6 +1637,33 @@ is used by the Requests library to verify HTTPS requests.") | |||
| 1598 | (define-public python2-certifi | 1637 | (define-public python2-certifi |
| 1599 | (package-with-python2 python-certifi)) | 1638 | (package-with-python2 python-certifi)) |
| 1600 | 1639 | ||
| 1640 | (define-public python-click | ||
| 1641 | (package | ||
| 1642 | (name "python-click") | ||
| 1643 | (version "4.0") | ||
| 1644 | (source | ||
| 1645 | (origin | ||
| 1646 | (method url-fetch) | ||
| 1647 | (uri (string-append | ||
| 1648 | "https://pypi.python.org/packages/source/c/click/click-" | ||
| 1649 | version ".tar.gz")) | ||
| 1650 | (sha256 | ||
| 1651 | (base32 "0294x9g28w6zgswl0rsygkwi0wf6n480gf7fiiw5f9az3xhh77pl")))) | ||
| 1652 | (build-system python-build-system) | ||
| 1653 | (native-inputs | ||
| 1654 | `(("python-setuptools" ,python-setuptools))) | ||
| 1655 | (home-page "http://click.pocoo.org") | ||
| 1656 | (synopsis "Command line library for Python") | ||
| 1657 | (description | ||
| 1658 | "Click is a Python package for creating command line interfaces in a | ||
| 1659 | composable way with as little code as necessary. Its name stands for | ||
| 1660 | \"Command Line Interface Creation Kit\". It's highly configurable but comes | ||
| 1661 | with sensible defaults out of the box.") | ||
| 1662 | (license bsd-3))) | ||
| 1663 | |||
| 1664 | (define-public python2-click | ||
| 1665 | (package-with-python2 python-click)) | ||
| 1666 | |||
| 1601 | (define-public python-requests | 1667 | (define-public python-requests |
| 1602 | (package | 1668 | (package |
| 1603 | (name "python-requests") | 1669 | (name "python-requests") |
| @@ -2065,6 +2131,101 @@ mining and data analysis.") | |||
| 2065 | (alist-delete | 2131 | (alist-delete |
| 2066 | "python-scipy" (package-propagated-inputs scikit)))))))) | 2132 | "python-scipy" (package-propagated-inputs scikit)))))))) |
| 2067 | 2133 | ||
| 2134 | (define-public python-scikit-image | ||
| 2135 | (package | ||
| 2136 | (name "python-scikit-image") | ||
| 2137 | (version "0.11.3") | ||
| 2138 | (source | ||
| 2139 | (origin | ||
| 2140 | (method url-fetch) | ||
| 2141 | (uri (string-append | ||
| 2142 | "https://pypi.python.org/packages/source/s/scikit-image/scikit-image-" | ||
| 2143 | version ".tar.gz")) | ||
| 2144 | (sha256 | ||
| 2145 | (base32 "0jz416fqvpahqyffw8plmszzfj669w8wvf3y9clnr5lr6a7md3kn")))) | ||
| 2146 | (build-system python-build-system) | ||
| 2147 | (propagated-inputs | ||
| 2148 | `(("python-matplotlib" ,python-matplotlib) | ||
| 2149 | ("python-networkx" ,python-networkx) | ||
| 2150 | ("python-numpy" ,python-numpy) | ||
| 2151 | ("python-scipy" ,python-scipy) | ||
| 2152 | ("python-six" ,python-six) | ||
| 2153 | ("python-pillow" ,python-pillow))) | ||
| 2154 | (native-inputs | ||
| 2155 | `(("python-cython" ,python-cython) | ||
| 2156 | ("python-setuptools" ,python-setuptools))) | ||
| 2157 | (home-page "http://scikit-image.org/") | ||
| 2158 | (synopsis "Image processing in Python") | ||
| 2159 | (description | ||
| 2160 | "scikit-image is a collection of algorithms for image processing.") | ||
| 2161 | (license bsd-3))) | ||
| 2162 | |||
| 2163 | (define-public python2-scikit-image | ||
| 2164 | (let ((scikit-image (package-with-python2 python-scikit-image))) | ||
| 2165 | (package (inherit scikit-image) | ||
| 2166 | (native-inputs | ||
| 2167 | `(("python2-mock" ,python2-mock) | ||
| 2168 | ,@(package-native-inputs scikit-image))) | ||
| 2169 | (propagated-inputs | ||
| 2170 | `(("python2-pytz" ,python2-pytz) | ||
| 2171 | ,@(package-propagated-inputs scikit-image)))))) | ||
| 2172 | |||
| 2173 | (define-public python-redis | ||
| 2174 | (package | ||
| 2175 | (name "python-redis") | ||
| 2176 | (version "2.10.3") | ||
| 2177 | (source | ||
| 2178 | (origin | ||
| 2179 | (method url-fetch) | ||
| 2180 | (uri (string-append | ||
| 2181 | "https://pypi.python.org/packages/source/r/redis/redis-" | ||
| 2182 | version ".tar.gz")) | ||
| 2183 | (sha256 | ||
| 2184 | (base32 "1701qjwn4n05q90fdg4bsg96s27xf5s4hsb4gxhv3xk052q3gyx4")))) | ||
| 2185 | (build-system python-build-system) | ||
| 2186 | ;; Tests require a running Redis server | ||
| 2187 | (arguments '(#:tests? #f)) | ||
| 2188 | (native-inputs | ||
| 2189 | `(("python-setuptools" ,python-setuptools) | ||
| 2190 | ("python-pytest" ,python-pytest))) | ||
| 2191 | (home-page "https://github.com/andymccurdy/redis-py") | ||
| 2192 | (synopsis "Redis Python client") | ||
| 2193 | (description | ||
| 2194 | "This package provides a Python interface to the Redis key-value store.") | ||
| 2195 | (license license:expat))) | ||
| 2196 | |||
| 2197 | (define-public python2-redis | ||
| 2198 | (package-with-python2 python-redis)) | ||
| 2199 | |||
| 2200 | (define-public python-rq | ||
| 2201 | (package | ||
| 2202 | (name "python-rq") | ||
| 2203 | (version "0.5.2") | ||
| 2204 | (source | ||
| 2205 | (origin | ||
| 2206 | (method url-fetch) | ||
| 2207 | (uri (string-append | ||
| 2208 | "https://pypi.python.org/packages/source/r/rq/rq-" | ||
| 2209 | version ".tar.gz")) | ||
| 2210 | (sha256 | ||
| 2211 | (base32 "0b0z5hn8wkfg300hx7816csgv3bcfamlr29fi3yzgqmpqxwj3fix")))) | ||
| 2212 | (build-system python-build-system) | ||
| 2213 | (propagated-inputs | ||
| 2214 | `(("python-click" ,python-click) | ||
| 2215 | ("python-redis" ,python-redis))) | ||
| 2216 | (native-inputs | ||
| 2217 | `(("python-setuptools" ,python-setuptools))) | ||
| 2218 | (home-page "http://python-rq.org/") | ||
| 2219 | (synopsis "Simple job queues for Python") | ||
| 2220 | (description | ||
| 2221 | "RQ (Redis Queue) is a simple Python library for queueing jobs and | ||
| 2222 | processing them in the background with workers. It is backed by Redis and it | ||
| 2223 | is designed to have a low barrier to entry.") | ||
| 2224 | (license bsd-2))) | ||
| 2225 | |||
| 2226 | (define-public python2-rq | ||
| 2227 | (package-with-python2 python-rq)) | ||
| 2228 | |||
| 2068 | (define-public python-cython | 2229 | (define-public python-cython |
| 2069 | (package | 2230 | (package |
| 2070 | (name "python-cython") | 2231 | (name "python-cython") |
| @@ -2122,7 +2283,7 @@ writing C extensions for Python as easy as Python itself.") | |||
| 2122 | (build-system python-build-system) | 2283 | (build-system python-build-system) |
| 2123 | (inputs | 2284 | (inputs |
| 2124 | `(("python-nose" ,python-nose) | 2285 | `(("python-nose" ,python-nose) |
| 2125 | ("atlas" ,atlas))) | 2286 | ("openblas" ,openblas))) |
| 2126 | (native-inputs | 2287 | (native-inputs |
| 2127 | `(("gfortran" ,gfortran-4.8))) | 2288 | `(("gfortran" ,gfortran-4.8))) |
| 2128 | (arguments | 2289 | (arguments |
| @@ -2130,16 +2291,18 @@ writing C extensions for Python as easy as Python itself.") | |||
| 2130 | (alist-cons-before | 2291 | (alist-cons-before |
| 2131 | 'build 'set-environment-variables | 2292 | 'build 'set-environment-variables |
| 2132 | (lambda* (#:key inputs #:allow-other-keys) | 2293 | (lambda* (#:key inputs #:allow-other-keys) |
| 2133 | (let* ((atlas-threaded | 2294 | (call-with-output-file "site.cfg" |
| 2134 | (string-append (assoc-ref inputs "atlas") | 2295 | (lambda (port) |
| 2135 | "/lib/libtatlas.so")) | 2296 | (format port "[openblas] |
| 2136 | ;; On single core CPUs only the serial library is created. | 2297 | libraries = openblas |
| 2137 | (atlas-lib | 2298 | library_dirs = ~a/lib |
| 2138 | (if (file-exists? atlas-threaded) | 2299 | include_dirs = ~a/include |
| 2139 | atlas-threaded | 2300 | " (assoc-ref inputs "openblas") (assoc-ref inputs "openblas")))) |
| 2140 | (string-append (assoc-ref inputs "atlas") | 2301 | ;; Use "gcc" executable, not "cc". |
| 2141 | "/lib/libsatlas.so")))) | 2302 | (substitute* "numpy/distutils/system_info.py" |
| 2142 | (setenv "ATLAS" atlas-lib))) | 2303 | (("c = distutils\\.ccompiler\\.new_compiler\\(\\)") |
| 2304 | "c = distutils.ccompiler.new_compiler(); c.set_executables(compiler='gcc',compiler_so='gcc',linker_exe='gcc',linker_so='gcc -shared')")) | ||
| 2305 | #t) | ||
| 2143 | ;; Tests can only be run after the library has been installed and not | 2306 | ;; Tests can only be run after the library has been installed and not |
| 2144 | ;; within the source directory. | 2307 | ;; within the source directory. |
| 2145 | (alist-cons-after | 2308 | (alist-cons-after |
| @@ -2627,7 +2790,7 @@ services for your Python modules and applications.") | |||
| 2627 | (define-public python-pillow | 2790 | (define-public python-pillow |
| 2628 | (package | 2791 | (package |
| 2629 | (name "python-pillow") | 2792 | (name "python-pillow") |
| 2630 | (version "2.6.1") | 2793 | (version "2.8.1") |
| 2631 | (source | 2794 | (source |
| 2632 | (origin | 2795 | (origin |
| 2633 | (method url-fetch) | 2796 | (method url-fetch) |
| @@ -2635,17 +2798,19 @@ services for your Python modules and applications.") | |||
| 2635 | "Pillow/Pillow-" version ".tar.gz")) | 2798 | "Pillow/Pillow-" version ".tar.gz")) |
| 2636 | (sha256 | 2799 | (sha256 |
| 2637 | (base32 | 2800 | (base32 |
| 2638 | "0iw36c73wkhz88wa78v6l43llsb080ihw8yq7adhfqxdib7l4hzr")))) | 2801 | "15n92axxph2s3kvg68bki9gv3nzwgq7130kp7wbblpi1l0cc2q47")))) |
| 2639 | (build-system python-build-system) | 2802 | (build-system python-build-system) |
| 2640 | (native-inputs | 2803 | (native-inputs |
| 2641 | `(("python-setuptools" ,python-setuptools) | 2804 | `(("python-setuptools" ,python-setuptools) |
| 2642 | ("python-nose" ,python-nose))) | 2805 | ("python-nose" ,python-nose))) |
| 2643 | (inputs | 2806 | (inputs |
| 2644 | `(("lcms" ,lcms) | 2807 | `(("freetype" ,freetype) |
| 2808 | ("lcms" ,lcms) | ||
| 2645 | ("zlib" ,zlib) | 2809 | ("zlib" ,zlib) |
| 2646 | ("libjpeg" ,libjpeg) | 2810 | ("libjpeg" ,libjpeg) |
| 2647 | ("openjpeg" ,openjpeg) | 2811 | ("openjpeg" ,openjpeg) |
| 2648 | ("libtiff" ,libtiff))) | 2812 | ("libtiff" ,libtiff) |
| 2813 | ("libwebp" ,libwebp))) | ||
| 2649 | (propagated-inputs | 2814 | (propagated-inputs |
| 2650 | `(;; Used at runtime for pkg_resources | 2815 | `(;; Used at runtime for pkg_resources |
| 2651 | ("python-setuptools" ,python-setuptools))) | 2816 | ("python-setuptools" ,python-setuptools))) |
| @@ -3113,9 +3278,7 @@ features useful for text console applications.") | |||
| 3113 | `(("pkg-config" ,pkg-config))) | 3278 | `(("pkg-config" ,pkg-config))) |
| 3114 | (inputs | 3279 | (inputs |
| 3115 | `(("python" ,python) | 3280 | `(("python" ,python) |
| 3116 | ("dbus" ,dbus) | 3281 | ("dbus-glib" ,dbus-glib))) |
| 3117 | ("dbus-glib" ,dbus-glib) | ||
| 3118 | ("glib" ,glib))) | ||
| 3119 | (synopsis "Python bindings for D-bus") | 3282 | (synopsis "Python bindings for D-bus") |
| 3120 | (description "python-dbus provides bindings for libdbus, the reference | 3283 | (description "python-dbus provides bindings for libdbus, the reference |
| 3121 | implementation of D-Bus.") | 3284 | implementation of D-Bus.") |
| @@ -3201,43 +3364,6 @@ libxml2 and libxslt.") | |||
| 3201 | (define-public python2-lxml | 3364 | (define-public python2-lxml |
| 3202 | (package-with-python2 python-lxml)) | 3365 | (package-with-python2 python-lxml)) |
| 3203 | 3366 | ||
| 3204 | (define-public python-pillow | ||
| 3205 | (package | ||
| 3206 | (name "python-pillow") | ||
| 3207 | (version "2.7.0") | ||
| 3208 | (source | ||
| 3209 | (origin | ||
| 3210 | (method url-fetch) | ||
| 3211 | (uri (string-append | ||
| 3212 | "https://pypi.python.org/packages/source/P/Pillow/Pillow-" | ||
| 3213 | version | ||
| 3214 | ".tar.gz")) | ||
| 3215 | (sha256 | ||
| 3216 | (base32 | ||
| 3217 | "1y0rysgd7vqpl5lh0lsra7j2k30azwxqlh5jnqk1i0pmfc735s96")))) | ||
| 3218 | (build-system python-build-system) | ||
| 3219 | (inputs | ||
| 3220 | `(("freetype" ,freetype) | ||
| 3221 | ("lcms" ,lcms) | ||
| 3222 | ("libjpeg" ,libjpeg) | ||
| 3223 | ("libtiff" ,libtiff) | ||
| 3224 | ("openjpeg" ,openjpeg) | ||
| 3225 | ("python-setuptools" ,python-setuptools) | ||
| 3226 | ("zlib" ,zlib))) | ||
| 3227 | (arguments | ||
| 3228 | `(#:tests? #f)) ; no check target | ||
| 3229 | (home-page "http://python-pillow.github.io/") | ||
| 3230 | (synopsis "Pillow fork of Python Imaging Library") | ||
| 3231 | (description "Pillow is a fork of the Python Imaging Library (PIL).") | ||
| 3232 | ;; PIL license, see | ||
| 3233 | ;; http://www.pythonware.com/products/pil/license.htm | ||
| 3234 | (license (x11-style | ||
| 3235 | "file://PKG-INFO" | ||
| 3236 | "See http://www.pythonware.com/products/pil/license.htm")))) | ||
| 3237 | |||
| 3238 | (define-public python2-pillow | ||
| 3239 | (package-with-python2 python-pillow)) | ||
| 3240 | |||
| 3241 | (define-public python2-pil | 3367 | (define-public python2-pil |
| 3242 | (package | 3368 | (package |
| 3243 | (name "python2-pil") | 3369 | (name "python2-pil") |
| @@ -3446,6 +3572,67 @@ providing a clean and modern domain specific specification language (DSL) in | |||
| 3446 | Python style, together with a fast and comfortable execution environment.") | 3572 | Python style, together with a fast and comfortable execution environment.") |
| 3447 | (license license:expat))) | 3573 | (license license:expat))) |
| 3448 | 3574 | ||
| 3575 | (define-public python-seaborn | ||
| 3576 | (package | ||
| 3577 | (name "python-seaborn") | ||
| 3578 | (version "0.5.1") | ||
| 3579 | (source | ||
| 3580 | (origin | ||
| 3581 | (method url-fetch) | ||
| 3582 | (uri (string-append | ||
| 3583 | "https://pypi.python.org/packages/source/s/seaborn/seaborn-" | ||
| 3584 | version ".tar.gz")) | ||
| 3585 | (sha256 | ||
| 3586 | (base32 "1236abw18ijjglmv60q85ckqrvgf5qyy4zlq7nz5aqfg6q87z3wc")))) | ||
| 3587 | (build-system python-build-system) | ||
| 3588 | (propagated-inputs | ||
| 3589 | `(("python-pandas" ,python-pandas) | ||
| 3590 | ("python-matplotlib" ,python-matplotlib) | ||
| 3591 | ("python-scipy" ,python-scipy))) | ||
| 3592 | (native-inputs | ||
| 3593 | `(("python-setuptools" ,python-setuptools))) | ||
| 3594 | (home-page "http://stanford.edu/~mwaskom/software/seaborn/") | ||
| 3595 | (synopsis "Statistical data visualization") | ||
| 3596 | (description | ||
| 3597 | "Seaborn is a library for making attractive and informative statistical | ||
| 3598 | graphics in Python. It is built on top of matplotlib and tightly integrated | ||
| 3599 | with the PyData stack, including support for numpy and pandas data structures | ||
| 3600 | and statistical routines from scipy and statsmodels.") | ||
| 3601 | (license bsd-3))) | ||
| 3602 | |||
| 3603 | (define-public python2-seaborn | ||
| 3604 | (let ((seaborn (package-with-python2 python-seaborn))) | ||
| 3605 | (package (inherit seaborn) | ||
| 3606 | (propagated-inputs | ||
| 3607 | `(("python2-pytz" ,python2-pytz) | ||
| 3608 | ,@(package-propagated-inputs seaborn)))))) | ||
| 3609 | |||
| 3610 | (define-public python-sympy | ||
| 3611 | (package | ||
| 3612 | (name "python-sympy") | ||
| 3613 | (version "0.7.6") | ||
| 3614 | (source | ||
| 3615 | (origin | ||
| 3616 | (method url-fetch) | ||
| 3617 | (uri (string-append | ||
| 3618 | "https://github.com/sympy/sympy/releases/download/sympy-" | ||
| 3619 | version "/sympy-" version ".tar.gz")) | ||
| 3620 | (sha256 | ||
| 3621 | (base32 "19yp0gy4i7p4g6l3b8vaqkj9qj7yqb5kqy0qgbdagpzgkdz958yz")))) | ||
| 3622 | (build-system python-build-system) | ||
| 3623 | (native-inputs | ||
| 3624 | `(("python-setuptools" ,python-setuptools))) | ||
| 3625 | (home-page "http://www.sympy.org/") | ||
| 3626 | (synopsis "Python library for symbolic mathematics") | ||
| 3627 | (description | ||
| 3628 | "SymPy is a Python library for symbolic mathematics. It aims to become a | ||
| 3629 | full-featured computer algebra system (CAS) while keeping the code as simple | ||
| 3630 | as possible in order to be comprehensible and easily extensible.") | ||
| 3631 | (license bsd-3))) | ||
| 3632 | |||
| 3633 | (define-public python2-sympy | ||
| 3634 | (package-with-python2 python-sympy)) | ||
| 3635 | |||
| 3449 | (define-public python-testlib | 3636 | (define-public python-testlib |
| 3450 | (package | 3637 | (package |
| 3451 | (name "python-testlib") | 3638 | (name "python-testlib") |
| @@ -3606,3 +3793,37 @@ applications.") | |||
| 3606 | 3793 | ||
| 3607 | (define-public python2-waf | 3794 | (define-public python2-waf |
| 3608 | (package-with-python2 python-waf)) | 3795 | (package-with-python2 python-waf)) |
| 3796 | |||
| 3797 | (define-public python-pyzmq | ||
| 3798 | (package | ||
| 3799 | (name "python-pyzmq") | ||
| 3800 | (version "14.6.0") | ||
| 3801 | (source | ||
| 3802 | (origin | ||
| 3803 | (method url-fetch) | ||
| 3804 | (uri (string-append | ||
| 3805 | "https://pypi.python.org/packages/source/p/pyzmq/pyzmq-" | ||
| 3806 | version ".tar.gz")) | ||
| 3807 | (sha256 | ||
| 3808 | (base32 "1frmbjykvhmdg64g7sn20c9fpamrsfxwci1nhhg8q7jgz5pq0ikp")))) | ||
| 3809 | (build-system python-build-system) | ||
| 3810 | (arguments | ||
| 3811 | `(#:configure-flags | ||
| 3812 | (list (string-append "--zmq=" (assoc-ref %build-inputs "zeromq"))) | ||
| 3813 | ;; FIXME: You must build pyzmq with 'python setup.py build_ext | ||
| 3814 | ;; --inplace' for 'python setup.py test' to work. | ||
| 3815 | #:tests? #f)) | ||
| 3816 | (inputs | ||
| 3817 | `(("zeromq" ,zeromq))) | ||
| 3818 | (native-inputs | ||
| 3819 | `(("pkg-config" ,pkg-config) | ||
| 3820 | ("python-nose" ,python-nose) | ||
| 3821 | ("python-setuptools" ,python-setuptools))) | ||
| 3822 | (home-page "http://github.com/zeromq/pyzmq") | ||
| 3823 | (synopsis "Python bindings for 0MQ") | ||
| 3824 | (description | ||
| 3825 | "PyZMQ is the official Python binding for the ZeroMQ messaging library.") | ||
| 3826 | (license bsd-4))) | ||
| 3827 | |||
| 3828 | (define-public python2-pyzmq | ||
| 3829 | (package-with-python2 python-pyzmq)) | ||
diff --git a/gnu/packages/qemu.scm b/gnu/packages/qemu.scm index 77aeecf40ce..27a2d2e8ba6 100644 --- a/gnu/packages/qemu.scm +++ b/gnu/packages/qemu.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -33,6 +34,7 @@ | |||
| 33 | #:use-module (gnu packages image) | 34 | #:use-module (gnu packages image) |
| 34 | #:use-module (gnu packages attr) | 35 | #:use-module (gnu packages attr) |
| 35 | #:use-module (gnu packages linux) | 36 | #:use-module (gnu packages linux) |
| 37 | #:use-module (gnu packages libusb) | ||
| 36 | #:use-module (gnu packages xdisorg) | 38 | #:use-module (gnu packages xdisorg) |
| 37 | #:use-module (gnu packages gl) | 39 | #:use-module (gnu packages gl) |
| 38 | #:use-module (gnu packages sdl) | 40 | #:use-module (gnu packages sdl) |
| @@ -42,14 +44,16 @@ | |||
| 42 | ;; This is QEMU without GUI support. | 44 | ;; This is QEMU without GUI support. |
| 43 | (package | 45 | (package |
| 44 | (name "qemu-headless") | 46 | (name "qemu-headless") |
| 45 | (version "2.2.0") | 47 | (version "2.3.0") |
| 46 | (source (origin | 48 | (source (origin |
| 47 | (method url-fetch) | 49 | (method url-fetch) |
| 48 | (uri (string-append "http://wiki.qemu-project.org/download/qemu-" | 50 | (uri (string-append "http://wiki.qemu-project.org/download/qemu-" |
| 49 | version ".tar.bz2")) | 51 | version ".tar.bz2")) |
| 50 | (sha256 | 52 | (sha256 |
| 51 | (base32 | 53 | (base32 |
| 52 | "1703c3scl5n07gmpilg7g2xzyxnr7jczxgx6nn4m8kv9gin9p35n")))) | 54 | "120m53c3p28qxmfzllicjzr8syjv6v4d9rsyrgkp7gnmcgvvgfmn")) |
| 55 | (patches (map search-patch '("qemu-CVE-2015-3209.patch" | ||
| 56 | "qemu-CVE-2015-3456.patch"))))) | ||
| 53 | (build-system gnu-build-system) | 57 | (build-system gnu-build-system) |
| 54 | (arguments | 58 | (arguments |
| 55 | '(#:phases (alist-replace | 59 | '(#:phases (alist-replace |
| @@ -137,4 +141,5 @@ server and embedded PowerPC, and S390 guests.") | |||
| 137 | (synopsis "Machine emulator and virtualizer") | 141 | (synopsis "Machine emulator and virtualizer") |
| 138 | (inputs `(("sdl" ,sdl) | 142 | (inputs `(("sdl" ,sdl) |
| 139 | ("mesa" ,mesa) | 143 | ("mesa" ,mesa) |
| 144 | ("libusb" ,libusb) ;USB pass-through support | ||
| 140 | ,@(package-inputs qemu-headless))))) | 145 | ,@(package-inputs qemu-headless))))) |
diff --git a/gnu/packages/rdf.scm b/gnu/packages/rdf.scm index f26b021e50e..cee7f423985 100644 --- a/gnu/packages/rdf.scm +++ b/gnu/packages/rdf.scm | |||
| @@ -221,9 +221,10 @@ Turtle/N3 and read them in SPARQL XML, RDF/XML and Turtle/N3.") | |||
| 221 | (native-inputs | 221 | (native-inputs |
| 222 | `(("perl" ,perl) ; needed for installation | 222 | `(("perl" ,perl) ; needed for installation |
| 223 | ("pkg-config" ,pkg-config))) | 223 | ("pkg-config" ,pkg-config))) |
| 224 | (propagated-inputs | ||
| 225 | `(("rasqal" ,rasqal))) ; in Requires.private field of .pc | ||
| 224 | (inputs | 226 | (inputs |
| 225 | `(("bdb" ,bdb) | 227 | `(("bdb" ,bdb))) |
| 226 | ("rasqal" ,rasqal))) | ||
| 227 | (home-page "http://librdf.org/") | 228 | (home-page "http://librdf.org/") |
| 228 | (synopsis "RDF library") | 229 | (synopsis "RDF library") |
| 229 | (description "The Redland RDF Library (librdf) provides the RDF API | 230 | (description "The Redland RDF Library (librdf) provides the RDF API |
| @@ -317,7 +318,6 @@ ideal (e.g. in LV2 implementations or embedded applications).") | |||
| 317 | (inputs | 318 | (inputs |
| 318 | `(("clucene" ,clucene) | 319 | `(("clucene" ,clucene) |
| 319 | ("qt" ,qt-4) | 320 | ("qt" ,qt-4) |
| 320 | ("rasqal" ,rasqal) | ||
| 321 | ("redland" ,redland))) | 321 | ("redland" ,redland))) |
| 322 | (home-page "http://soprano.sourceforge.net/") | 322 | (home-page "http://soprano.sourceforge.net/") |
| 323 | (synopsis "RDF data library for Qt") | 323 | (synopsis "RDF data library for Qt") |
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 42fcc930171..9943de7e0be 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm | |||
| @@ -167,3 +167,200 @@ translation data, custom key/scope separator, custom exception handlers, and | |||
| 167 | an extensible architecture with a swappable backend.") | 167 | an extensible architecture with a swappable backend.") |
| 168 | (home-page "http://github.com/svenfuchs/i18n") | 168 | (home-page "http://github.com/svenfuchs/i18n") |
| 169 | (license license:expat))) | 169 | (license license:expat))) |
| 170 | |||
| 171 | ;; RSpec is the dominant testing library for Ruby projects. Even RSpec's | ||
| 172 | ;; dependencies use RSpec for their test suites! To avoid these circular | ||
| 173 | ;; dependencies, we disable tests for all of the RSpec-related packages. | ||
| 174 | (define ruby-rspec-support | ||
| 175 | (package | ||
| 176 | (name "ruby-rspec-support") | ||
| 177 | (version "3.2.2") | ||
| 178 | (source (origin | ||
| 179 | (method url-fetch) | ||
| 180 | (uri (string-append | ||
| 181 | "https://github.com/rspec/rspec-support/archive/v" | ||
| 182 | version ".tar.gz")) | ||
| 183 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 184 | (sha256 | ||
| 185 | (base32 | ||
| 186 | "1pvzfrqgy0z0gwmdgjp9f2vz1d9c0cajyzfqj9z8i2ssxnzmj4bv")))) | ||
| 187 | (build-system ruby-build-system) | ||
| 188 | (arguments | ||
| 189 | '(#:tests? #f)) ; avoid dependency cycles | ||
| 190 | (synopsis "RSpec support library") | ||
| 191 | (description "Support utilities for RSpec gems.") | ||
| 192 | (home-page "https://github.com/rspec/rspec-support") | ||
| 193 | (license license:expat))) | ||
| 194 | |||
| 195 | (define-public ruby-rspec-core | ||
| 196 | (package | ||
| 197 | (name "ruby-rspec-core") | ||
| 198 | (version "3.2.3") | ||
| 199 | (source (origin | ||
| 200 | (method url-fetch) | ||
| 201 | (uri (string-append | ||
| 202 | "https://github.com/rspec/rspec-core/archive/v" | ||
| 203 | version ".tar.gz")) | ||
| 204 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 205 | (sha256 | ||
| 206 | (base32 | ||
| 207 | "1clsa4lkh5c9c7xc3xa336ym00ycr67pchpg1bv4y3fz5hvzw8ki")))) | ||
| 208 | (build-system ruby-build-system) | ||
| 209 | (arguments | ||
| 210 | '(#:tests? #f)) ; avoid dependency cycles | ||
| 211 | (propagated-inputs | ||
| 212 | `(("ruby-rspec-support" ,ruby-rspec-support))) | ||
| 213 | (synopsis "RSpec core library") | ||
| 214 | (description "Rspec-core provides the RSpec test runner and example | ||
| 215 | groups.") | ||
| 216 | (home-page "https://github.com/rspec/rspec-core") | ||
| 217 | (license license:expat))) | ||
| 218 | |||
| 219 | (define ruby-diff-lcs-for-rspec | ||
| 220 | (package | ||
| 221 | (name "ruby-diff-lcs") | ||
| 222 | (version "1.2.5") | ||
| 223 | (source (origin | ||
| 224 | (method url-fetch) | ||
| 225 | (uri (string-append | ||
| 226 | "https://github.com/halostatue/diff-lcs/archive/v" | ||
| 227 | version ".tar.gz")) | ||
| 228 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 229 | (sha256 | ||
| 230 | (base32 | ||
| 231 | "0kmfz2qdwbfjf97rx27hh9fm39mv3z9avjmvsajqnb5wxj2l5l4s")))) | ||
| 232 | (build-system ruby-build-system) | ||
| 233 | (arguments | ||
| 234 | '(#:tests? #f)) ; avoid dependency cycles | ||
| 235 | (synopsis "Compute the difference between two Enumerable sequences") | ||
| 236 | (description "Diff::LCS computes the difference between two Enumerable | ||
| 237 | sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm. | ||
| 238 | It includes utilities to create a simple HTML diff output format and a | ||
| 239 | standard diff-like tool.") | ||
| 240 | (home-page "https://github.com/halostatue/diff-lcs") | ||
| 241 | (license license:expat))) | ||
| 242 | |||
| 243 | (define-public ruby-rspec-expectations | ||
| 244 | (package | ||
| 245 | (name "ruby-rspec-expectations") | ||
| 246 | (version "3.2.1") | ||
| 247 | (source (origin | ||
| 248 | (method url-fetch) | ||
| 249 | (uri (string-append | ||
| 250 | "https://github.com/rspec/rspec-expectations/archive/v" | ||
| 251 | version ".tar.gz")) | ||
| 252 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 253 | (sha256 | ||
| 254 | (base32 | ||
| 255 | "0h0rpprbh6h59gmksiyi1b8w6cvcai4wdbkikajwx3w1asxi6f7x")))) | ||
| 256 | (build-system ruby-build-system) | ||
| 257 | (arguments | ||
| 258 | '(#:tests? #f)) ; avoid dependency cycles | ||
| 259 | (propagated-inputs | ||
| 260 | `(("ruby-rspec-support" ,ruby-rspec-support) | ||
| 261 | ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec))) | ||
| 262 | (synopsis "RSpec expecations library") | ||
| 263 | (description "Rspec-expectations provides a simple API to express expected | ||
| 264 | outcomes of a code example.") | ||
| 265 | (home-page "https://github.com/rspec/rspec-expectations") | ||
| 266 | (license license:expat))) | ||
| 267 | |||
| 268 | (define-public ruby-rspec-mocks | ||
| 269 | (package | ||
| 270 | (name "ruby-rspec-mocks") | ||
| 271 | (version "3.2.1") | ||
| 272 | (source (origin | ||
| 273 | (method url-fetch) | ||
| 274 | (uri (string-append | ||
| 275 | "https://github.com/rspec/rspec-mocks/archive/v" | ||
| 276 | version ".tar.gz")) | ||
| 277 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 278 | (sha256 | ||
| 279 | (base32 | ||
| 280 | "1xzxsg0idxkg7czmjgqq10lcd821ibw1hjzn404sk9j6rw0fbx2g")))) | ||
| 281 | (build-system ruby-build-system) | ||
| 282 | (arguments | ||
| 283 | '(#:tests? #f)) ; avoid dependency cycles | ||
| 284 | (propagated-inputs | ||
| 285 | `(("ruby-rspec-support" ,ruby-rspec-support) | ||
| 286 | ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec))) | ||
| 287 | (synopsis "RSpec stubbing and mocking library") | ||
| 288 | (description "Rspec-mocks provides RSpec's \"test double\" framework, with | ||
| 289 | support for stubbing and mocking.") | ||
| 290 | (home-page "https://github.com/rspec/rspec-mocks") | ||
| 291 | (license license:expat))) | ||
| 292 | |||
| 293 | (define-public ruby-rspec | ||
| 294 | (package | ||
| 295 | (name "ruby-rspec") | ||
| 296 | (version "3.2.0") | ||
| 297 | (source (origin | ||
| 298 | (method url-fetch) | ||
| 299 | (uri (string-append | ||
| 300 | "https://github.com/rspec/rspec/archive/v" | ||
| 301 | version ".tar.gz")) | ||
| 302 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 303 | (sha256 | ||
| 304 | (base32 | ||
| 305 | "1jg38dbaknsdhiav5vnrwfccg524fwcg6sq1715441vx1xl6p54q")))) | ||
| 306 | (build-system ruby-build-system) | ||
| 307 | (arguments | ||
| 308 | '(#:tests? #f)) ; avoid dependency cycles | ||
| 309 | (propagated-inputs | ||
| 310 | `(("ruby-rspec-core" ,ruby-rspec-core) | ||
| 311 | ("ruby-rspec-mocks" ,ruby-rspec-mocks) | ||
| 312 | ("ruby-rspec-expectations" ,ruby-rspec-expectations))) | ||
| 313 | (synopsis "Behavior-driven development framework for Ruby") | ||
| 314 | (description "RSpec is a behavior-driven development (BDD) framework for | ||
| 315 | Ruby. This meta-package includes the RSpec test runner, along with the | ||
| 316 | expectations and mocks frameworks.") | ||
| 317 | (home-page "http://rspec.info/") | ||
| 318 | (license license:expat))) | ||
| 319 | |||
| 320 | ;; Bundler is yet another source of circular dependencies, so we must disable | ||
| 321 | ;; its test suite as well. | ||
| 322 | (define-public bundler | ||
| 323 | (package | ||
| 324 | (name "bundler") | ||
| 325 | (version "1.9.9") | ||
| 326 | (source (origin | ||
| 327 | (method url-fetch) | ||
| 328 | (uri (string-append "https://github.com/bundler/bundler/archive/v" | ||
| 329 | version ".tar.gz")) | ||
| 330 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 331 | (sha256 | ||
| 332 | (base32 | ||
| 333 | "08flx3n9hb3yz8mm5k16cdz0sb7g774f6vxn6gc3wfh5la83vfyx")))) | ||
| 334 | (build-system ruby-build-system) | ||
| 335 | (arguments | ||
| 336 | '(#:tests? #f)) ; avoid dependency cycles | ||
| 337 | (synopsis "Ruby gem bundler") | ||
| 338 | (description "Bundler automatically downloads and installs a list of gems | ||
| 339 | specified in a \"Gemfile\", as well as their dependencies.") | ||
| 340 | (home-page "http://bundler.io/") | ||
| 341 | (license license:expat))) | ||
| 342 | |||
| 343 | (define-public ruby-useragent | ||
| 344 | (package | ||
| 345 | (name "ruby-useragent") | ||
| 346 | (version "0.13.3") | ||
| 347 | (source (origin | ||
| 348 | (method url-fetch) | ||
| 349 | (uri (string-append | ||
| 350 | "https://github.com/gshutler/useragent/archive/v" | ||
| 351 | version ".tar.gz")) | ||
| 352 | (file-name (string-append name "-" version ".tar.gz")) | ||
| 353 | (sha256 | ||
| 354 | (base32 | ||
| 355 | "1hj00fw06i0y3rwxxhxmnrqxhpnffv4zfqx2sqqpc5qc4fdvd2x9")))) | ||
| 356 | (build-system ruby-build-system) | ||
| 357 | (arguments | ||
| 358 | '(#:test-target "spec")) | ||
| 359 | (native-inputs | ||
| 360 | `(("ruby-rspec" ,ruby-rspec) | ||
| 361 | ("bundler" ,bundler))) | ||
| 362 | (synopsis "HTTP user agent parser for Ruby") | ||
| 363 | (description "UserAgent is a Ruby library that parses and compares HTTP | ||
| 364 | User Agents.") | ||
| 365 | (home-page "https://github.com/gshutler/useragent") | ||
| 366 | (license license:expat))) | ||
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index 77d0d846c83..803b8d5a209 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #:use-module (gnu packages databases) | 29 | #:use-module (gnu packages databases) |
| 30 | #:use-module (gnu packages emacs) | 30 | #:use-module (gnu packages emacs) |
| 31 | #:use-module (gnu packages texinfo) | 31 | #:use-module (gnu packages texinfo) |
| 32 | #:use-module (gnu packages elf) | ||
| 33 | #:use-module (gnu packages base) | 32 | #:use-module (gnu packages base) |
| 34 | #:use-module (gnu packages pkg-config) | 33 | #:use-module (gnu packages pkg-config) |
| 35 | #:use-module (gnu packages avahi) | 34 | #:use-module (gnu packages avahi) |
| @@ -39,6 +38,7 @@ | |||
| 39 | #:use-module (gnu packages libffi) | 38 | #:use-module (gnu packages libffi) |
| 40 | #:use-module (gnu packages fontutils) | 39 | #:use-module (gnu packages fontutils) |
| 41 | #:use-module (gnu packages image) | 40 | #:use-module (gnu packages image) |
| 41 | #:use-module (gnu packages xorg) | ||
| 42 | #:use-module (ice-9 match)) | 42 | #:use-module (ice-9 match)) |
| 43 | 43 | ||
| 44 | (define (mit-scheme-source-directory system version) | 44 | (define (mit-scheme-source-directory system version) |
| @@ -91,6 +91,7 @@ | |||
| 91 | ;; ("texlive-core" ,texlive-core) | 91 | ;; ("texlive-core" ,texlive-core) |
| 92 | ("texinfo" ,texinfo) | 92 | ("texinfo" ,texinfo) |
| 93 | ("m4" ,m4) | 93 | ("m4" ,m4) |
| 94 | ("libx11" ,libx11) | ||
| 94 | 95 | ||
| 95 | ("source" | 96 | ("source" |
| 96 | 97 | ||
| @@ -235,55 +236,27 @@ Scheme and C programs and between Scheme and Java programs.") | |||
| 235 | (sha256 | 236 | (sha256 |
| 236 | (base32 | 237 | (base32 |
| 237 | "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3")) | 238 | "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3")) |
| 238 | (patches (list (search-patch "hop-bigloo-4.0b.patch"))))) | 239 | (patches (list (search-patch "hop-bigloo-4.0b.patch") |
| 240 | (search-patch "hop-linker-flags.patch"))))) | ||
| 239 | (build-system gnu-build-system) | 241 | (build-system gnu-build-system) |
| 240 | (arguments | 242 | (arguments |
| 241 | '(#:phases | 243 | `(#:phases |
| 242 | (alist-replace | 244 | (alist-replace |
| 243 | 'configure | 245 | 'configure |
| 244 | (lambda* (#:key inputs outputs #:allow-other-keys) | 246 | (lambda* (#:key outputs #:allow-other-keys) |
| 245 | (let ((out (assoc-ref outputs "out"))) | 247 | (let ((out (assoc-ref outputs "out"))) |
| 246 | (zero? | 248 | (zero? |
| 247 | (system* "./configure" | 249 | (system* "./configure" |
| 248 | (string-append "--prefix=" out))))) | 250 | (string-append "--prefix=" out) |
| 249 | (alist-cons-after | 251 | (string-append "--blflags=" |
| 250 | 'strip 'patch-rpath | 252 | ;; user flags completely override useful |
| 251 | (lambda* (#:key outputs #:allow-other-keys) | 253 | ;; default flags, so repeat them here. |
| 252 | ;; Patch the RPATH of every installed library to point to $out/lib | 254 | "-copt \\$(CPICFLAGS) -L\\$(BUILDLIBDIR) " |
| 253 | ;; instead of $TMPDIR. Note that "patchelf --set-rpath" produces | 255 | "-ldopt -Wl,-rpath," out "/lib"))))) |
| 254 | ;; invalid binaries when used before stripping. | 256 | %standard-phases) |
| 255 | (let ((out (assoc-ref outputs "out")) | 257 | #:tests? #f)) ; no test suite |
| 256 | (tmpdir (getcwd))) | ||
| 257 | (every (lambda (lib) | ||
| 258 | (let* ((in (open-pipe* OPEN_READ "patchelf" | ||
| 259 | "--print-rpath" lib)) | ||
| 260 | (rpath (read-line in))) | ||
| 261 | (and (zero? (close-pipe in)) | ||
| 262 | (let ((rpath* (regexp-substitute/global | ||
| 263 | #f (regexp-quote tmpdir) rpath | ||
| 264 | 'pre out 'post))) | ||
| 265 | (or (equal? rpath rpath*) | ||
| 266 | (begin | ||
| 267 | (format #t "~a: changing RPATH from `~a' to `~a'~%" | ||
| 268 | lib rpath rpath*) | ||
| 269 | (zero? | ||
| 270 | (system* "patchelf" "--set-rpath" | ||
| 271 | rpath* lib)))))))) | ||
| 272 | (append (find-files (string-append out "/bin") | ||
| 273 | ".*") | ||
| 274 | (find-files (string-append out "/lib") | ||
| 275 | "\\.so$"))))) | ||
| 276 | %standard-phases)) | ||
| 277 | #:tests? #f ; no test suite | ||
| 278 | #:modules ((guix build gnu-build-system) | ||
| 279 | (guix build utils) | ||
| 280 | (ice-9 popen) | ||
| 281 | (ice-9 regex) | ||
| 282 | (ice-9 rdelim) | ||
| 283 | (srfi srfi-1)))) | ||
| 284 | (inputs `(("bigloo" ,bigloo) | 258 | (inputs `(("bigloo" ,bigloo) |
| 285 | ("which" ,which) | 259 | ("which" ,which))) |
| 286 | ("patchelf" ,patchelf))) | ||
| 287 | (home-page "http://hop.inria.fr/") | 260 | (home-page "http://hop.inria.fr/") |
| 288 | (synopsis "Multi-tier programming language for the Web 2.0") | 261 | (synopsis "Multi-tier programming language for the Web 2.0") |
| 289 | (description | 262 | (description |
| @@ -481,14 +454,15 @@ mixed.") | |||
| 481 | (define-public chibi-scheme | 454 | (define-public chibi-scheme |
| 482 | (package | 455 | (package |
| 483 | (name "chibi-scheme") | 456 | (name "chibi-scheme") |
| 484 | (version "0.7.2") | 457 | (version "0.7.3") |
| 485 | (source | 458 | (source |
| 486 | (origin | 459 | (origin |
| 487 | (method url-fetch) | 460 | (method url-fetch) |
| 488 | (uri (string-append | 461 | (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/" |
| 489 | "http://abrek.synthcode.com/chibi-scheme-" version ".tgz")) | 462 | version ".tar.gz")) |
| 490 | (sha256 | 463 | (sha256 |
| 491 | (base32 "0h6k2gdb4xk2pzhdipffcg2w3kfr4zh1va556k1hvng2did6prds")))) | 464 | (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742")) |
| 465 | (file-name (string-append "chibi-scheme-" version ".tar.gz")))) | ||
| 492 | (build-system gnu-build-system) | 466 | (build-system gnu-build-system) |
| 493 | (arguments | 467 | (arguments |
| 494 | `(#:phases | 468 | `(#:phases |
diff --git a/gnu/packages/search.scm b/gnu/packages/search.scm index 5886c6a9ea7..e7f8aae881c 100644 --- a/gnu/packages/search.scm +++ b/gnu/packages/search.scm | |||
| @@ -124,4 +124,29 @@ files and directories.") | |||
| 124 | command line tool for interacting with libtocc.") | 124 | command line tool for interacting with libtocc.") |
| 125 | (license gpl3+))) | 125 | (license gpl3+))) |
| 126 | 126 | ||
| 127 | (define-public bool | ||
| 128 | (package | ||
| 129 | (name "bool") | ||
| 130 | (version "0.2.2") | ||
| 131 | (source | ||
| 132 | (origin | ||
| 133 | (method url-fetch) | ||
| 134 | (uri (string-append "mirror://gnu/bool/bool-" | ||
| 135 | version ".tar.xz")) | ||
| 136 | (sha256 | ||
| 137 | (base32 | ||
| 138 | "1frdmgrmb509fxbdpsxxw3lvvwv7xm1pavqrqgm4jg698iix6xfw")))) | ||
| 139 | (build-system gnu-build-system) | ||
| 140 | (home-page "https://www.gnu.org/software/bool") | ||
| 141 | (synopsis "Finding text and HTML files that match boolean expressions") | ||
| 142 | (description | ||
| 143 | "GNU Bool is a utility to perform text searches on files using Boolean | ||
| 144 | expressions. For example, a search for \"hello AND world\" would return a | ||
| 145 | file containing the phrase \"Hello, world!\". It supports both AND and OR | ||
| 146 | statements, as well as the NEAR statement to search for the occurrence of | ||
| 147 | words in close proximity to each other. It handles context gracefully, | ||
| 148 | accounting for new lines and paragraph changes. It also has robust support | ||
| 149 | for parsing HTML files.") | ||
| 150 | (license gpl3+))) | ||
| 151 | |||
| 127 | ;;; search.scm ends here | 152 | ;;; search.scm ends here |
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 722e0dfa491..9408705d5eb 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm | |||
| @@ -50,7 +50,8 @@ | |||
| 50 | version ".tar.gz")) | 50 | version ".tar.gz")) |
| 51 | (sha256 | 51 | (sha256 |
| 52 | (base32 | 52 | (base32 |
| 53 | "0dagyqgvi8i3nw158qi2zpwm04s4ffzvnmk5niaksvxs30zrbbpm")))) | 53 | "0dagyqgvi8i3nw158qi2zpwm04s4ffzvnmk5niaksvxs30zrbbpm")) |
| 54 | (patches (list (search-patch "r-fix-15899.patch"))))) | ||
| 54 | (build-system gnu-build-system) | 55 | (build-system gnu-build-system) |
| 55 | (arguments | 56 | (arguments |
| 56 | `(#:make-flags | 57 | `(#:make-flags |
diff --git a/gnu/packages/task-management.scm b/gnu/packages/task-management.scm new file mode 100644 index 00000000000..e77aecb957d --- /dev/null +++ b/gnu/packages/task-management.scm | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 Tomáš Čech <sleep_walker@suse.cz> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu packages task-management) | ||
| 20 | #:use-module ((guix licenses) #:prefix license:) | ||
| 21 | #:use-module (guix packages) | ||
| 22 | #:use-module (gnu packages gnutls) | ||
| 23 | #:use-module (gnu packages linux) | ||
| 24 | #:use-module (gnu packages lua) | ||
| 25 | #:use-module (guix download) | ||
| 26 | #:use-module (guix build-system cmake)) | ||
| 27 | |||
| 28 | (define-public taskwarrior | ||
| 29 | (package | ||
| 30 | (name "taskwarrior") | ||
| 31 | (version "2.4.3") | ||
| 32 | (source | ||
| 33 | (origin | ||
| 34 | (method url-fetch) | ||
| 35 | (uri (string-append | ||
| 36 | "http://taskwarrior.org/download/task-" version ".tar.gz")) | ||
| 37 | (sha256 (base32 | ||
| 38 | "1lkbw2fhshynbl7hppar1viapyrs712s14xhd8p3l8gyhvxbh0mv")))) | ||
| 39 | (build-system cmake-build-system) | ||
| 40 | (inputs | ||
| 41 | `(("gnutls" ,gnutls) | ||
| 42 | ("lua" ,lua) | ||
| 43 | ("util-linux" ,util-linux))) | ||
| 44 | (arguments | ||
| 45 | `(#:tests? #f ; No tests implemented. | ||
| 46 | #:phases | ||
| 47 | (modify-phases %standard-phases | ||
| 48 | (add-before | ||
| 49 | 'patch-source-shebangs 'remove-broken-symlinks | ||
| 50 | (lambda _ | ||
| 51 | ;; These files are broken symlinks - delete them. | ||
| 52 | (delete-file "src/cal") | ||
| 53 | (delete-file "src/calendar") | ||
| 54 | (delete-file "src/tw")))))) | ||
| 55 | (home-page "http://taskwarrior.org") | ||
| 56 | (synopsis "Command line task manager") | ||
| 57 | (description | ||
| 58 | "Taskwarrior is a command-line task manager following the Getting Things | ||
| 59 | Done time management method. It supports network synchronization, filtering | ||
| 60 | and querying data, exposing task data in multiple formats to other tools.") | ||
| 61 | (license license:expat))) | ||
diff --git a/gnu/packages/tcsh.scm b/gnu/packages/tcsh.scm index 814f2a63212..0bd1b92b8f0 100644 --- a/gnu/packages/tcsh.scm +++ b/gnu/packages/tcsh.scm | |||
| @@ -31,13 +31,17 @@ | |||
| 31 | (name "tcsh") | 31 | (name "tcsh") |
| 32 | (version "6.18.01") | 32 | (version "6.18.01") |
| 33 | (source (origin | 33 | (source (origin |
| 34 | (method url-fetch) | 34 | (method url-fetch) |
| 35 | (uri (string-append "ftp://ftp.astron.com/pub/tcsh/tcsh-" | 35 | ;; Old tarballs are moved to old/. |
| 36 | version ".tar.gz")) | 36 | (uri (list (string-append "ftp://ftp.astron.com/pub/tcsh/" |
| 37 | (sha256 | 37 | "tcsh-" version ".tar.gz") |
| 38 | (base32 "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q")) | 38 | (string-append "ftp://ftp.astron.com/pub/tcsh/" |
| 39 | (patches (list (search-patch "tcsh-fix-autotest.patch"))) | 39 | "old/tcsh-" version ".tar.gz"))) |
| 40 | (patch-flags '("-p0")))) | 40 | (sha256 |
| 41 | (base32 | ||
| 42 | "1a4z9kwgx1iqqzvv64si34m60gj34p7lp6rrcrb59s7ka5wa476q")) | ||
| 43 | (patches (list (search-patch "tcsh-fix-autotest.patch"))) | ||
| 44 | (patch-flags '("-p0")))) | ||
| 41 | (build-system gnu-build-system) | 45 | (build-system gnu-build-system) |
| 42 | (inputs | 46 | (inputs |
| 43 | `(("autoconf" ,autoconf) | 47 | `(("autoconf" ,autoconf) |
diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 08b1b64c573..325386d2340 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> | 2 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
| 3 | ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org> | ||
| 3 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | 4 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
| 4 | ;;; | 5 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 6 | ;;; This file is part of GNU Guix. |
| @@ -23,8 +24,11 @@ | |||
| 23 | #:use-module (guix download) | 24 | #:use-module (guix download) |
| 24 | #:use-module (guix git-download) | 25 | #:use-module (guix git-download) |
| 25 | #:use-module (guix build-system gnu) | 26 | #:use-module (guix build-system gnu) |
| 27 | #:use-module (guix build-system trivial) | ||
| 26 | #:use-module (gnu packages autotools) | 28 | #:use-module (gnu packages autotools) |
| 27 | #:use-module (gnu packages python)) | 29 | #:use-module (gnu packages perl) |
| 30 | #:use-module (gnu packages python) | ||
| 31 | #:use-module (gnu packages zip)) | ||
| 28 | 32 | ||
| 29 | (define-public recode | 33 | (define-public recode |
| 30 | (package | 34 | (package |
| @@ -155,3 +159,47 @@ encoding, supporting Unicode version 7.0.") | |||
| 155 | "libgtextutils is a text utilities library used by the fastx toolkit from | 159 | "libgtextutils is a text utilities library used by the fastx toolkit from |
| 156 | the Hannon Lab.") | 160 | the Hannon Lab.") |
| 157 | (license license:agpl3+))) | 161 | (license license:agpl3+))) |
| 162 | |||
| 163 | (define-public markdown | ||
| 164 | (package | ||
| 165 | (name "markdown") | ||
| 166 | (version "1.0.1") | ||
| 167 | (source | ||
| 168 | (origin | ||
| 169 | (method url-fetch) | ||
| 170 | (uri (string-append | ||
| 171 | "http://daringfireball.net/projects/downloads/" | ||
| 172 | (string-capitalize name) "_" version ".zip")) | ||
| 173 | (sha256 | ||
| 174 | (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835")))) | ||
| 175 | (build-system trivial-build-system) | ||
| 176 | (arguments | ||
| 177 | '(#:modules ((guix build utils)) | ||
| 178 | #:builder | ||
| 179 | (begin | ||
| 180 | (use-modules (guix build utils)) | ||
| 181 | (let ((source (assoc-ref %build-inputs "source")) | ||
| 182 | (out (assoc-ref %outputs "out")) | ||
| 183 | (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin")) | ||
| 184 | (unzip (string-append (assoc-ref %build-inputs "unzip") | ||
| 185 | "/bin/unzip"))) | ||
| 186 | (mkdir-p out) | ||
| 187 | (with-directory-excursion out | ||
| 188 | (system* unzip source) | ||
| 189 | (mkdir "bin") | ||
| 190 | (mkdir-p "share/doc") | ||
| 191 | (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown") | ||
| 192 | (rename-file "Markdown_1.0.1/Markdown Readme.text" | ||
| 193 | "share/doc/README") | ||
| 194 | (patch-shebang "bin/markdown" (list perlbd)) | ||
| 195 | (delete-file-recursively "Markdown_1.0.1")))))) | ||
| 196 | (native-inputs `(("unzip" ,unzip))) | ||
| 197 | (inputs `(("perl" ,perl))) | ||
| 198 | (home-page "http://daringfireball.net/projects/markdown") | ||
| 199 | (synopsis "Text-to-HTML conversion tool") | ||
| 200 | (description | ||
| 201 | "Markdown is a text-to-HTML conversion tool for web writers. It allows | ||
| 202 | you to write using an easy-to-read, easy-to-write plain text format, then | ||
| 203 | convert it to structurally valid XHTML (or HTML).") | ||
| 204 | (license (license:non-copyleft "file://License.text" | ||
| 205 | "See License.text in the distribution.")))) | ||
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm index 0f19d9f2a47..d5e30e97f56 100644 --- a/gnu/packages/tor.scm +++ b/gnu/packages/tor.scm | |||
| @@ -26,21 +26,24 @@ | |||
| 26 | #:use-module (gnu packages compression) | 26 | #:use-module (gnu packages compression) |
| 27 | #:use-module (gnu packages openssl) | 27 | #:use-module (gnu packages openssl) |
| 28 | #:use-module (gnu packages pcre) | 28 | #:use-module (gnu packages pcre) |
| 29 | #:use-module (gnu packages python) | ||
| 29 | #:use-module (gnu packages autotools) | 30 | #:use-module (gnu packages autotools) |
| 30 | #:use-module (gnu packages w3m)) | 31 | #:use-module (gnu packages w3m)) |
| 31 | 32 | ||
| 32 | (define-public tor | 33 | (define-public tor |
| 33 | (package | 34 | (package |
| 34 | (name "tor") | 35 | (name "tor") |
| 35 | (version "0.2.5.12") | 36 | (version "0.2.6.8") |
| 36 | (source (origin | 37 | (source (origin |
| 37 | (method url-fetch) | 38 | (method url-fetch) |
| 38 | (uri (string-append "https://www.torproject.org/dist/tor-" | 39 | (uri (string-append "https://www.torproject.org/dist/tor-" |
| 39 | version ".tar.gz")) | 40 | version ".tar.gz")) |
| 40 | (sha256 | 41 | (sha256 |
| 41 | (base32 | 42 | (base32 |
| 42 | "0j9byw3i2b7ji88vsqwmsxxg2nlxwkk45k5qbc1y7hdlzvzxl3sm")))) | 43 | "0xlsc2pa7i8hm8dyilln6p4rb0pig62b9c31yp1m0hj5jqw3d2xq")))) |
| 43 | (build-system gnu-build-system) | 44 | (build-system gnu-build-system) |
| 45 | (native-inputs | ||
| 46 | `(("python" ,python-2))) ; for tests | ||
| 44 | (inputs | 47 | (inputs |
| 45 | `(("zlib" ,zlib) | 48 | `(("zlib" ,zlib) |
| 46 | ("openssl" ,openssl) | 49 | ("openssl" ,openssl) |
diff --git a/gnu/packages/tv.scm b/gnu/packages/tv.scm new file mode 100644 index 00000000000..0a229e149a7 --- /dev/null +++ b/gnu/packages/tv.scm | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 Alex Kost <alezost@gmail.com> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu packages tv) | ||
| 20 | #:use-module (guix packages) | ||
| 21 | #:use-module (guix download) | ||
| 22 | #:use-module (guix build-system gnu) | ||
| 23 | #:use-module ((guix licenses) #:prefix license:) | ||
| 24 | #:use-module (gnu packages) | ||
| 25 | #:use-module (gnu packages xorg) | ||
| 26 | #:use-module (gnu packages image) | ||
| 27 | #:use-module (gnu packages compression) | ||
| 28 | #:use-module (gnu packages xml) | ||
| 29 | #:use-module (gnu packages fontutils)) | ||
| 30 | |||
| 31 | (define-public tvtime | ||
| 32 | (package | ||
| 33 | (name "tvtime") | ||
| 34 | (version "1.0.2") | ||
| 35 | (source (origin | ||
| 36 | (method url-fetch) | ||
| 37 | (uri (string-append "mirror://sourceforge/tvtime/tvtime-" | ||
| 38 | version ".tar.gz")) | ||
| 39 | (sha256 | ||
| 40 | (base32 | ||
| 41 | "08q5gzbyz0lxb730rz6d6amkzimlc7nanv6n50j2bpw4n2xa9wmf")) | ||
| 42 | (patches (list (search-patch "tvtime-videodev2.patch") | ||
| 43 | (search-patch "tvtime-pngoutput.patch") | ||
| 44 | (search-patch "tvtime-xmltv.patch") | ||
| 45 | (search-patch "tvtime-gcc41.patch"))))) | ||
| 46 | (build-system gnu-build-system) | ||
| 47 | (inputs | ||
| 48 | `(("libx11" ,libx11) | ||
| 49 | ("libxext" ,libxext) | ||
| 50 | ("libxt" ,libxt) | ||
| 51 | ("libxtst" ,libxtst) | ||
| 52 | ("libxinerama" ,libxinerama) | ||
| 53 | ("libxv" ,libxv) | ||
| 54 | ("libxxf86vm" ,libxxf86vm) | ||
| 55 | ("libpng" ,libpng) | ||
| 56 | ("libxml2" ,libxml2) | ||
| 57 | ("freetype" ,freetype) | ||
| 58 | ("zlib" ,zlib))) | ||
| 59 | (home-page "http://tvtime.sourceforge.net") | ||
| 60 | (synopsis "Television viewer") | ||
| 61 | (description | ||
| 62 | "Tvtime processes the input from your video capture card and | ||
| 63 | displays it on a monitor. It focuses on a high visual quality.") | ||
| 64 | (license license:gpl2+))) | ||
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 3cbd12f6356..0d153fa92d8 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> | 3 | ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> |
| 4 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 4 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 5 | ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> | 5 | ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> |
| 6 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> | 6 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
| 7 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> | 7 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> |
| 8 | ;;; | 8 | ;;; |
| 9 | ;;; This file is part of GNU Guix. | 9 | ;;; This file is part of GNU Guix. |
| @@ -49,6 +49,7 @@ | |||
| 49 | #:use-module (gnu packages ncurses) | 49 | #:use-module (gnu packages ncurses) |
| 50 | #:use-module (gnu packages openssl) | 50 | #:use-module (gnu packages openssl) |
| 51 | #:use-module (gnu packages ssh) | 51 | #:use-module (gnu packages ssh) |
| 52 | #:use-module (gnu packages web) | ||
| 52 | #:use-module (gnu packages perl) | 53 | #:use-module (gnu packages perl) |
| 53 | #:use-module (gnu packages pkg-config) | 54 | #:use-module (gnu packages pkg-config) |
| 54 | #:use-module (gnu packages python) | 55 | #:use-module (gnu packages python) |
| @@ -536,29 +537,20 @@ WebDAV metadata support, wrappers for PROPFIND and PROPPATCH to simplify | |||
| 536 | property manipulation.") | 537 | property manipulation.") |
| 537 | (license gpl2+))) ; for documentation and tests; source under lgpl2.0+ | 538 | (license gpl2+))) ; for documentation and tests; source under lgpl2.0+ |
| 538 | 539 | ||
| 539 | (define-public neon-0.29.6 | ||
| 540 | (package (inherit neon) | ||
| 541 | (name "neon") | ||
| 542 | (version "0.29.6") | ||
| 543 | (source (origin | ||
| 544 | (method url-fetch) | ||
| 545 | (uri (string-append "http://www.webdav.org/neon/neon-" | ||
| 546 | version ".tar.gz")) | ||
| 547 | (sha256 | ||
| 548 | (base32 | ||
| 549 | "0hzbjqdx1z8zw0vmbknf159wjsxbcq8ii0wgwkqhxj3dimr0nr4w")))))) | ||
| 550 | |||
| 551 | (define-public subversion | 540 | (define-public subversion |
| 552 | (package | 541 | (package |
| 553 | (name "subversion") | 542 | (name "subversion") |
| 554 | (version "1.7.18") | 543 | (version "1.8.13") |
| 555 | (source (origin | 544 | (source (origin |
| 556 | (method url-fetch) | 545 | (method url-fetch) |
| 557 | (uri (string-append "http://archive.apache.org/dist/subversion/" | 546 | (uri (string-append "http://archive.apache.org/dist/subversion/" |
| 558 | "subversion-" version ".tar.bz2")) | 547 | "subversion-" version ".tar.bz2")) |
| 559 | (sha256 | 548 | (sha256 |
| 560 | (base32 | 549 | (base32 |
| 561 | "06nrqnn3qq1hhskkcdbm0ilk2xv6ay2gyf2c7qvxp6xncb782wzn")))) | 550 | "0ybmc0yq83jhblp42wdqvn2cryra3sypx8mkxn5b8lq7hilcr68h")) |
| 551 | (patches | ||
| 552 | (list (search-patch "subversion-sqlite-3.8.9-fix.patch"))) | ||
| 553 | (patch-flags '("-p0")))) | ||
| 562 | (build-system gnu-build-system) | 554 | (build-system gnu-build-system) |
| 563 | (arguments | 555 | (arguments |
| 564 | '(#:phases (alist-cons-after | 556 | '(#:phases (alist-cons-after |
| @@ -574,7 +566,7 @@ property manipulation.") | |||
| 574 | (substitute* "libtool" | 566 | (substitute* "libtool" |
| 575 | (("\\\\`ls") (string-append "\\`" coreutils "/bin/ls"))))) | 567 | (("\\\\`ls") (string-append "\\`" coreutils "/bin/ls"))))) |
| 576 | (alist-cons-after | 568 | (alist-cons-after |
| 577 | 'install 'instal-perl-bindings | 569 | 'install 'install-perl-bindings |
| 578 | (lambda* (#:key outputs #:allow-other-keys) | 570 | (lambda* (#:key outputs #:allow-other-keys) |
| 579 | ;; Follow the instructions from | 571 | ;; Follow the instructions from |
| 580 | ;; 'subversion/bindings/swig/INSTALL'. | 572 | ;; 'subversion/bindings/swig/INSTALL'. |
| @@ -603,7 +595,7 @@ property manipulation.") | |||
| 603 | (inputs | 595 | (inputs |
| 604 | `(("apr" ,apr) | 596 | `(("apr" ,apr) |
| 605 | ("apr-util" ,apr-util) | 597 | ("apr-util" ,apr-util) |
| 606 | ("neon" ,neon-0.29.6) | 598 | ("serf" ,serf) |
| 607 | ("perl" ,perl) | 599 | ("perl" ,perl) |
| 608 | ("python" ,python-2) ; incompatible with Python 3 (print syntax) | 600 | ("python" ,python-2) ; incompatible with Python 3 (print syntax) |
| 609 | ("sqlite" ,sqlite) | 601 | ("sqlite" ,sqlite) |
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index c890d45d195..3955c383d7a 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm | |||
| @@ -857,7 +857,7 @@ projects while introducing many more.") | |||
| 857 | (define-public youtube-dl | 857 | (define-public youtube-dl |
| 858 | (package | 858 | (package |
| 859 | (name "youtube-dl") | 859 | (name "youtube-dl") |
| 860 | (version "2015.01.23.4") | 860 | (version "2015.06.04.1") |
| 861 | (source (origin | 861 | (source (origin |
| 862 | (method url-fetch) | 862 | (method url-fetch) |
| 863 | (uri (string-append "http://youtube-dl.org/downloads/" | 863 | (uri (string-append "http://youtube-dl.org/downloads/" |
| @@ -865,7 +865,7 @@ projects while introducing many more.") | |||
| 865 | version ".tar.gz")) | 865 | version ".tar.gz")) |
| 866 | (sha256 | 866 | (sha256 |
| 867 | (base32 | 867 | (base32 |
| 868 | "0pvvab9dk1righ3fa79000iz8fzdlcxakscx5sd31730c37j3kj2")))) | 868 | "0rk5c2m19x119bly38yjbizkr99ayn265lm15rm2x5ipjvdixyyg")))) |
| 869 | (build-system python-build-system) | 869 | (build-system python-build-system) |
| 870 | (inputs `(("setuptools" ,python-setuptools))) | 870 | (inputs `(("setuptools" ,python-setuptools))) |
| 871 | (home-page "http://youtube-dl.org") | 871 | (home-page "http://youtube-dl.org") |
| @@ -1102,6 +1102,8 @@ for use with HTML5 video.") | |||
| 1102 | "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" | 1102 | "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" |
| 1103 | (string-append "-DCMAKE_INSTALL_PREFIX=" out) | 1103 | (string-append "-DCMAKE_INSTALL_PREFIX=" out) |
| 1104 | (string-append "-DCMAKE_INSTALL_RPATH=" lib) | 1104 | (string-append "-DCMAKE_INSTALL_RPATH=" lib) |
| 1105 | (string-append "-DCMAKE_SHARED_LINKER_FLAGS=" | ||
| 1106 | "\"-Wl,-rpath=" lib "\"") | ||
| 1105 | (string-append "-DAVIDEMUX_SOURCE_DIR=" top) | 1107 | (string-append "-DAVIDEMUX_SOURCE_DIR=" top) |
| 1106 | (string-append "-DSDL_INCLUDE_DIR=" | 1108 | (string-append "-DSDL_INCLUDE_DIR=" |
| 1107 | sdl "/include/SDL") | 1109 | sdl "/include/SDL") |
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index 5883f995058..62036d9ef7d 100644 --- a/gnu/packages/vpn.scm +++ b/gnu/packages/vpn.scm | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #:use-module (gnu packages gettext) | 28 | #:use-module (gnu packages gettext) |
| 29 | #:use-module (gnu packages gnupg) | 29 | #:use-module (gnu packages gnupg) |
| 30 | #:use-module (gnu packages gnutls) | 30 | #:use-module (gnu packages gnutls) |
| 31 | #:use-module (gnu packages linux) | ||
| 31 | #:use-module (gnu packages openssl) | 32 | #:use-module (gnu packages openssl) |
| 32 | #:use-module (gnu packages perl) | 33 | #:use-module (gnu packages perl) |
| 33 | #:use-module (gnu packages pkg-config) | 34 | #:use-module (gnu packages pkg-config) |
| @@ -125,3 +126,33 @@ supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500, | |||
| 125 | and probably others.") | 126 | and probably others.") |
| 126 | (license license:lgpl2.1) | 127 | (license license:lgpl2.1) |
| 127 | (home-page "http://www.infradead.org/openconnect/"))) | 128 | (home-page "http://www.infradead.org/openconnect/"))) |
| 129 | |||
| 130 | (define-public openvpn | ||
| 131 | (package | ||
| 132 | (name "openvpn") | ||
| 133 | (version "2.3.6") | ||
| 134 | (source (origin | ||
| 135 | (method url-fetch) | ||
| 136 | (uri (string-append | ||
| 137 | "https://swupdate.openvpn.org/community/releases/openvpn-" | ||
| 138 | version ".tar.xz")) | ||
| 139 | (sha256 | ||
| 140 | (base32 | ||
| 141 | "1v8h2nshxnvn2zyr08vzkfby1kc7ma6bi0s6hix389cj9krjxbmd")))) | ||
| 142 | (build-system gnu-build-system) | ||
| 143 | (arguments | ||
| 144 | '(#:configure-flags '("--enable-iproute2=yes"))) | ||
| 145 | (native-inputs | ||
| 146 | `(("iproute2" ,iproute))) | ||
| 147 | (inputs | ||
| 148 | `(("lzo" ,lzo) | ||
| 149 | ("openssl" ,openssl) | ||
| 150 | ("linux-pam" ,linux-pam))) | ||
| 151 | (home-page "https://openvpn.net/") | ||
| 152 | (synopsis "Virtual private network daemon") | ||
| 153 | (description "OpenVPN implements virtual private network (VPN) techniques | ||
| 154 | for creating secure point-to-point or site-to-site connections in routed or | ||
| 155 | bridged configurations and remote access facilities. It uses a custom | ||
| 156 | security protocol that utilizes SSL/TLS for key exchange. It is capable of | ||
| 157 | traversing network address translators (NATs) and firewalls. ") | ||
| 158 | (license license:gpl2))) | ||
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index fb3ff2d1492..e77bad76d67 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | #:use-module (gnu packages icu4c) | 46 | #:use-module (gnu packages icu4c) |
| 47 | #:use-module (gnu packages lua) | 47 | #:use-module (gnu packages lua) |
| 48 | #:use-module (gnu packages base) | 48 | #:use-module (gnu packages base) |
| 49 | #:use-module (gnu packages python) | ||
| 49 | #:use-module (gnu packages pcre) | 50 | #:use-module (gnu packages pcre) |
| 50 | #:use-module (gnu packages pkg-config) | 51 | #:use-module (gnu packages pkg-config) |
| 51 | #:use-module (gnu packages xml) | 52 | #:use-module (gnu packages xml) |
| @@ -548,6 +549,75 @@ URLs and extracting their actual media files.") | |||
| 548 | from streaming URLs. It is a command-line wrapper for the libquvi library.") | 549 | from streaming URLs. It is a command-line wrapper for the libquvi library.") |
| 549 | (license l:lgpl2.1+))) | 550 | (license l:lgpl2.1+))) |
| 550 | 551 | ||
| 552 | (define-public serf | ||
| 553 | (package | ||
| 554 | (name "serf") | ||
| 555 | (version "1.3.8") | ||
| 556 | (source | ||
| 557 | (origin | ||
| 558 | (method url-fetch) | ||
| 559 | (uri (string-append "http://serf.googlecode.com/svn/src_releases/serf-" | ||
| 560 | version ".tar.bz2")) | ||
| 561 | (sha256 | ||
| 562 | (base32 "14155g48gamcv5s0828bzij6vr14nqmbndwq8j8f9g6vcph0nl70")) | ||
| 563 | (patches (map search-patch '("serf-comment-style-fix.patch" | ||
| 564 | "serf-deflate-buckets-test-fix.patch"))) | ||
| 565 | (patch-flags '("-p0")))) | ||
| 566 | (build-system gnu-build-system) | ||
| 567 | (native-inputs | ||
| 568 | `(("scons" ,scons) | ||
| 569 | ("python" ,python-2))) | ||
| 570 | (propagated-inputs | ||
| 571 | `(("apr" ,apr) | ||
| 572 | ("apr-util" ,apr-util) | ||
| 573 | ("openssl" ,openssl))) | ||
| 574 | (inputs | ||
| 575 | `(;; TODO: Fix build with gss. | ||
| 576 | ;;("gss" ,gss) | ||
| 577 | ("zlib" ,zlib))) | ||
| 578 | (arguments | ||
| 579 | `(#:phases | ||
| 580 | ;; TODO: Add scons-build-system and use it here. | ||
| 581 | (modify-phases %standard-phases | ||
| 582 | (delete 'configure) | ||
| 583 | (add-after 'unpack 'scons-propagate-environment | ||
| 584 | (lambda _ | ||
| 585 | ;; By design, SCons does not, by default, propagate | ||
| 586 | ;; environment variables to subprocesses. See: | ||
| 587 | ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969> | ||
| 588 | ;; Here, we modify the SConstruct file to arrange for | ||
| 589 | ;; environment variables to be propagated. | ||
| 590 | (substitute* "SConstruct" | ||
| 591 | (("^env = Environment\\(") | ||
| 592 | "env = Environment(ENV=os.environ, ")))) | ||
| 593 | (replace 'build | ||
| 594 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 595 | (let ((out (assoc-ref outputs "out")) | ||
| 596 | (apr (assoc-ref inputs "apr")) | ||
| 597 | (apr-util (assoc-ref inputs "apr-util")) | ||
| 598 | (openssl (assoc-ref inputs "openssl")) | ||
| 599 | ;;(gss (assoc-ref inputs "gss")) | ||
| 600 | (zlib (assoc-ref inputs "zlib"))) | ||
| 601 | (zero? (system* "scons" | ||
| 602 | (string-append "APR=" apr) | ||
| 603 | (string-append "APU=" apr-util) | ||
| 604 | (string-append "OPENSSL=" openssl) | ||
| 605 | ;;(string-append "GSSAPI=" gss) | ||
| 606 | (string-append "ZLIB=" zlib) | ||
| 607 | (string-append "PREFIX=" out)))))) | ||
| 608 | (replace 'check (lambda _ (zero? (system* "scons" "check")))) | ||
| 609 | (replace 'install (lambda _ (zero? (system* "scons" "install"))))))) | ||
| 610 | (home-page "https://code.google.com/p/serf/") | ||
| 611 | (synopsis "High-performance asynchronous HTTP client library") | ||
| 612 | (description | ||
| 613 | "serf is a C-based HTTP client library built upon the Apache Portable | ||
| 614 | Runtime (APR) library. It multiplexes connections, running the read/write | ||
| 615 | communication asynchronously. Memory copies and transformations are kept to a | ||
| 616 | minimum to provide high performance operation.") | ||
| 617 | ;; Most of the code is covered by the Apache License, Version 2.0, but the | ||
| 618 | ;; bundled CuTest framework uses a different non-copyleft license. | ||
| 619 | (license (list l:asl2.0 (l:non-copyleft "file://test/CuTest-README.txt"))))) | ||
| 620 | |||
| 551 | 621 | ||
| 552 | (define-public perl-apache-logformat-compiler | 622 | (define-public perl-apache-logformat-compiler |
| 553 | (package | 623 | (package |
diff --git a/gnu/packages/webkit.scm b/gnu/packages/webkit.scm index e6de8ab0df8..0f3a44b063e 100644 --- a/gnu/packages/webkit.scm +++ b/gnu/packages/webkit.scm | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> | 2 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
| 3 | ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com> | ||
| 4 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | ||
| 3 | ;;; | 5 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 6 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 7 | ;;; |
| @@ -21,9 +23,13 @@ | |||
| 21 | #:use-module (guix packages) | 23 | #:use-module (guix packages) |
| 22 | #:use-module (guix download) | 24 | #:use-module (guix download) |
| 23 | #:use-module (guix build-system cmake) | 25 | #:use-module (guix build-system cmake) |
| 26 | #:use-module (guix build-system gnu) | ||
| 27 | #:use-module (gnu packages) | ||
| 28 | #:use-module (gnu packages base) | ||
| 24 | #:use-module (gnu packages bison) | 29 | #:use-module (gnu packages bison) |
| 25 | #:use-module (gnu packages databases) | 30 | #:use-module (gnu packages databases) |
| 26 | #:use-module (gnu packages enchant) | 31 | #:use-module (gnu packages enchant) |
| 32 | #:use-module (gnu packages flex) | ||
| 27 | #:use-module (gnu packages gettext) | 33 | #:use-module (gnu packages gettext) |
| 28 | #:use-module (gnu packages gl) | 34 | #:use-module (gnu packages gl) |
| 29 | #:use-module (gnu packages glib) | 35 | #:use-module (gnu packages glib) |
| @@ -45,19 +51,23 @@ | |||
| 45 | (define-public webkitgtk | 51 | (define-public webkitgtk |
| 46 | (package | 52 | (package |
| 47 | (name "webkitgtk") | 53 | (name "webkitgtk") |
| 48 | (version "2.8.1") | 54 | (version "2.8.3") |
| 49 | (source (origin | 55 | (source (origin |
| 50 | (method url-fetch) | 56 | (method url-fetch) |
| 51 | (uri (string-append "http://www.webkitgtk.org/releases/" | 57 | (uri (string-append "http://www.webkitgtk.org/releases/" |
| 52 | name "-" version ".tar.xz")) | 58 | name "-" version ".tar.xz")) |
| 53 | (sha256 | 59 | (sha256 |
| 54 | (base32 | 60 | (base32 |
| 55 | "1zv030ryfwwp57yzlpr9bgpxcmc64izsxk2vsyd4kjhns9cl88bx")))) | 61 | "05igg61lflgwy83cmxgyzmvf2bkhplmp8710ssrlpmbfcz461pmk")))) |
| 56 | (build-system cmake-build-system) | 62 | (build-system cmake-build-system) |
| 57 | (arguments | 63 | (arguments |
| 58 | '(#:tests? #f ; no tests | 64 | '(#:tests? #f ; no tests |
| 59 | #:build-type "Release" ; turn off debugging symbols to save space | 65 | #:build-type "Release" ; turn off debugging symbols to save space |
| 60 | #:configure-flags '("-DPORT=GTK"))) | 66 | #:configure-flags (list |
| 67 | "-DPORT=GTK" | ||
| 68 | (string-append ; uses lib64 by default | ||
| 69 | "-DLIB_INSTALL_DIR=" | ||
| 70 | (assoc-ref %outputs "out") "/lib")))) | ||
| 61 | (native-inputs | 71 | (native-inputs |
| 62 | `(("bison" ,bison) | 72 | `(("bison" ,bison) |
| 63 | ("gettext" ,gnu-gettext) | 73 | ("gettext" ,gnu-gettext) |
| @@ -103,3 +113,40 @@ HTML/CSS applications to full-fledged web browsers.") | |||
| 103 | license:lgpl2.1+ | 113 | license:lgpl2.1+ |
| 104 | license:bsd-2 | 114 | license:bsd-2 |
| 105 | license:bsd-3)))) | 115 | license:bsd-3)))) |
| 116 | |||
| 117 | ;; Latest release of the stable 2.4 series, with WebKit1 support. | ||
| 118 | (define-public webkitgtk-2.4 | ||
| 119 | (package (inherit webkitgtk) | ||
| 120 | (name "webkitgtk") | ||
| 121 | (version "2.4.9") | ||
| 122 | (source (origin | ||
| 123 | (method url-fetch) | ||
| 124 | (uri (string-append "http://www.webkitgtk.org/releases/" | ||
| 125 | name "-" version ".tar.xz")) | ||
| 126 | (sha256 | ||
| 127 | (base32 | ||
| 128 | "0r651ar3p0f8zwl7764kyimxk5hy88cwy116pv8cl5l8hbkjkpxg")))) | ||
| 129 | (build-system gnu-build-system) | ||
| 130 | (arguments | ||
| 131 | '(#:tests? #f ; no tests | ||
| 132 | #:phases (modify-phases %standard-phases | ||
| 133 | (add-after | ||
| 134 | 'unpack 'set-gcc | ||
| 135 | (lambda _ (setenv "CC" "gcc") #t))))) | ||
| 136 | (native-inputs | ||
| 137 | `(("flex" ,flex) | ||
| 138 | ("which" ,which) | ||
| 139 | ,@(package-native-inputs webkitgtk))))) | ||
| 140 | |||
| 141 | ;; Last GTK+2 port, required by GnuCash. | ||
| 142 | (define-public webkitgtk/gtk+-2 | ||
| 143 | (package (inherit webkitgtk-2.4) | ||
| 144 | (name "webkitgtk") | ||
| 145 | (arguments | ||
| 146 | `(#:configure-flags | ||
| 147 | '("--enable-webkit2=no" | ||
| 148 | "--with-gtk=2.0") | ||
| 149 | ,@(package-arguments webkitgtk-2.4))) | ||
| 150 | (propagated-inputs | ||
| 151 | `(("gtk+-2" ,gtk+-2) | ||
| 152 | ("libsoup" ,libsoup))))) | ||
diff --git a/gnu/packages/wicd.scm b/gnu/packages/wicd.scm index 1953a56b6c3..908b15e30b0 100644 --- a/gnu/packages/wicd.scm +++ b/gnu/packages/wicd.scm | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | 2 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
| 3 | ;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu> | 3 | ;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu> |
| 4 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | ||
| 4 | ;;; | 5 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 6 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 7 | ;;; |
| @@ -44,11 +45,12 @@ | |||
| 44 | "/+download/wicd-" version ".tar.gz")) | 45 | "/+download/wicd-" version ".tar.gz")) |
| 45 | (sha256 | 46 | (sha256 |
| 46 | (base32 "00c4rq753bhg64rv1v9yl834ssq7igyy7cz3swp287b5n5bqiqwi")) | 47 | (base32 "00c4rq753bhg64rv1v9yl834ssq7igyy7cz3swp287b5n5bqiqwi")) |
| 47 | (patches (list (search-patch "wicd-urwid-1.3.patch"))))) | 48 | (patches (map search-patch |
| 49 | '("wicd-urwid-1.3.patch" | ||
| 50 | "wicd-template-instantiation.patch"))))) | ||
| 48 | (build-system python-build-system) | 51 | (build-system python-build-system) |
| 49 | (native-inputs `(("gettext" ,gnu-gettext))) | 52 | (native-inputs `(("gettext" ,gnu-gettext))) |
| 50 | (inputs `(("dbus" ,dbus) | 53 | (inputs `(("dbus-glib" ,dbus-glib) |
| 51 | ("dbus-glib" ,dbus-glib) | ||
| 52 | ("python2-dbus" ,python2-dbus) | 54 | ("python2-dbus" ,python2-dbus) |
| 53 | ("python2-pygtk" ,python2-pygtk) | 55 | ("python2-pygtk" ,python2-pygtk) |
| 54 | ("python2-urwid" ,python2-urwid) | 56 | ("python2-urwid" ,python2-urwid) |
diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm index ee270ff1053..b49fb2fe84e 100644 --- a/gnu/packages/wxwidgets.scm +++ b/gnu/packages/wxwidgets.scm | |||
| @@ -96,5 +96,8 @@ and many other languages.") | |||
| 96 | (arguments | 96 | (arguments |
| 97 | `(#:configure-flags | 97 | `(#:configure-flags |
| 98 | '("--enable-unicode" "--with-regex=sys" "--with-sdl") | 98 | '("--enable-unicode" "--with-regex=sys" "--with-sdl") |
| 99 | #:make-flags | ||
| 100 | (list (string-append "LDFLAGS=-Wl,-rpath=" | ||
| 101 | (assoc-ref %outputs "out") "/lib")) | ||
| 99 | ;; No 'check' target. | 102 | ;; No 'check' target. |
| 100 | #:tests? #f)))) | 103 | #:tests? #f)))) |
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm index 37f09579fe1..818941892fa 100644 --- a/gnu/packages/xfce.scm +++ b/gnu/packages/xfce.scm | |||
| @@ -318,6 +318,37 @@ applications menu, workspace switcher and more.") | |||
| 318 | ;; to read the battery state via ACPI or APM are covered by lgpl2.0+. | 318 | ;; to read the battery state via ACPI or APM are covered by lgpl2.0+. |
| 319 | (license (list gpl2+ lgpl2.0+)))) | 319 | (license (list gpl2+ lgpl2.0+)))) |
| 320 | 320 | ||
| 321 | (define-public xfce4-clipman-plugin | ||
| 322 | (package | ||
| 323 | (name "xfce4-clipman-plugin") | ||
| 324 | (version "1.2.6") | ||
| 325 | (source (origin | ||
| 326 | (method url-fetch) | ||
| 327 | (uri (string-append "http://archive.xfce.org/src/panel-plugins/" | ||
| 328 | name "/" (version-major+minor version) "/" | ||
| 329 | name "-" version ".tar.bz2")) | ||
| 330 | (sha256 | ||
| 331 | (base32 | ||
| 332 | "19a8gwcqc0r5qqi8w28dc8arqip34m8yxdb87lgps9g5qfcky113")))) | ||
| 333 | (build-system gnu-build-system) | ||
| 334 | (native-inputs | ||
| 335 | `(("intltool" ,intltool) | ||
| 336 | ("pkg-config" ,pkg-config))) | ||
| 337 | (inputs | ||
| 338 | `(("exo" ,exo) | ||
| 339 | ("libxfce4ui" ,libxfce4ui) | ||
| 340 | ("libxtst" ,libxtst) | ||
| 341 | ("xfce4-panel" ,xfce4-panel))) | ||
| 342 | (home-page | ||
| 343 | "http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin") | ||
| 344 | (synopsis "Clipboard manager for Xfce") | ||
| 345 | (description | ||
| 346 | "Clipman is a clipboard manager for Xfce. It keeps the clipboard contents | ||
| 347 | around while it is usually lost when you close an application. It is able to | ||
| 348 | handle text and images, and has a feature to execute actions on specific text by | ||
| 349 | matching them against regular expressions.") | ||
| 350 | (license (list gpl2+)))) | ||
| 351 | |||
| 321 | (define-public xfce4-appfinder | 352 | (define-public xfce4-appfinder |
| 322 | (package | 353 | (package |
| 323 | (name "xfce4-appfinder") | 354 | (name "xfce4-appfinder") |
| @@ -601,6 +632,7 @@ on your desktop.") | |||
| 601 | ("tumlber" ,tumbler) | 632 | ("tumlber" ,tumbler) |
| 602 | ("xfce4-appfinder" ,xfce4-appfinder) | 633 | ("xfce4-appfinder" ,xfce4-appfinder) |
| 603 | ("xfce4-battery-plugin" ,xfce4-battery-plugin) | 634 | ("xfce4-battery-plugin" ,xfce4-battery-plugin) |
| 635 | ("xfce4-clipman-plugin" ,xfce4-clipman-plugin) | ||
| 604 | ("xfce4-panel" ,xfce4-panel) | 636 | ("xfce4-panel" ,xfce4-panel) |
| 605 | ("xfce4-session" ,xfce4-session) | 637 | ("xfce4-session" ,xfce4-session) |
| 606 | ("xfce4-settings" ,xfce4-settings) | 638 | ("xfce4-settings" ,xfce4-settings) |
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 97781adef26..59b73d2aa5a 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> | 3 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
| 4 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> | 4 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> |
| 5 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> | 5 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
| 6 | ;;; | 6 | ;;; |
| @@ -21,8 +21,10 @@ | |||
| 21 | 21 | ||
| 22 | (define-module (gnu packages xml) | 22 | (define-module (gnu packages xml) |
| 23 | #:use-module (gnu packages) | 23 | #:use-module (gnu packages) |
| 24 | #:use-module (gnu packages autotools) | ||
| 24 | #:use-module (gnu packages compression) | 25 | #:use-module (gnu packages compression) |
| 25 | #:use-module (gnu packages gnupg) | 26 | #:use-module (gnu packages gnupg) |
| 27 | #:use-module (gnu packages gnutls) | ||
| 26 | #:use-module (gnu packages perl) | 28 | #:use-module (gnu packages perl) |
| 27 | #:use-module (gnu packages python) | 29 | #:use-module (gnu packages python) |
| 28 | #:use-module (gnu packages web) | 30 | #:use-module (gnu packages web) |
| @@ -397,3 +399,32 @@ that conforms to the API of the Document Object Model.") | |||
| 397 | stylesheet for the conversion you want and applies it using an external | 399 | stylesheet for the conversion you want and applies it using an external |
| 398 | XSL-T processor. It also performs any necessary post-processing.") | 400 | XSL-T processor. It also performs any necessary post-processing.") |
| 399 | (license license:gpl2+))) | 401 | (license license:gpl2+))) |
| 402 | |||
| 403 | (define-public xmlsec | ||
| 404 | (package | ||
| 405 | (name "xmlsec") | ||
| 406 | (version "1.2.20") | ||
| 407 | (source (origin | ||
| 408 | (method url-fetch) | ||
| 409 | (uri (string-append "https://www.aleksey.com/xmlsec/download/" | ||
| 410 | name "1-" version ".tar.gz")) | ||
| 411 | (sha256 | ||
| 412 | (base32 | ||
| 413 | "01bkbv2y3x8d1sf4dcln1x3y2jyj391s3208d9a2ndhglly5j89j")))) | ||
| 414 | (build-system gnu-build-system) | ||
| 415 | (propagated-inputs ; according to xmlsec1.pc | ||
| 416 | `(("libxml2" ,libxml2) | ||
| 417 | ("libxslt" ,libxslt))) | ||
| 418 | (inputs | ||
| 419 | `(("gnutls" ,gnutls) | ||
| 420 | ("libgcrypt" ,libgcrypt) | ||
| 421 | ("libltdl" ,libltdl))) | ||
| 422 | (home-page "http://www.libexpat.org/") | ||
| 423 | (synopsis "XML Security Library") | ||
| 424 | (description | ||
| 425 | "The XML Security Library is a C library based on Libxml2. It | ||
| 426 | supports XML security standards such as XML Signature, XML Encryption, | ||
| 427 | Canonical XML (part of Libxml2) and Exclusive Canonical XML (part of | ||
| 428 | Libxml2).") | ||
| 429 | (license (license:x11-style "file://COPYING" | ||
| 430 | "See 'COPYING' in the distribution.")))) | ||
diff --git a/gnu/services/avahi.scm b/gnu/services/avahi.scm index 0a56f3d7f6f..a3ca5ab6fbe 100644 --- a/gnu/services/avahi.scm +++ b/gnu/services/avahi.scm | |||
| @@ -63,7 +63,7 @@ | |||
| 63 | (domains-to-browse '())) | 63 | (domains-to-browse '())) |
| 64 | "Return a service that runs @command{avahi-daemon}, a system-wide | 64 | "Return a service that runs @command{avahi-daemon}, a system-wide |
| 65 | mDNS/DNS-SD responder that allows for service discovery and | 65 | mDNS/DNS-SD responder that allows for service discovery and |
| 66 | \"zero-configuration\" host name lookups. | 66 | \"zero-configuration\" host name lookups (see @uref{http://avahi.org/}). |
| 67 | 67 | ||
| 68 | If @var{host-name} is different from @code{#f}, use that as the host name to | 68 | If @var{host-name} is different from @code{#f}, use that as the host name to |
| 69 | publish for this machine; otherwise, use the machine's actual host name. | 69 | publish for this machine; otherwise, use the machine's actual host name. |
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d0a2e8c848f..d5744204d9d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 Alex Kost <alezost@gmail.com> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -46,6 +47,7 @@ | |||
| 46 | swap-service | 47 | swap-service |
| 47 | user-processes-service | 48 | user-processes-service |
| 48 | host-name-service | 49 | host-name-service |
| 50 | console-keymap-service | ||
| 49 | console-font-service | 51 | console-font-service |
| 50 | udev-service | 52 | udev-service |
| 51 | mingetty-service | 53 | mingetty-service |
| @@ -313,6 +315,19 @@ stopped before 'kill' is called." | |||
| 313 | (else | 315 | (else |
| 314 | (zero? (cdr (waitpid pid)))))))) | 316 | (zero? (cdr (waitpid pid)))))))) |
| 315 | 317 | ||
| 318 | (define (console-keymap-service file) | ||
| 319 | "Return a service to load console keymap from @var{file}." | ||
| 320 | (with-monad %store-monad | ||
| 321 | (return | ||
| 322 | (service | ||
| 323 | (documentation | ||
| 324 | (string-append "Load console keymap (loadkeys).")) | ||
| 325 | (provision '(console-keymap)) | ||
| 326 | (start #~(lambda _ | ||
| 327 | (zero? (system* (string-append #$kbd "/bin/loadkeys") | ||
| 328 | #$file)))) | ||
| 329 | (respawn? #f))))) | ||
| 330 | |||
| 316 | (define* (console-font-service tty #:optional (font "LatGrkCyr-8x16")) | 331 | (define* (console-font-service tty #:optional (font "LatGrkCyr-8x16")) |
| 317 | "Return a service that sets up Unicode support in @var{tty} and loads | 332 | "Return a service that sets up Unicode support in @var{tty} and loads |
| 318 | @var{font} for that tty (fonts are per virtual console in Linux.)" | 333 | @var{font} for that tty (fonts are per virtual console in Linux.)" |
| @@ -836,10 +851,10 @@ gexp, to open it, and evaluate @var{close} to close it." | |||
| 836 | (requirement `(udev ,@requirement)) | 851 | (requirement `(udev ,@requirement)) |
| 837 | (documentation "Enable the given swap device.") | 852 | (documentation "Enable the given swap device.") |
| 838 | (start #~(lambda () | 853 | (start #~(lambda () |
| 839 | (swapon #$device) | 854 | (restart-on-EINTR (swapon #$device)) |
| 840 | #t)) | 855 | #t)) |
| 841 | (stop #~(lambda _ | 856 | (stop #~(lambda _ |
| 842 | (swapoff #$device) | 857 | (restart-on-EINTR (swapoff #$device)) |
| 843 | #f)) | 858 | #f)) |
| 844 | (respawn? #f))))) | 859 | (respawn? #f))))) |
| 845 | 860 | ||
diff --git a/gnu/services/colord.scm b/gnu/services/colord.scm deleted file mode 100644 index 588436002cc..00000000000 --- a/gnu/services/colord.scm +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> | ||
| 4 | ;;; | ||
| 5 | ;;; This file is part of GNU Guix. | ||
| 6 | ;;; | ||
| 7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 8 | ;;; under the terms of the GNU General Public License as published by | ||
| 9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 10 | ;;; your option) any later version. | ||
| 11 | ;;; | ||
| 12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;;; GNU General Public License for more details. | ||
| 16 | ;;; | ||
| 17 | ;;; You should have received a copy of the GNU General Public License | ||
| 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | (define-module (gnu services colord) | ||
| 21 | #:use-module (gnu services) | ||
| 22 | #:use-module (gnu system shadow) | ||
| 23 | #:use-module (gnu packages gnome) | ||
| 24 | #:use-module (ice-9 match) | ||
| 25 | #:use-module (guix monads) | ||
| 26 | #:use-module (guix store) | ||
| 27 | #:use-module (guix gexp) | ||
| 28 | #:export (colord-service)) | ||
| 29 | |||
| 30 | ;;; Commentary: | ||
| 31 | ;;; | ||
| 32 | ;;; This module provides service definitions for the colord color management | ||
| 33 | ;;; service. | ||
| 34 | ;;; | ||
| 35 | ;;; Code: | ||
| 36 | |||
| 37 | (define* (colord-service #:key (colord colord)) | ||
| 38 | "Return a service that runs @command{colord}, a system service with a D-Bus | ||
| 39 | interface to manage the color profiles of input and output devices such as | ||
| 40 | screens and scanners. It is notably used by the GNOME Color Manager graphical | ||
| 41 | tool. See @uref{http://www.freedesktop.org/software/colord/, the colord web | ||
| 42 | site} for more information." | ||
| 43 | (with-monad %store-monad | ||
| 44 | (return | ||
| 45 | (service | ||
| 46 | (documentation "Run the colord color management service.") | ||
| 47 | (provision '(colord-daemon)) | ||
| 48 | (requirement '(dbus-system udev)) | ||
| 49 | |||
| 50 | (start #~(make-forkexec-constructor | ||
| 51 | (list (string-append #$colord "/libexec/colord")))) | ||
| 52 | (stop #~(make-kill-destructor)) | ||
| 53 | (activate #~(begin | ||
| 54 | (use-modules (guix build utils)) | ||
| 55 | (mkdir-p "/var/lib/colord") | ||
| 56 | (let ((user (getpwnam "colord"))) | ||
| 57 | (chown "/var/lib/colord" | ||
| 58 | (passwd:uid user) (passwd:gid user))))) | ||
| 59 | |||
| 60 | (user-groups (list (user-group | ||
| 61 | (name "colord") | ||
| 62 | (system? #t)))) | ||
| 63 | (user-accounts (list (user-account | ||
| 64 | (name "colord") | ||
| 65 | (group "colord") | ||
| 66 | (system? #t) | ||
| 67 | (comment "colord daemon user") | ||
| 68 | (home-directory "/var/empty") | ||
| 69 | (shell | ||
| 70 | "/run/current-system/profile/sbin/nologin")))))))) | ||
| 71 | |||
| 72 | ;;; colord.scm ends here | ||
diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm new file mode 100644 index 00000000000..18f41e74dae --- /dev/null +++ b/gnu/services/databases.scm | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 David Thompson <davet@gnu.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu services databases) | ||
| 20 | #:use-module (gnu services) | ||
| 21 | #:use-module (gnu system shadow) | ||
| 22 | #:use-module (gnu packages admin) | ||
| 23 | #:use-module (gnu packages databases) | ||
| 24 | #:use-module (guix records) | ||
| 25 | #:use-module (guix monads) | ||
| 26 | #:use-module (guix store) | ||
| 27 | #:use-module (guix gexp) | ||
| 28 | #:export (postgresql-service)) | ||
| 29 | |||
| 30 | ;;; Commentary: | ||
| 31 | ;;; | ||
| 32 | ;;; Database services. | ||
| 33 | ;;; | ||
| 34 | ;;; Code: | ||
| 35 | |||
| 36 | (define %default-postgres-hba | ||
| 37 | (text-file "pg_hba.conf" | ||
| 38 | " | ||
| 39 | local all all trust | ||
| 40 | host all all 127.0.0.1/32 trust | ||
| 41 | host all all ::1/128 trust")) | ||
| 42 | |||
| 43 | (define %default-postgres-ident | ||
| 44 | (text-file "pg_ident.conf" | ||
| 45 | "# MAPNAME SYSTEM-USERNAME PG-USERNAME")) | ||
| 46 | |||
| 47 | (define %default-postgres-config | ||
| 48 | (mlet %store-monad ((hba %default-postgres-hba) | ||
| 49 | (ident %default-postgres-ident)) | ||
| 50 | (text-file* "postgresql.conf" | ||
| 51 | ;; The daemon will not start without these. | ||
| 52 | "hba_file = '" hba "'\n" | ||
| 53 | "ident_file = '" ident "'\n"))) | ||
| 54 | |||
| 55 | (define* (postgresql-service #:key (postgresql postgresql) | ||
| 56 | (config-file %default-postgres-config) | ||
| 57 | (data-directory "/var/lib/postgresql/data")) | ||
| 58 | "Return a service that runs @var{postgresql}, the PostgreSQL database server. | ||
| 59 | |||
| 60 | The PostgreSQL daemon loads its runtime configuration from @var{config-file} | ||
| 61 | and stores the database cluster in @var{data-directory}." | ||
| 62 | ;; Wrapper script that switches to the 'postgres' user before launching | ||
| 63 | ;; daemon. | ||
| 64 | (define start-script | ||
| 65 | (mlet %store-monad ((config-file config-file)) | ||
| 66 | (gexp->script "start-postgres" | ||
| 67 | #~(let ((user (getpwnam "postgres")) | ||
| 68 | (postgres (string-append #$postgresql | ||
| 69 | "/bin/postgres"))) | ||
| 70 | (setgid (passwd:gid user)) | ||
| 71 | (setuid (passwd:uid user)) | ||
| 72 | (system* postgres | ||
| 73 | (string-append "--config-file=" #$config-file) | ||
| 74 | "-D" #$data-directory))))) | ||
| 75 | |||
| 76 | (define activate | ||
| 77 | #~(begin | ||
| 78 | (use-modules (guix build utils) | ||
| 79 | (ice-9 match)) | ||
| 80 | |||
| 81 | (let ((user (getpwnam "postgres")) | ||
| 82 | (initdb (string-append #$postgresql "/bin/initdb"))) | ||
| 83 | ;; Create db state directory. | ||
| 84 | (mkdir-p #$data-directory) | ||
| 85 | (chown #$data-directory (passwd:uid user) (passwd:gid user)) | ||
| 86 | |||
| 87 | ;; Drop privileges and init state directory in a new | ||
| 88 | ;; process. Wait for it to finish before proceeding. | ||
| 89 | (match (primitive-fork) | ||
| 90 | (0 | ||
| 91 | ;; Exit with a non-zero status code if an exception is thrown. | ||
| 92 | (dynamic-wind | ||
| 93 | (const #t) | ||
| 94 | (lambda () | ||
| 95 | (setgid (passwd:gid user)) | ||
| 96 | (setuid (passwd:uid user)) | ||
| 97 | (primitive-exit (system* initdb "-D" #$data-directory))) | ||
| 98 | (lambda () | ||
| 99 | (primitive-exit 1)))) | ||
| 100 | (pid (waitpid pid)))))) | ||
| 101 | |||
| 102 | (mlet %store-monad ((start-script start-script)) | ||
| 103 | (return | ||
| 104 | (service | ||
| 105 | (provision '(postgres)) | ||
| 106 | (documentation "Run the PostgreSQL daemon.") | ||
| 107 | (requirement '(user-processes loopback)) | ||
| 108 | (start #~(make-forkexec-constructor #$start-script)) | ||
| 109 | (stop #~(make-kill-destructor)) | ||
| 110 | (activate activate) | ||
| 111 | (user-groups (list (user-group | ||
| 112 | (name "postgres") | ||
| 113 | (system? #t)))) | ||
| 114 | (user-accounts (list (user-account | ||
| 115 | (name "postgres") | ||
| 116 | (group "postgres") | ||
| 117 | (system? #t) | ||
| 118 | (comment "PostgreSQL server user") | ||
| 119 | (home-directory "/var/empty") | ||
| 120 | (shell | ||
| 121 | #~(string-append #$shadow "/sbin/nologin"))))))))) | ||
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm deleted file mode 100644 index 8f3b3509517..00000000000 --- a/gnu/services/dbus.scm +++ /dev/null | |||
| @@ -1,127 +0,0 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu services dbus) | ||
| 20 | #:use-module (gnu services) | ||
| 21 | #:use-module (gnu system shadow) | ||
| 22 | #:use-module (gnu packages glib) | ||
| 23 | #:use-module (gnu packages admin) | ||
| 24 | #:use-module (guix monads) | ||
| 25 | #:use-module (guix store) | ||
| 26 | #:use-module (guix gexp) | ||
| 27 | #:export (dbus-service)) | ||
| 28 | |||
| 29 | ;;; Commentary: | ||
| 30 | ;;; | ||
| 31 | ;;; This module supports the configuration of the D-Bus message bus | ||
| 32 | ;;; (http://dbus.freedesktop.org/). D-Bus is an inter-process communication | ||
| 33 | ;;; facility. Its "system bus" is used to allow system services to | ||
| 34 | ;;; communicate and be notified of system-wide events. | ||
| 35 | ;;; | ||
| 36 | ;;; Code: | ||
| 37 | |||
| 38 | (define (dbus-configuration-directory dbus services) | ||
| 39 | "Return a configuration directory for @var{dbus} that includes the | ||
| 40 | @code{etc/dbus-1/system.d} directories of each package listed in | ||
| 41 | @var{services}." | ||
| 42 | (define build | ||
| 43 | #~(begin | ||
| 44 | (use-modules (sxml simple) | ||
| 45 | (srfi srfi-1)) | ||
| 46 | |||
| 47 | (define (services->sxml services) | ||
| 48 | ;; Return the SXML 'includedir' clauses for DIRS. | ||
| 49 | `(busconfig | ||
| 50 | ,@(append-map (lambda (dir) | ||
| 51 | `((includedir | ||
| 52 | ,(string-append dir "/etc/dbus-1/system.d")) | ||
| 53 | (servicedir ;for '.service' files | ||
| 54 | ,(string-append dir "/share/dbus-1/services")))) | ||
| 55 | services))) | ||
| 56 | |||
| 57 | (mkdir #$output) | ||
| 58 | (copy-file (string-append #$dbus "/etc/dbus-1/system.conf") | ||
| 59 | (string-append #$output "/system.conf")) | ||
| 60 | |||
| 61 | ;; The default 'system.conf' has an <includedir> clause for | ||
| 62 | ;; 'system.d', so create it. | ||
| 63 | (mkdir (string-append #$output "/system.d")) | ||
| 64 | |||
| 65 | ;; 'system-local.conf' is automatically included by the default | ||
| 66 | ;; 'system.conf', so this is where we stuff our own things. | ||
| 67 | (call-with-output-file (string-append #$output "/system-local.conf") | ||
| 68 | (lambda (port) | ||
| 69 | (sxml->xml (services->sxml (list #$@services)) | ||
| 70 | port))))) | ||
| 71 | |||
| 72 | (gexp->derivation "dbus-configuration" build)) | ||
| 73 | |||
| 74 | (define* (dbus-service services #:key (dbus dbus)) | ||
| 75 | "Return a service that runs the system bus, using @var{dbus}, with support | ||
| 76 | for @var{services}. | ||
| 77 | |||
| 78 | @var{services} must be a list of packages that provide an | ||
| 79 | @file{etc/dbus-1/system.d} directory containing additional D-Bus configuration | ||
| 80 | and policy files. For example, to allow avahi-daemon to use the system bus, | ||
| 81 | @var{services} must be equal to @code{(list avahi)}." | ||
| 82 | (mlet %store-monad ((conf (dbus-configuration-directory dbus services))) | ||
| 83 | (return | ||
| 84 | (service | ||
| 85 | (documentation "Run the D-Bus system daemon.") | ||
| 86 | (provision '(dbus-system)) | ||
| 87 | (requirement '(user-processes)) | ||
| 88 | (start #~(make-forkexec-constructor | ||
| 89 | (list (string-append #$dbus "/bin/dbus-daemon") | ||
| 90 | "--nofork" | ||
| 91 | (string-append "--config-file=" #$conf "/system.conf")))) | ||
| 92 | (stop #~(make-kill-destructor)) | ||
| 93 | (user-groups (list (user-group | ||
| 94 | (name "messagebus") | ||
| 95 | (system? #t)))) | ||
| 96 | (user-accounts (list (user-account | ||
| 97 | (name "messagebus") | ||
| 98 | (group "messagebus") | ||
| 99 | (system? #t) | ||
| 100 | (comment "D-Bus system bus user") | ||
| 101 | (home-directory "/var/run/dbus") | ||
| 102 | (shell | ||
| 103 | #~(string-append #$shadow "/sbin/nologin"))))) | ||
| 104 | (activate #~(begin | ||
| 105 | (use-modules (guix build utils)) | ||
| 106 | |||
| 107 | (mkdir-p "/var/run/dbus") | ||
| 108 | |||
| 109 | (let ((user (getpwnam "messagebus"))) | ||
| 110 | (chown "/var/run/dbus" | ||
| 111 | (passwd:uid user) (passwd:gid user))) | ||
| 112 | |||
| 113 | (unless (file-exists? "/etc/machine-id") | ||
| 114 | (format #t "creating /etc/machine-id...~%") | ||
| 115 | (let ((prog (string-append #$dbus "/bin/dbus-uuidgen"))) | ||
| 116 | ;; XXX: We can't use 'system' because the initrd's | ||
| 117 | ;; guile system(3) only works when 'sh' is in $PATH. | ||
| 118 | (let ((pid (primitive-fork))) | ||
| 119 | (if (zero? pid) | ||
| 120 | (call-with-output-file "/etc/machine-id" | ||
| 121 | (lambda (port) | ||
| 122 | (close-fdes 1) | ||
| 123 | (dup2 (port->fdes port) 1) | ||
| 124 | (execl prog))) | ||
| 125 | (waitpid pid))))))))))) | ||
| 126 | |||
| 127 | ;;; dbus.scm ends here | ||
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm new file mode 100644 index 00000000000..910dc1f9e09 --- /dev/null +++ b/gnu/services/desktop.scm | |||
| @@ -0,0 +1,300 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> | ||
| 4 | ;;; | ||
| 5 | ;;; This file is part of GNU Guix. | ||
| 6 | ;;; | ||
| 7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 8 | ;;; under the terms of the GNU General Public License as published by | ||
| 9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 10 | ;;; your option) any later version. | ||
| 11 | ;;; | ||
| 12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;;; GNU General Public License for more details. | ||
| 16 | ;;; | ||
| 17 | ;;; You should have received a copy of the GNU General Public License | ||
| 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | (define-module (gnu services desktop) | ||
| 21 | #:use-module (gnu services) | ||
| 22 | #:use-module (gnu services base) | ||
| 23 | #:use-module (gnu services avahi) | ||
| 24 | #:use-module (gnu services xorg) | ||
| 25 | #:use-module (gnu services networking) | ||
| 26 | #:use-module (gnu services ssh) | ||
| 27 | #:use-module (gnu system shadow) | ||
| 28 | #:use-module (gnu packages glib) | ||
| 29 | #:use-module (gnu packages admin) | ||
| 30 | #:use-module (gnu packages gnome) | ||
| 31 | #:use-module (gnu packages avahi) | ||
| 32 | #:use-module (gnu packages wicd) | ||
| 33 | #:use-module (guix monads) | ||
| 34 | #:use-module (guix store) | ||
| 35 | #:use-module (guix gexp) | ||
| 36 | #:use-module (ice-9 match) | ||
| 37 | #:export (dbus-service | ||
| 38 | upower-service | ||
| 39 | colord-service | ||
| 40 | %desktop-services)) | ||
| 41 | |||
| 42 | ;;; Commentary: | ||
| 43 | ;;; | ||
| 44 | ;;; This module contains service definitions for a "desktop" environment. | ||
| 45 | ;;; | ||
| 46 | ;;; Code: | ||
| 47 | |||
| 48 | |||
| 49 | ;;; | ||
| 50 | ;;; D-Bus. | ||
| 51 | ;;; | ||
| 52 | |||
| 53 | (define (dbus-configuration-directory dbus services) | ||
| 54 | "Return a configuration directory for @var{dbus} that includes the | ||
| 55 | @code{etc/dbus-1/system.d} directories of each package listed in | ||
| 56 | @var{services}." | ||
| 57 | (define build | ||
| 58 | #~(begin | ||
| 59 | (use-modules (sxml simple) | ||
| 60 | (srfi srfi-1)) | ||
| 61 | |||
| 62 | (define (services->sxml services) | ||
| 63 | ;; Return the SXML 'includedir' clauses for DIRS. | ||
| 64 | `(busconfig | ||
| 65 | ,@(append-map (lambda (dir) | ||
| 66 | `((includedir | ||
| 67 | ,(string-append dir "/etc/dbus-1/system.d")) | ||
| 68 | (servicedir ;for '.service' files | ||
| 69 | ,(string-append dir "/share/dbus-1/services")))) | ||
| 70 | services))) | ||
| 71 | |||
| 72 | (mkdir #$output) | ||
| 73 | (copy-file (string-append #$dbus "/etc/dbus-1/system.conf") | ||
| 74 | (string-append #$output "/system.conf")) | ||
| 75 | |||
| 76 | ;; The default 'system.conf' has an <includedir> clause for | ||
| 77 | ;; 'system.d', so create it. | ||
| 78 | (mkdir (string-append #$output "/system.d")) | ||
| 79 | |||
| 80 | ;; 'system-local.conf' is automatically included by the default | ||
| 81 | ;; 'system.conf', so this is where we stuff our own things. | ||
| 82 | (call-with-output-file (string-append #$output "/system-local.conf") | ||
| 83 | (lambda (port) | ||
| 84 | (sxml->xml (services->sxml (list #$@services)) | ||
| 85 | port))))) | ||
| 86 | |||
| 87 | (gexp->derivation "dbus-configuration" build)) | ||
| 88 | |||
| 89 | (define* (dbus-service services #:key (dbus dbus)) | ||
| 90 | "Return a service that runs the \"system bus\", using @var{dbus}, with | ||
| 91 | support for @var{services}. | ||
| 92 | |||
| 93 | @uref{http://dbus.freedesktop.org/, D-Bus} is an inter-process communication | ||
| 94 | facility. Its system bus is used to allow system services to communicate and | ||
| 95 | be notified of system-wide events. | ||
| 96 | |||
| 97 | @var{services} must be a list of packages that provide an | ||
| 98 | @file{etc/dbus-1/system.d} directory containing additional D-Bus configuration | ||
| 99 | and policy files. For example, to allow avahi-daemon to use the system bus, | ||
| 100 | @var{services} must be equal to @code{(list avahi)}." | ||
| 101 | (mlet %store-monad ((conf (dbus-configuration-directory dbus services))) | ||
| 102 | (return | ||
| 103 | (service | ||
| 104 | (documentation "Run the D-Bus system daemon.") | ||
| 105 | (provision '(dbus-system)) | ||
| 106 | (requirement '(user-processes)) | ||
| 107 | (start #~(make-forkexec-constructor | ||
| 108 | (list (string-append #$dbus "/bin/dbus-daemon") | ||
| 109 | "--nofork" | ||
| 110 | (string-append "--config-file=" #$conf "/system.conf")))) | ||
| 111 | (stop #~(make-kill-destructor)) | ||
| 112 | (user-groups (list (user-group | ||
| 113 | (name "messagebus") | ||
| 114 | (system? #t)))) | ||
| 115 | (user-accounts (list (user-account | ||
| 116 | (name "messagebus") | ||
| 117 | (group "messagebus") | ||
| 118 | (system? #t) | ||
| 119 | (comment "D-Bus system bus user") | ||
| 120 | (home-directory "/var/run/dbus") | ||
| 121 | (shell | ||
| 122 | #~(string-append #$shadow "/sbin/nologin"))))) | ||
| 123 | (activate #~(begin | ||
| 124 | (use-modules (guix build utils)) | ||
| 125 | |||
| 126 | (mkdir-p "/var/run/dbus") | ||
| 127 | |||
| 128 | (let ((user (getpwnam "messagebus"))) | ||
| 129 | (chown "/var/run/dbus" | ||
| 130 | (passwd:uid user) (passwd:gid user))) | ||
| 131 | |||
| 132 | (unless (file-exists? "/etc/machine-id") | ||
| 133 | (format #t "creating /etc/machine-id...~%") | ||
| 134 | (let ((prog (string-append #$dbus "/bin/dbus-uuidgen"))) | ||
| 135 | ;; XXX: We can't use 'system' because the initrd's | ||
| 136 | ;; guile system(3) only works when 'sh' is in $PATH. | ||
| 137 | (let ((pid (primitive-fork))) | ||
| 138 | (if (zero? pid) | ||
| 139 | (call-with-output-file "/etc/machine-id" | ||
| 140 | (lambda (port) | ||
| 141 | (close-fdes 1) | ||
| 142 | (dup2 (port->fdes port) 1) | ||
| 143 | (execl prog))) | ||
| 144 | (waitpid pid))))))))))) | ||
| 145 | |||
| 146 | |||
| 147 | ;;; | ||
| 148 | ;;; Upower D-Bus service. | ||
| 149 | ;;; | ||
| 150 | |||
| 151 | (define* (upower-configuration-file #:key watts-up-pro? poll-batteries? | ||
| 152 | ignore-lid? use-percentage-for-policy? | ||
| 153 | percentage-low percentage-critical | ||
| 154 | percentage-action time-low | ||
| 155 | time-critical time-action | ||
| 156 | critical-power-action) | ||
| 157 | "Return an upower-daemon configuration file." | ||
| 158 | (define (bool value) | ||
| 159 | (if value "true\n" "false\n")) | ||
| 160 | |||
| 161 | (text-file "UPower.conf" | ||
| 162 | (string-append | ||
| 163 | "[UPower]\n" | ||
| 164 | "EnableWattsUpPro=" (bool watts-up-pro?) | ||
| 165 | "NoPollBatteries=" (bool (not poll-batteries?)) | ||
| 166 | "IgnoreLid=" (bool ignore-lid?) | ||
| 167 | "UsePercentageForPolicy=" (bool use-percentage-for-policy?) | ||
| 168 | "PercentageLow=" (number->string percentage-low) "\n" | ||
| 169 | "PercentageCritical=" (number->string percentage-critical) "\n" | ||
| 170 | "PercentageAction=" (number->string percentage-action) "\n" | ||
| 171 | "TimeLow=" (number->string time-low) "\n" | ||
| 172 | "TimeCritical=" (number->string time-critical) "\n" | ||
| 173 | "TimeAction=" (number->string time-action) "\n" | ||
| 174 | "CriticalPowerAction=" (match critical-power-action | ||
| 175 | ('hybrid-sleep "HybridSleep") | ||
| 176 | ('hibernate "Hibernate") | ||
| 177 | ('power-off "PowerOff")) | ||
| 178 | "\n"))) | ||
| 179 | |||
| 180 | (define* (upower-service #:key (upower upower) | ||
| 181 | (watts-up-pro? #f) | ||
| 182 | (poll-batteries? #t) | ||
| 183 | (ignore-lid? #f) | ||
| 184 | (use-percentage-for-policy? #f) | ||
| 185 | (percentage-low 10) | ||
| 186 | (percentage-critical 3) | ||
| 187 | (percentage-action 2) | ||
| 188 | (time-low 1200) | ||
| 189 | (time-critical 300) | ||
| 190 | (time-action 120) | ||
| 191 | (critical-power-action 'hybrid-sleep)) | ||
| 192 | "Return a service that runs @uref{http://upower.freedesktop.org/, | ||
| 193 | @command{upowerd}}, a system-wide monitor for power consumption and battery | ||
| 194 | levels, with the given configuration settings. It implements the | ||
| 195 | @code{org.freedesktop.UPower} D-Bus interface, and is notably used by GNOME." | ||
| 196 | (mlet %store-monad ((config (upower-configuration-file | ||
| 197 | #:watts-up-pro? watts-up-pro? | ||
| 198 | #:poll-batteries? poll-batteries? | ||
| 199 | #:ignore-lid? ignore-lid? | ||
| 200 | #:use-percentage-for-policy? use-percentage-for-policy? | ||
| 201 | #:percentage-low percentage-low | ||
| 202 | #:percentage-critical percentage-critical | ||
| 203 | #:percentage-action percentage-action | ||
| 204 | #:time-low time-low | ||
| 205 | #:time-critical time-critical | ||
| 206 | #:time-action time-action | ||
| 207 | #:critical-power-action critical-power-action))) | ||
| 208 | (return | ||
| 209 | (service | ||
| 210 | (documentation "Run the UPower power and battery monitor.") | ||
| 211 | (provision '(upower-daemon)) | ||
| 212 | (requirement '(dbus-system udev)) | ||
| 213 | |||
| 214 | (start #~(make-forkexec-constructor | ||
| 215 | (list (string-append #$upower "/libexec/upowerd")) | ||
| 216 | #:environment-variables | ||
| 217 | (list (string-append "UPOWER_CONF_FILE_NAME=" #$config)))) | ||
| 218 | (stop #~(make-kill-destructor)) | ||
| 219 | (activate #~(begin | ||
| 220 | (use-modules (guix build utils)) | ||
| 221 | (mkdir-p "/var/lib/upower") | ||
| 222 | (let ((user (getpwnam "upower"))) | ||
| 223 | (chown "/var/lib/upower" | ||
| 224 | (passwd:uid user) (passwd:gid user))))) | ||
| 225 | |||
| 226 | (user-groups (list (user-group | ||
| 227 | (name "upower") | ||
| 228 | (system? #t)))) | ||
| 229 | (user-accounts (list (user-account | ||
| 230 | (name "upower") | ||
| 231 | (group "upower") | ||
| 232 | (system? #t) | ||
| 233 | (comment "UPower daemon user") | ||
| 234 | (home-directory "/var/empty") | ||
| 235 | (shell | ||
| 236 | #~(string-append #$shadow "/sbin/nologin"))))))))) | ||
| 237 | |||
| 238 | |||
| 239 | ;;; | ||
| 240 | ;;; Colord D-Bus service. | ||
| 241 | ;;; | ||
| 242 | |||
| 243 | (define* (colord-service #:key (colord colord)) | ||
| 244 | "Return a service that runs @command{colord}, a system service with a D-Bus | ||
| 245 | interface to manage the color profiles of input and output devices such as | ||
| 246 | screens and scanners. It is notably used by the GNOME Color Manager graphical | ||
| 247 | tool. See @uref{http://www.freedesktop.org/software/colord/, the colord web | ||
| 248 | site} for more information." | ||
| 249 | (with-monad %store-monad | ||
| 250 | (return | ||
| 251 | (service | ||
| 252 | (documentation "Run the colord color management service.") | ||
| 253 | (provision '(colord-daemon)) | ||
| 254 | (requirement '(dbus-system udev)) | ||
| 255 | |||
| 256 | (start #~(make-forkexec-constructor | ||
| 257 | (list (string-append #$colord "/libexec/colord")))) | ||
| 258 | (stop #~(make-kill-destructor)) | ||
| 259 | (activate #~(begin | ||
| 260 | (use-modules (guix build utils)) | ||
| 261 | (mkdir-p "/var/lib/colord") | ||
| 262 | (let ((user (getpwnam "colord"))) | ||
| 263 | (chown "/var/lib/colord" | ||
| 264 | (passwd:uid user) (passwd:gid user))))) | ||
| 265 | |||
| 266 | (user-groups (list (user-group | ||
| 267 | (name "colord") | ||
| 268 | (system? #t)))) | ||
| 269 | (user-accounts (list (user-account | ||
| 270 | (name "colord") | ||
| 271 | (group "colord") | ||
| 272 | (system? #t) | ||
| 273 | (comment "colord daemon user") | ||
| 274 | (home-directory "/var/empty") | ||
| 275 | (shell | ||
| 276 | #~(string-append #$shadow "/sbin/nologin"))))))))) | ||
| 277 | |||
| 278 | (define %desktop-services | ||
| 279 | ;; List of services typically useful for a "desktop" use case. | ||
| 280 | (cons* (slim-service) | ||
| 281 | |||
| 282 | (avahi-service) | ||
| 283 | (wicd-service) | ||
| 284 | (upower-service) | ||
| 285 | (colord-service) | ||
| 286 | (dbus-service (list avahi wicd upower colord)) | ||
| 287 | |||
| 288 | (ntp-service) | ||
| 289 | (lsh-service) | ||
| 290 | |||
| 291 | (map (lambda (mservice) | ||
| 292 | ;; Provide an nscd ready to use nss-mdns. | ||
| 293 | (mlet %store-monad ((service mservice)) | ||
| 294 | (if (memq 'nscd (service-provision service)) | ||
| 295 | (nscd-service (nscd-configuration) | ||
| 296 | #:name-services (list nss-mdns)) | ||
| 297 | mservice))) | ||
| 298 | %base-services))) | ||
| 299 | |||
| 300 | ;;; desktop.scm ends here | ||
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index f9d262d9772..102202c8533 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm | |||
| @@ -170,15 +170,33 @@ Protocol (DHCP) client, on all the non-loopback network interfaces." | |||
| 170 | ;; up*. However, the relevant interfaces are | 170 | ;; up*. However, the relevant interfaces are |
| 171 | ;; typically down at this point. Thus we perform our | 171 | ;; typically down at this point. Thus we perform our |
| 172 | ;; own interface discovery here. | 172 | ;; own interface discovery here. |
| 173 | (let* ((valid? (negate loopback-network-interface?)) | 173 | (define valid? |
| 174 | (ifaces (filter valid? | 174 | (negate loopback-network-interface?)) |
| 175 | (all-network-interfaces))) | 175 | (define ifaces |
| 176 | (pid (fork+exec-command | 176 | (filter valid? (all-network-interfaces))) |
| 177 | (cons* #$dhclient "-nw" | 177 | |
| 178 | "-pf" #$pid-file | 178 | ;; XXX: Make sure the interfaces are up so that |
| 179 | ifaces)))) | 179 | ;; 'dhclient' can actually send/receive over them. |
| 180 | (for-each set-network-interface-up ifaces) | ||
| 181 | |||
| 182 | (false-if-exception (delete-file #$pid-file)) | ||
| 183 | (let ((pid (fork+exec-command | ||
| 184 | (cons* #$dhclient "-nw" | ||
| 185 | "-pf" #$pid-file ifaces)))) | ||
| 180 | (and (zero? (cdr (waitpid pid))) | 186 | (and (zero? (cdr (waitpid pid))) |
| 181 | (call-with-input-file #$pid-file read))))) | 187 | (let loop () |
| 188 | (catch 'system-error | ||
| 189 | (lambda () | ||
| 190 | (call-with-input-file #$pid-file read)) | ||
| 191 | (lambda args | ||
| 192 | ;; 'dhclient' returned before PID-FILE | ||
| 193 | ;; was created, so try again. | ||
| 194 | (let ((errno (system-error-errno args))) | ||
| 195 | (if (= ENOENT errno) | ||
| 196 | (begin | ||
| 197 | (sleep 1) | ||
| 198 | (loop)) | ||
| 199 | (apply throw args)))))))))) | ||
| 182 | (stop #~(make-kill-destructor)))))) | 200 | (stop #~(make-kill-destructor)))))) |
| 183 | 201 | ||
| 184 | (define %ntp-servers | 202 | (define %ntp-servers |
diff --git a/gnu/services/upower.scm b/gnu/services/upower.scm deleted file mode 100644 index 3654c812f12..00000000000 --- a/gnu/services/upower.scm +++ /dev/null | |||
| @@ -1,122 +0,0 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu services upower) | ||
| 20 | #:use-module (gnu services) | ||
| 21 | #:use-module (gnu system shadow) | ||
| 22 | #:use-module (gnu packages gnome) | ||
| 23 | #:use-module (ice-9 match) | ||
| 24 | #:use-module (guix monads) | ||
| 25 | #:use-module (guix store) | ||
| 26 | #:use-module (guix gexp) | ||
| 27 | #:export (upower-service)) | ||
| 28 | |||
| 29 | ;;; Commentary: | ||
| 30 | ;;; | ||
| 31 | ;;; This module provides service definitions for the UPower power and battery | ||
| 32 | ;;; monitoring service. | ||
| 33 | ;;; | ||
| 34 | ;;; Code: | ||
| 35 | |||
| 36 | (define* (configuration-file #:key watts-up-pro? poll-batteries? ignore-lid? | ||
| 37 | use-percentage-for-policy? percentage-low | ||
| 38 | percentage-critical percentage-action | ||
| 39 | time-low time-critical time-action | ||
| 40 | critical-power-action) | ||
| 41 | "Return an upower-daemon configuration file." | ||
| 42 | (define (bool value) | ||
| 43 | (if value "true\n" "false\n")) | ||
| 44 | |||
| 45 | (text-file "UPower.conf" | ||
| 46 | (string-append | ||
| 47 | "[UPower]\n" | ||
| 48 | "EnableWattsUpPro=" (bool watts-up-pro?) | ||
| 49 | "NoPollBatteries=" (bool (not poll-batteries?)) | ||
| 50 | "IgnoreLid=" (bool ignore-lid?) | ||
| 51 | "UsePercentageForPolicy=" (bool use-percentage-for-policy?) | ||
| 52 | "PercentageLow=" (number->string percentage-low) "\n" | ||
| 53 | "PercentageCritical=" (number->string percentage-critical) "\n" | ||
| 54 | "PercentageAction=" (number->string percentage-action) "\n" | ||
| 55 | "TimeLow=" (number->string time-low) "\n" | ||
| 56 | "TimeCritical=" (number->string time-critical) "\n" | ||
| 57 | "TimeAction=" (number->string time-action) "\n" | ||
| 58 | "CriticalPowerAction=" (match critical-power-action | ||
| 59 | ('hybrid-sleep "HybridSleep") | ||
| 60 | ('hibernate "Hibernate") | ||
| 61 | ('power-off "PowerOff")) | ||
| 62 | "\n"))) | ||
| 63 | |||
| 64 | (define* (upower-service #:key (upower upower) | ||
| 65 | (watts-up-pro? #f) | ||
| 66 | (poll-batteries? #t) | ||
| 67 | (ignore-lid? #f) | ||
| 68 | (use-percentage-for-policy? #f) | ||
| 69 | (percentage-low 10) | ||
| 70 | (percentage-critical 3) | ||
| 71 | (percentage-action 2) | ||
| 72 | (time-low 1200) | ||
| 73 | (time-critical 300) | ||
| 74 | (time-action 120) | ||
| 75 | (critical-power-action 'hybrid-sleep)) | ||
| 76 | "Return a service that runs @uref{http://upower.freedesktop.org/, | ||
| 77 | @command{upowerd}}, a system-wide monitor for power consumption and battery | ||
| 78 | levels, with the given configuration settings. It implements the | ||
| 79 | @code{org.freedesktop.UPower} D-Bus interface, and is notably used by GNOME." | ||
| 80 | (mlet %store-monad ((config (configuration-file | ||
| 81 | #:watts-up-pro? watts-up-pro? | ||
| 82 | #:poll-batteries? poll-batteries? | ||
| 83 | #:ignore-lid? ignore-lid? | ||
| 84 | #:use-percentage-for-policy? use-percentage-for-policy? | ||
| 85 | #:percentage-low percentage-low | ||
| 86 | #:percentage-critical percentage-critical | ||
| 87 | #:percentage-action percentage-action | ||
| 88 | #:time-low time-low | ||
| 89 | #:time-critical time-critical | ||
| 90 | #:time-action time-action | ||
| 91 | #:critical-power-action critical-power-action))) | ||
| 92 | (return | ||
| 93 | (service | ||
| 94 | (documentation "Run the UPower power and battery monitor.") | ||
| 95 | (provision '(upower-daemon)) | ||
| 96 | (requirement '(dbus-system udev)) | ||
| 97 | |||
| 98 | (start #~(make-forkexec-constructor | ||
| 99 | (list (string-append #$upower "/libexec/upowerd")) | ||
| 100 | #:environment-variables | ||
| 101 | (list (string-append "UPOWER_CONF_FILE_NAME=" #$config)))) | ||
| 102 | (stop #~(make-kill-destructor)) | ||
| 103 | (activate #~(begin | ||
| 104 | (use-modules (guix build utils)) | ||
| 105 | (mkdir-p "/var/lib/upower") | ||
| 106 | (let ((user (getpwnam "upower"))) | ||
| 107 | (chown "/var/lib/upower" | ||
| 108 | (passwd:uid user) (passwd:gid user))))) | ||
| 109 | |||
| 110 | (user-groups (list (user-group | ||
| 111 | (name "upower") | ||
| 112 | (system? #t)))) | ||
| 113 | (user-accounts (list (user-account | ||
| 114 | (name "upower") | ||
| 115 | (group "upower") | ||
| 116 | (system? #t) | ||
| 117 | (comment "UPower daemon user") | ||
| 118 | (home-directory "/var/empty") | ||
| 119 | (shell | ||
| 120 | "/run/current-system/profile/sbin/nologin")))))))) | ||
| 121 | |||
| 122 | ;;; upower.scm ends here | ||
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index c687b46bc2c..9ee88170e4f 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm | |||
| @@ -37,7 +37,8 @@ | |||
| 37 | #:use-module (srfi srfi-1) | 37 | #:use-module (srfi srfi-1) |
| 38 | #:use-module (srfi srfi-26) | 38 | #:use-module (srfi srfi-26) |
| 39 | #:use-module (ice-9 match) | 39 | #:use-module (ice-9 match) |
| 40 | #:export (xorg-start-command | 40 | #:export (xorg-configuration-file |
| 41 | xorg-start-command | ||
| 41 | %default-slim-theme | 42 | %default-slim-theme |
| 42 | %default-slim-theme-name | 43 | %default-slim-theme-name |
| 43 | slim-service)) | 44 | slim-service)) |
| @@ -48,12 +49,10 @@ | |||
| 48 | ;;; | 49 | ;;; |
| 49 | ;;; Code: | 50 | ;;; Code: |
| 50 | 51 | ||
| 51 | (define* (xorg-start-command #:key | 52 | (define* (xorg-configuration-file #:key (drivers '()) (resolutions '()) |
| 52 | (guile (canonical-package guile-2.0)) | 53 | (extra-config '())) |
| 53 | (xorg-server xorg-server) | 54 | "Return a configuration file for the Xorg server containing search paths for |
| 54 | (drivers '()) (resolutions '())) | 55 | all the common drivers. |
| 55 | "Return a derivation that builds a @var{guile} script to start the X server | ||
| 56 | from @var{xorg-server}. Usually the X server is started by a login manager. | ||
| 57 | 56 | ||
| 58 | @var{drivers} must be either the empty list, in which case Xorg chooses a | 57 | @var{drivers} must be either the empty list, in which case Xorg chooses a |
| 59 | graphics driver automatically, or a list of driver names that will be tried in | 58 | graphics driver automatically, or a list of driver names that will be tried in |
| @@ -61,8 +60,11 @@ this order---e.g., @code{(\"modesetting\" \"vesa\")}. | |||
| 61 | 60 | ||
| 62 | Likewise, when @var{resolutions} is the empty list, Xorg chooses an | 61 | Likewise, when @var{resolutions} is the empty list, Xorg chooses an |
| 63 | appropriate screen resolution; otherwise, it must be a list of | 62 | appropriate screen resolution; otherwise, it must be a list of |
| 64 | resolutions---e.g., @code{((1024 768) (640 480))}." | 63 | resolutions---e.g., @code{((1024 768) (640 480))}. |
| 65 | 64 | ||
| 65 | Last, @var{extra-config} is a list of strings or objects appended to the | ||
| 66 | @code{text-file*} argument list. It is used to pass extra text to be added | ||
| 67 | verbatim to the configuration file." | ||
| 66 | (define (device-section driver) | 68 | (define (device-section driver) |
| 67 | (string-append " | 69 | (string-append " |
| 68 | Section \"Device\" | 70 | Section \"Device\" |
| @@ -78,15 +80,14 @@ Section \"Screen\" | |||
| 78 | SubSection \"Display\" | 80 | SubSection \"Display\" |
| 79 | Modes " | 81 | Modes " |
| 80 | (string-join (map (match-lambda | 82 | (string-join (map (match-lambda |
| 81 | ((x y) | 83 | ((x y) |
| 82 | (string-append "\"" (number->string x) | 84 | (string-append "\"" (number->string x) |
| 83 | "x" (number->string y) "\""))) | 85 | "x" (number->string y) "\""))) |
| 84 | resolutions)) " | 86 | resolutions)) " |
| 85 | EndSubSection | 87 | EndSubSection |
| 86 | EndSection")) | 88 | EndSection")) |
| 87 | 89 | ||
| 88 | (define (xserver.conf) | 90 | (apply text-file* "xserver.conf" " |
| 89 | (text-file* "xserver.conf" " | ||
| 90 | Section \"Files\" | 91 | Section \"Files\" |
| 91 | FontPath \"" font-adobe75dpi "/share/fonts/X11/75dpi\" | 92 | FontPath \"" font-adobe75dpi "/share/fonts/X11/75dpi\" |
| 92 | ModulePath \"" xf86-video-vesa "/lib/xorg/modules/drivers\" | 93 | ModulePath \"" xf86-video-vesa "/lib/xorg/modules/drivers\" |
| @@ -98,6 +99,12 @@ Section \"Files\" | |||
| 98 | ModulePath \"" xf86-video-nouveau "/lib/xorg/modules/drivers\" | 99 | ModulePath \"" xf86-video-nouveau "/lib/xorg/modules/drivers\" |
| 99 | ModulePath \"" xf86-video-nv "/lib/xorg/modules/drivers\" | 100 | ModulePath \"" xf86-video-nv "/lib/xorg/modules/drivers\" |
| 100 | ModulePath \"" xf86-video-sis "/lib/xorg/modules/drivers\" | 101 | ModulePath \"" xf86-video-sis "/lib/xorg/modules/drivers\" |
| 102 | |||
| 103 | # Libinput is the new thing and is recommended over evdev/synaptics | ||
| 104 | # by those who know: | ||
| 105 | # <http://who-t.blogspot.fr/2015/01/xf86-input-libinput-compatibility-with.html>. | ||
| 106 | ModulePath \"" xf86-input-libinput "/lib/xorg/modules/input\" | ||
| 107 | |||
| 101 | ModulePath \"" xf86-input-evdev "/lib/xorg/modules/input\" | 108 | ModulePath \"" xf86-input-evdev "/lib/xorg/modules/input\" |
| 102 | ModulePath \"" xf86-input-keyboard "/lib/xorg/modules/input\" | 109 | ModulePath \"" xf86-input-keyboard "/lib/xorg/modules/input\" |
| 103 | ModulePath \"" xf86-input-mouse "/lib/xorg/modules/input\" | 110 | ModulePath \"" xf86-input-mouse "/lib/xorg/modules/input\" |
| @@ -111,12 +118,27 @@ Section \"ServerFlags\" | |||
| 111 | Option \"AllowMouseOpenFail\" \"on\" | 118 | Option \"AllowMouseOpenFail\" \"on\" |
| 112 | EndSection | 119 | EndSection |
| 113 | " | 120 | " |
| 114 | (string-join (map device-section drivers) "\n") | 121 | (string-join (map device-section drivers) "\n") "\n" |
| 115 | (string-join (map (cut screen-section <> resolutions) | 122 | (string-join (map (cut screen-section <> resolutions) |
| 116 | drivers) | 123 | drivers) |
| 117 | "\n"))) | 124 | "\n") |
| 125 | |||
| 126 | "\n" | ||
| 127 | extra-config)) | ||
| 118 | 128 | ||
| 119 | (mlet %store-monad ((config (xserver.conf))) | 129 | (define* (xorg-start-command #:key |
| 130 | (guile (canonical-package guile-2.0)) | ||
| 131 | configuration-file | ||
| 132 | (xorg-server xorg-server)) | ||
| 133 | "Return a derivation that builds a @var{guile} script to start the X server | ||
| 134 | from @var{xorg-server}. @var{configuration-file} is the server configuration | ||
| 135 | file or a derivation that builds it; when omitted, the result of | ||
| 136 | @code{xorg-configuration-file} is used. | ||
| 137 | |||
| 138 | Usually the X server is started by a login manager." | ||
| 139 | (mlet %store-monad ((config (if configuration-file | ||
| 140 | (return configuration-file) | ||
| 141 | (xorg-configuration-file)))) | ||
| 120 | (define script | 142 | (define script |
| 121 | ;; Write a small wrapper around the X server. | 143 | ;; Write a small wrapper around the X server. |
| 122 | #~(begin | 144 | #~(begin |
| @@ -192,7 +214,7 @@ which should be passed to this script as the first argument. If not, the | |||
| 192 | (define %default-slim-theme-name | 214 | (define %default-slim-theme-name |
| 193 | ;; This must be the name of the sub-directory in %DEFAULT-SLIM-THEME that | 215 | ;; This must be the name of the sub-directory in %DEFAULT-SLIM-THEME that |
| 194 | ;; contains the actual theme files. | 216 | ;; contains the actual theme files. |
| 195 | "0.8") | 217 | "0.x") |
| 196 | 218 | ||
| 197 | (define* (slim-service #:key (slim slim) | 219 | (define* (slim-service #:key (slim slim) |
| 198 | (allow-empty-passwords? #t) auto-login? | 220 | (allow-empty-passwords? #t) auto-login? |
| @@ -207,6 +229,19 @@ which should be passed to this script as the first argument. If not, the | |||
| 207 | turn starts the X display server with @var{startx}, a command as returned by | 229 | turn starts the X display server with @var{startx}, a command as returned by |
| 208 | @code{xorg-start-command}. | 230 | @code{xorg-start-command}. |
| 209 | 231 | ||
| 232 | @cindex X session | ||
| 233 | |||
| 234 | SLiM automatically looks for session types described by the @file{.desktop} | ||
| 235 | files in @file{/run/current-system/profile/share/xsessions} and allows users | ||
| 236 | to choose a session from the log-in screen using @kbd{F1}. Packages such as | ||
| 237 | @var{xfce}, @var{sawfish}, and @var{ratpoison} provide @file{.desktop} files; | ||
| 238 | adding them to the system-wide set of packages automatically makes them | ||
| 239 | available at the log-in screen. | ||
| 240 | |||
| 241 | In addition, @file{~/.xsession} files are honored. When available, | ||
| 242 | @file{~/.xsession} must be an executable that starts a window manager | ||
| 243 | and/or other X clients. | ||
| 244 | |||
| 210 | When @var{allow-empty-passwords?} is true, allow logins with an empty | 245 | When @var{allow-empty-passwords?} is true, allow logins with an empty |
| 211 | password. When @var{auto-login?} is true, log in automatically as | 246 | password. When @var{auto-login?} is true, log in automatically as |
| 212 | @var{default-user} with @var{auto-login-session}. | 247 | @var{default-user} with @var{auto-login-session}. |
| @@ -217,7 +252,9 @@ theme to use. In that case, @var{theme-name} specifies the name of the | |||
| 217 | theme." | 252 | theme." |
| 218 | 253 | ||
| 219 | (define (slim.cfg) | 254 | (define (slim.cfg) |
| 220 | (mlet %store-monad ((startx (or startx (xorg-start-command))) | 255 | (mlet %store-monad ((startx (if startx |
| 256 | (return startx) | ||
| 257 | (xorg-start-command))) | ||
| 221 | (xinitrc (xinitrc #:fallback-session | 258 | (xinitrc (xinitrc #:fallback-session |
| 222 | auto-login-session))) | 259 | auto-login-session))) |
| 223 | (text-file* "slim.cfg" " | 260 | (text-file* "slim.cfg" " |
diff --git a/gnu/system.scm b/gnu/system.scm index 609604a9b52..92ed454b2c0 100644 --- a/gnu/system.scm +++ b/gnu/system.scm | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #:use-module (guix packages) | 25 | #:use-module (guix packages) |
| 26 | #:use-module (guix derivations) | 26 | #:use-module (guix derivations) |
| 27 | #:use-module (guix profiles) | 27 | #:use-module (guix profiles) |
| 28 | #:use-module (guix ui) | ||
| 28 | #:use-module (gnu packages base) | 29 | #:use-module (gnu packages base) |
| 29 | #:use-module (gnu packages bash) | 30 | #:use-module (gnu packages bash) |
| 30 | #:use-module (gnu packages guile) | 31 | #:use-module (gnu packages guile) |
| @@ -109,7 +110,7 @@ | |||
| 109 | (default %base-firmware)) | 110 | (default %base-firmware)) |
| 110 | 111 | ||
| 111 | (host-name operating-system-host-name) ; string | 112 | (host-name operating-system-host-name) ; string |
| 112 | (hosts-file operating-system-hosts-file ; M item | #f | 113 | (hosts-file operating-system-hosts-file ; file-like | #f |
| 113 | (default #f)) | 114 | (default #f)) |
| 114 | 115 | ||
| 115 | (mapped-devices operating-system-mapped-devices ; list of <mapped-device> | 116 | (mapped-devices operating-system-mapped-devices ; list of <mapped-device> |
| @@ -119,7 +120,7 @@ | |||
| 119 | (default '())) | 120 | (default '())) |
| 120 | 121 | ||
| 121 | (users operating-system-users ; list of user accounts | 122 | (users operating-system-users ; list of user accounts |
| 122 | (default '())) | 123 | (default %base-user-accounts)) |
| 123 | (groups operating-system-groups ; list of user groups | 124 | (groups operating-system-groups ; list of user groups |
| 124 | (default %base-groups)) | 125 | (default %base-groups)) |
| 125 | 126 | ||
| @@ -147,7 +148,7 @@ | |||
| 147 | (setuid-programs operating-system-setuid-programs | 148 | (setuid-programs operating-system-setuid-programs |
| 148 | (default %setuid-programs)) ; list of string-valued gexps | 149 | (default %setuid-programs)) ; list of string-valued gexps |
| 149 | 150 | ||
| 150 | (sudoers operating-system-sudoers ; /etc/sudoers contents | 151 | (sudoers operating-system-sudoers ; file-like |
| 151 | (default %sudoers-specification))) | 152 | (default %sudoers-specification))) |
| 152 | 153 | ||
| 153 | 154 | ||
| @@ -373,7 +374,7 @@ This is the GNU system. Welcome.\n") | |||
| 373 | 374 | ||
| 374 | (define (default-/etc/hosts host-name) | 375 | (define (default-/etc/hosts host-name) |
| 375 | "Return the default /etc/hosts file." | 376 | "Return the default /etc/hosts file." |
| 376 | (text-file "hosts" (local-host-aliases host-name))) | 377 | (plain-file "hosts" (local-host-aliases host-name))) |
| 377 | 378 | ||
| 378 | (define (emacs-site-file) | 379 | (define (emacs-site-file) |
| 379 | "Return the Emacs 'site-start.el' file. That file contains the necessary | 380 | "Return the Emacs 'site-start.el' file. That file contains the necessary |
| @@ -439,11 +440,10 @@ on SHELLS. /etc/shells is used by xterm, polkit, and other programs." | |||
| 439 | (pam-services '()) | 440 | (pam-services '()) |
| 440 | (profile "/run/current-system/profile") | 441 | (profile "/run/current-system/profile") |
| 441 | hosts-file nss (shells '()) | 442 | hosts-file nss (shells '()) |
| 442 | (sudoers "")) | 443 | (sudoers (plain-file "sudoers" ""))) |
| 443 | "Return a derivation that builds the static part of the /etc directory." | 444 | "Return a derivation that builds the static part of the /etc directory." |
| 444 | (mlet* %store-monad | 445 | (mlet* %store-monad |
| 445 | ((pam.d (pam-services->directory pam-services)) | 446 | ((pam.d (pam-services->directory pam-services)) |
| 446 | (sudoers (text-file "sudoers" sudoers)) | ||
| 447 | (login.defs (text-file "login.defs" "# Empty for now.\n")) | 447 | (login.defs (text-file "login.defs" "# Empty for now.\n")) |
| 448 | (shells (shells-file shells)) | 448 | (shells (shells-file shells)) |
| 449 | (emacs (emacs-site-directory)) | 449 | (emacs (emacs-site-directory)) |
| @@ -461,14 +461,40 @@ export TZDIR=\"" tzdata "/share/zoneinfo\" | |||
| 461 | # Tell 'modprobe' & co. where to look for modules. | 461 | # Tell 'modprobe' & co. where to look for modules. |
| 462 | export LINUX_MODULE_DIRECTORY=/run/booted-system/kernel/lib/modules | 462 | export LINUX_MODULE_DIRECTORY=/run/booted-system/kernel/lib/modules |
| 463 | 463 | ||
| 464 | export PATH=$HOME/.guix-profile/bin:/run/current-system/profile/bin | 464 | # These variables are honored by OpenSSL (libssl) and Git. |
| 465 | export PATH=/run/setuid-programs:/run/current-system/profile/sbin:$PATH | 465 | export SSL_CERT_DIR=/etc/ssl/certs |
| 466 | export SSL_CERT_FILE=\"$SSL_CERT_DIR/ca-certificates.crt\" | ||
| 467 | export GIT_SSL_CAINFO=\"$SSL_CERT_FILE\" | ||
| 468 | |||
| 469 | # Crucial variables that could be missing the the profiles' 'etc/profile' | ||
| 470 | # because they would require combining both profiles. | ||
| 471 | # FIXME: See <http://bugs.gnu.org/20255>. | ||
| 466 | export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man | 472 | export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man |
| 467 | export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info | 473 | export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info |
| 468 | |||
| 469 | export XDG_DATA_DIRS=$HOME/.guix-profile/share:/run/current-system/profile/share | 474 | export XDG_DATA_DIRS=$HOME/.guix-profile/share:/run/current-system/profile/share |
| 470 | export XDG_CONFIG_DIRS=$HOME/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg | 475 | export XDG_CONFIG_DIRS=$HOME/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg |
| 471 | 476 | ||
| 477 | # Ignore the default value of 'PATH'. | ||
| 478 | unset PATH | ||
| 479 | |||
| 480 | # Load the system profile's settings. | ||
| 481 | GUIX_PROFILE=/run/current-system/profile \\ | ||
| 482 | . /run/current-system/profile/etc/profile | ||
| 483 | |||
| 484 | # Prepend setuid programs. | ||
| 485 | export PATH=/run/setuid-programs:$PATH | ||
| 486 | |||
| 487 | if [ -f \"$HOME/.guix-profile/etc/profile\" ] | ||
| 488 | then | ||
| 489 | # Load the user profile's settings. | ||
| 490 | GUIX_PROFILE=\"$HOME/.guix-profile\" \\ | ||
| 491 | . \"$HOME/.guix-profile/etc/profile\" | ||
| 492 | else | ||
| 493 | # At least define this one so that basic things just work | ||
| 494 | # when the user installs their first package. | ||
| 495 | export PATH=\"$HOME/.guix-profile/bin:$PATH\" | ||
| 496 | fi | ||
| 497 | |||
| 472 | # Append the directory of 'site-start.el' to the search path. | 498 | # Append the directory of 'site-start.el' to the search path. |
| 473 | export EMACSLOADPATH=:/etc/emacs | 499 | export EMACSLOADPATH=:/etc/emacs |
| 474 | 500 | ||
| @@ -476,18 +502,13 @@ export EMACSLOADPATH=:/etc/emacs | |||
| 476 | # when /etc/machine-id is missing. Make sure these warnings are non-fatal. | 502 | # when /etc/machine-id is missing. Make sure these warnings are non-fatal. |
| 477 | export DBUS_FATAL_WARNINGS=0 | 503 | export DBUS_FATAL_WARNINGS=0 |
| 478 | 504 | ||
| 479 | # These variables are honored by OpenSSL (libssl) and Git. | ||
| 480 | export SSL_CERT_DIR=/etc/ssl/certs | ||
| 481 | export SSL_CERT_FILE=\"$SSL_CERT_DIR/ca-certificates.crt\" | ||
| 482 | export GIT_SSL_CAINFO=\"$SSL_CERT_FILE\" | ||
| 483 | |||
| 484 | # Allow Aspell to find dictionaries installed in the user profile. | 505 | # Allow Aspell to find dictionaries installed in the user profile. |
| 485 | export ASPELL_CONF=\"dict-dir $HOME/.guix-profile/lib/aspell\" | 506 | export ASPELL_CONF=\"dict-dir $HOME/.guix-profile/lib/aspell\" |
| 486 | 507 | ||
| 487 | if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ] | 508 | if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ] |
| 488 | then | 509 | then |
| 489 | # Load Bash-specific initialization code. | 510 | # Load Bash-specific initialization code. |
| 490 | source /etc/bashrc | 511 | . /etc/bashrc |
| 491 | fi | 512 | fi |
| 492 | ")) | 513 | ")) |
| 493 | 514 | ||
| @@ -519,7 +540,7 @@ fi\n")) | |||
| 519 | ("hosts" ,#~#$hosts-file) | 540 | ("hosts" ,#~#$hosts-file) |
| 520 | ("localtime" ,#~(string-append #$tzdata "/share/zoneinfo/" | 541 | ("localtime" ,#~(string-append #$tzdata "/share/zoneinfo/" |
| 521 | #$timezone)) | 542 | #$timezone)) |
| 522 | ("sudoers" ,#~#$sudoers))))) | 543 | ("sudoers" ,sudoers))))) |
| 523 | 544 | ||
| 524 | (define (operating-system-profile os) | 545 | (define (operating-system-profile os) |
| 525 | "Return a derivation that builds the system profile of OS." | 546 | "Return a derivation that builds the system profile of OS." |
| @@ -549,6 +570,37 @@ fi\n")) | |||
| 549 | (return (append users | 570 | (return (append users |
| 550 | (append-map service-user-accounts services))))) | 571 | (append-map service-user-accounts services))))) |
| 551 | 572 | ||
| 573 | (define (maybe-string->file file-name thing) | ||
| 574 | "If THING is a string, return a <plain-file> with THING as its content. | ||
| 575 | Otherwise just return THING. | ||
| 576 | |||
| 577 | This is for backward-compatibility of fields that used to be strings and are | ||
| 578 | now file-like objects.." | ||
| 579 | (match thing | ||
| 580 | ((? string?) | ||
| 581 | (warning (_ "using a string for file '~a' is deprecated; \ | ||
| 582 | use 'plain-file' instead~%") | ||
| 583 | file-name) | ||
| 584 | (plain-file file-name thing)) | ||
| 585 | (x | ||
| 586 | x))) | ||
| 587 | |||
| 588 | (define (maybe-file->monadic file-name thing) | ||
| 589 | "If THING is a value in %STORE-MONAD, return it as is; otherwise return | ||
| 590 | THING in the %STORE-MONAD. | ||
| 591 | |||
| 592 | This is for backward-compatibility of fields that used to be monadic values | ||
| 593 | and are now file-like objects." | ||
| 594 | (with-monad %store-monad | ||
| 595 | (match thing | ||
| 596 | ((? procedure?) | ||
| 597 | (warning (_ "using a monadic value for '~a' is deprecated; \ | ||
| 598 | use 'plain-file' instead~%") | ||
| 599 | file-name) | ||
| 600 | thing) | ||
| 601 | (x | ||
| 602 | (return x))))) | ||
| 603 | |||
| 552 | (define (operating-system-etc-directory os) | 604 | (define (operating-system-etc-directory os) |
| 553 | "Return that static part of the /etc directory of OS." | 605 | "Return that static part of the /etc directory of OS." |
| 554 | (mlet* %store-monad | 606 | (mlet* %store-monad |
| @@ -559,8 +611,10 @@ fi\n")) | |||
| 559 | (append-map service-pam-services services))) | 611 | (append-map service-pam-services services))) |
| 560 | (profile-drv (operating-system-profile os)) | 612 | (profile-drv (operating-system-profile os)) |
| 561 | (skeletons (operating-system-skeletons os)) | 613 | (skeletons (operating-system-skeletons os)) |
| 562 | (/etc/hosts (or (operating-system-hosts-file os) | 614 | (/etc/hosts (maybe-file->monadic |
| 563 | (default-/etc/hosts (operating-system-host-name os)))) | 615 | "hosts" |
| 616 | (or (operating-system-hosts-file os) | ||
| 617 | (default-/etc/hosts (operating-system-host-name os))))) | ||
| 564 | (shells (user-shells os))) | 618 | (shells (user-shells os))) |
| 565 | (etc-directory #:pam-services pam-services | 619 | (etc-directory #:pam-services pam-services |
| 566 | #:skeletons skeletons | 620 | #:skeletons skeletons |
| @@ -570,7 +624,9 @@ fi\n")) | |||
| 570 | #:timezone (operating-system-timezone os) | 624 | #:timezone (operating-system-timezone os) |
| 571 | #:hosts-file /etc/hosts | 625 | #:hosts-file /etc/hosts |
| 572 | #:shells shells | 626 | #:shells shells |
| 573 | #:sudoers (operating-system-sudoers os) | 627 | #:sudoers (maybe-string->file |
| 628 | "sudoers" | ||
| 629 | (operating-system-sudoers os)) | ||
| 574 | #:profile profile-drv))) | 630 | #:profile profile-drv))) |
| 575 | 631 | ||
| 576 | (define %setuid-programs | 632 | (define %setuid-programs |
| @@ -587,8 +643,9 @@ fi\n")) | |||
| 587 | ;; group can do anything. See | 643 | ;; group can do anything. See |
| 588 | ;; <http://www.sudo.ws/sudo/man/1.8.10/sudoers.man.html>. | 644 | ;; <http://www.sudo.ws/sudo/man/1.8.10/sudoers.man.html>. |
| 589 | ;; TODO: Add a declarative API. | 645 | ;; TODO: Add a declarative API. |
| 590 | "root ALL=(ALL) ALL | 646 | (plain-file "sudoers" "\ |
| 591 | %wheel ALL=(ALL) ALL\n") | 647 | root ALL=(ALL) ALL |
| 648 | %wheel ALL=(ALL) ALL\n")) | ||
| 592 | 649 | ||
| 593 | (define (user-group->gexp group) | 650 | (define (user-group->gexp group) |
| 594 | "Turn GROUP, a <user-group> object, into a list-valued gexp suitable for | 651 | "Turn GROUP, a <user-group> object, into a list-valued gexp suitable for |
| @@ -665,6 +722,8 @@ etc." | |||
| 665 | (define group-specs | 722 | (define group-specs |
| 666 | (map user-group->gexp groups)) | 723 | (map user-group->gexp groups)) |
| 667 | 724 | ||
| 725 | (assert-valid-users/groups accounts groups) | ||
| 726 | |||
| 668 | (gexp->file "activate" | 727 | (gexp->file "activate" |
| 669 | #~(begin | 728 | #~(begin |
| 670 | (eval-when (expand load eval) | 729 | (eval-when (expand load eval) |
diff --git a/gnu/system/os-config.tmpl b/gnu/system/examples/bare-bones.tmpl index e14c95733af..dc5cfc81a43 100644 --- a/gnu/system/os-config.tmpl +++ b/gnu/system/examples/bare-bones.tmpl | |||
| @@ -1,12 +1,13 @@ | |||
| 1 | ;; This is an operating system configuration template. | 1 | ;; This is an operating system configuration template |
| 2 | ;; for a "bare bones" setup, with no X11 display server. | ||
| 2 | 3 | ||
| 3 | (use-modules (gnu)) | 4 | (use-modules (gnu)) |
| 4 | (use-service-modules xorg networking dbus avahi) | 5 | (use-service-modules networking ssh) |
| 5 | (use-package-modules xorg avahi) | 6 | (use-package-modules admin) |
| 6 | 7 | ||
| 7 | (operating-system | 8 | (operating-system |
| 8 | (host-name "antelope") | 9 | (host-name "komputilo") |
| 9 | (timezone "Europe/Paris") | 10 | (timezone "Europe/Berlin") |
| 10 | (locale "en_US.UTF-8") | 11 | (locale "en_US.UTF-8") |
| 11 | 12 | ||
| 12 | ;; Assuming /dev/sdX is the target hard disk, and "root" is | 13 | ;; Assuming /dev/sdX is the target hard disk, and "root" is |
| @@ -22,7 +23,7 @@ | |||
| 22 | ;; This is where user accounts are specified. The "root" | 23 | ;; This is where user accounts are specified. The "root" |
| 23 | ;; account is implicit, and is initially created with the | 24 | ;; account is implicit, and is initially created with the |
| 24 | ;; empty password. | 25 | ;; empty password. |
| 25 | (users (list (user-account | 26 | (users (cons (user-account |
| 26 | (name "alice") | 27 | (name "alice") |
| 27 | (comment "Bob's sister") | 28 | (comment "Bob's sister") |
| 28 | (group "users") | 29 | (group "users") |
| @@ -33,15 +34,14 @@ | |||
| 33 | ;; and access the webcam. | 34 | ;; and access the webcam. |
| 34 | (supplementary-groups '("wheel" | 35 | (supplementary-groups '("wheel" |
| 35 | "audio" "video")) | 36 | "audio" "video")) |
| 36 | (home-directory "/home/alice")))) | 37 | (home-directory "/home/alice")) |
| 38 | %base-user-accounts)) | ||
| 37 | 39 | ||
| 38 | ;; Globally-installed packages. | 40 | ;; Globally-installed packages. |
| 39 | (packages (cons xterm %base-packages)) | 41 | (packages (cons tcpdump %base-packages)) |
| 40 | 42 | ||
| 41 | ;; Add services to the baseline: the SLiM log-in manager | 43 | ;; Add services to the baseline: a DHCP client and |
| 42 | ;; for Xorg sessions, a DHCP client, Avahi, and D-Bus. | 44 | ;; an SSH server. |
| 43 | (services (cons* (slim-service) | 45 | (services (cons* (dhcp-client-service) |
| 44 | (dhcp-client-service) | 46 | (lsh-service #:port-number 2222) |
| 45 | (avahi-service) | ||
| 46 | (dbus-service (list avahi)) | ||
| 47 | %base-services))) | 47 | %base-services))) |
diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl new file mode 100644 index 00000000000..988b8f937f8 --- /dev/null +++ b/gnu/system/examples/desktop.tmpl | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | ;; This is an operating system configuration template | ||
| 2 | ;; for a "desktop" setup with X11. | ||
| 3 | |||
| 4 | (use-modules (gnu) (gnu system nss)) | ||
| 5 | (use-service-modules desktop) | ||
| 6 | (use-package-modules xfce ratpoison wicd avahi xorg certs) | ||
| 7 | |||
| 8 | (operating-system | ||
| 9 | (host-name "antelope") | ||
| 10 | (timezone "Europe/Paris") | ||
| 11 | (locale "en_US.UTF-8") | ||
| 12 | |||
| 13 | ;; Assuming /dev/sdX is the target hard disk, and "root" is | ||
| 14 | ;; the label of the target root file system. | ||
| 15 | (bootloader (grub-configuration (device "/dev/sdX"))) | ||
| 16 | (file-systems (cons (file-system | ||
| 17 | (device "root") | ||
| 18 | (title 'label) | ||
| 19 | (mount-point "/") | ||
| 20 | (type "ext4")) | ||
| 21 | %base-file-systems)) | ||
| 22 | |||
| 23 | (users (cons (user-account | ||
| 24 | (name "bob") | ||
| 25 | (comment "Alice's brother") | ||
| 26 | (group "users") | ||
| 27 | (supplementary-groups '("wheel" "netdev" | ||
| 28 | "audio" "video")) | ||
| 29 | (home-directory "/home/bob")) | ||
| 30 | %base-user-accounts)) | ||
| 31 | |||
| 32 | ;; Add Xfce and Ratpoison; that allows us to choose | ||
| 33 | ;; sessions using either of these at the log-in screen. | ||
| 34 | (packages (cons* xfce ratpoison ;desktop environments | ||
| 35 | xterm wicd avahi ;useful tools | ||
| 36 | nss-certs ;for HTTPS access | ||
| 37 | %base-packages)) | ||
| 38 | |||
| 39 | ;; Use the "desktop" services, which include the X11 | ||
| 40 | ;; log-in service, networking with Wicd, and more. | ||
| 41 | (services %desktop-services) | ||
| 42 | |||
| 43 | ;; Allow resolution of '.local' host names with mDNS. | ||
| 44 | (name-service-switch %mdns-host-lookup-nss)) | ||
diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm index 17b08aa9b71..e49b6dbe54c 100644 --- a/gnu/system/grub.scm +++ b/gnu/system/grub.scm | |||
| @@ -80,7 +80,8 @@ | |||
| 80 | (define %background-image | 80 | (define %background-image |
| 81 | (grub-image | 81 | (grub-image |
| 82 | (aspect-ratio 4/3) | 82 | (aspect-ratio 4/3) |
| 83 | (file #~(string-append #$%artwork-repository "/grub/GuixSD-4-3.svg")))) | 83 | (file #~(string-append #$%artwork-repository |
| 84 | "/grub/GuixSD-fully-black-4-3.svg")))) | ||
| 84 | 85 | ||
| 85 | (define %default-theme | 86 | (define %default-theme |
| 86 | ;; Default theme contributed by Felipe López. | 87 | ;; Default theme contributed by Felipe López. |
diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 2fd35e8c48d..27d8ecdefc1 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -24,6 +25,7 @@ | |||
| 24 | #:use-module ((guix store) #:select (%store-prefix)) | 25 | #:use-module ((guix store) #:select (%store-prefix)) |
| 25 | #:use-module (guix profiles) | 26 | #:use-module (guix profiles) |
| 26 | #:use-module (gnu packages admin) | 27 | #:use-module (gnu packages admin) |
| 28 | #:use-module (gnu packages bash) | ||
| 27 | #:use-module (gnu packages linux) | 29 | #:use-module (gnu packages linux) |
| 28 | #:use-module (gnu packages cryptsetup) | 30 | #:use-module (gnu packages cryptsetup) |
| 29 | #:use-module (gnu packages package-management) | 31 | #:use-module (gnu packages package-management) |
| @@ -31,6 +33,8 @@ | |||
| 31 | #:use-module (gnu packages grub) | 33 | #:use-module (gnu packages grub) |
| 32 | #:use-module (gnu packages texinfo) | 34 | #:use-module (gnu packages texinfo) |
| 33 | #:use-module (gnu packages compression) | 35 | #:use-module (gnu packages compression) |
| 36 | #:use-module (ice-9 match) | ||
| 37 | #:use-module (srfi srfi-26) | ||
| 34 | #:export (self-contained-tarball | 38 | #:export (self-contained-tarball |
| 35 | installation-os)) | 39 | installation-os)) |
| 36 | 40 | ||
| @@ -67,7 +71,16 @@ under /root/.guix-profile where GUIX is installed." | |||
| 67 | ;; length limitation. | 71 | ;; length limitation. |
| 68 | (with-directory-excursion %root | 72 | (with-directory-excursion %root |
| 69 | (zero? (system* "tar" "--xz" "--format=gnu" | 73 | (zero? (system* "tar" "--xz" "--format=gnu" |
| 70 | "-cvf" #$output "."))))) | 74 | "--owner=root:0" "--group=root:0" |
| 75 | "-cvf" #$output | ||
| 76 | ;; Avoid adding / and /var to the tarball, | ||
| 77 | ;; so that the ownership and permissions of those | ||
| 78 | ;; directories will not be overwritten when | ||
| 79 | ;; extracting the archive. Do not include /root | ||
| 80 | ;; because the root account might have a different | ||
| 81 | ;; home directory. | ||
| 82 | "./var/guix" | ||
| 83 | (string-append "." (%store-directory))))))) | ||
| 71 | 84 | ||
| 72 | (gexp->derivation "guix-tarball.tar.xz" build | 85 | (gexp->derivation "guix-tarball.tar.xz" build |
| 73 | #:references-graphs `(("profile" ,profile)) | 86 | #:references-graphs `(("profile" ,profile)) |
| @@ -171,12 +184,17 @@ the given target.") | |||
| 171 | "Return a dummy service whose purpose is to install an operating system | 184 | "Return a dummy service whose purpose is to install an operating system |
| 172 | configuration template file in the installation system." | 185 | configuration template file in the installation system." |
| 173 | 186 | ||
| 174 | (define local-template | 187 | (define search |
| 175 | "/etc/configuration-template.scm") | 188 | (cut search-path %load-path <>)) |
| 176 | (define template | 189 | (define templates |
| 177 | (search-path %load-path "gnu/system/os-config.tmpl")) | 190 | (map (match-lambda |
| 191 | ((file '-> target) | ||
| 192 | (list (local-file (search file)) | ||
| 193 | (string-append "/etc/configuration/" target)))) | ||
| 194 | '(("gnu/system/examples/bare-bones.tmpl" -> "bare-bones.scm") | ||
| 195 | ("gnu/system/examples/desktop.tmpl" -> "desktop.scm")))) | ||
| 178 | 196 | ||
| 179 | (mlet %store-monad ((template (interned-file template))) | 197 | (with-monad %store-monad |
| 180 | (return (service | 198 | (return (service |
| 181 | (requirement '(root-file-system)) | 199 | (requirement '(root-file-system)) |
| 182 | (provision '(os-config-template)) | 200 | (provision '(os-config-template)) |
| @@ -185,8 +203,16 @@ configuration template file in the installation system." | |||
| 185 | (start #~(const #t)) | 203 | (start #~(const #t)) |
| 186 | (stop #~(const #f)) | 204 | (stop #~(const #f)) |
| 187 | (activate | 205 | (activate |
| 188 | #~(unless (file-exists? #$local-template) | 206 | #~(begin |
| 189 | (copy-file #$template #$local-template))))))) | 207 | (use-modules (ice-9 match) |
| 208 | (guix build utils)) | ||
| 209 | |||
| 210 | (mkdir-p "/etc/configuration") | ||
| 211 | (for-each (match-lambda | ||
| 212 | ((file target) | ||
| 213 | (unless (file-exists? target) | ||
| 214 | (copy-file file target)))) | ||
| 215 | '#$templates))))))) | ||
| 190 | 216 | ||
| 191 | (define %nscd-minimal-caches | 217 | (define %nscd-minimal-caches |
| 192 | ;; Minimal in-memory caching policy for nscd. | 218 | ;; Minimal in-memory caching policy for nscd. |
| @@ -316,6 +342,7 @@ Use Alt-F2 for documentation. | |||
| 316 | ;; 2.0.0a, that pulls Guile 1.8, which takes unreasonable | 342 | ;; 2.0.0a, that pulls Guile 1.8, which takes unreasonable |
| 317 | ;; space; furthermore util-linux's fdisk is already | 343 | ;; space; furthermore util-linux's fdisk is already |
| 318 | ;; available here, so we keep that. | 344 | ;; available here, so we keep that. |
| 345 | bash-completion | ||
| 319 | %base-packages)))) | 346 | %base-packages)))) |
| 320 | 347 | ||
| 321 | ;; Return it here so 'guix system' can consume it directly. | 348 | ;; Return it here so 'guix system' can consume it directly. |
diff --git a/gnu/system/nss.scm b/gnu/system/nss.scm index ec2d2517e78..f4d28552899 100644 --- a/gnu/system/nss.scm +++ b/gnu/system/nss.scm | |||
| @@ -29,6 +29,8 @@ | |||
| 29 | lookup-specification | 29 | lookup-specification |
| 30 | 30 | ||
| 31 | %default-nss | 31 | %default-nss |
| 32 | %mdns-host-lookup-nss | ||
| 33 | |||
| 32 | %files | 34 | %files |
| 33 | %compat | 35 | %compat |
| 34 | %dns | 36 | %dns |
| @@ -148,6 +150,27 @@ | |||
| 148 | ;; Default NSS configuration. | 150 | ;; Default NSS configuration. |
| 149 | (name-service-switch)) | 151 | (name-service-switch)) |
| 150 | 152 | ||
| 153 | (define %mdns-host-lookup-nss | ||
| 154 | (name-service-switch | ||
| 155 | (hosts (list %files ;first, check /etc/hosts | ||
| 156 | |||
| 157 | ;; If the above did not succeed, try with 'mdns_minimal'. | ||
| 158 | (name-service | ||
| 159 | (name "mdns_minimal") | ||
| 160 | |||
| 161 | ;; 'mdns_minimal' is authoritative for '.local'. When it | ||
| 162 | ;; returns "not found", no need to try the next methods. | ||
| 163 | (reaction (lookup-specification | ||
| 164 | (not-found => return)))) | ||
| 165 | |||
| 166 | ;; Then fall back to DNS. | ||
| 167 | (name-service | ||
| 168 | (name "dns")) | ||
| 169 | |||
| 170 | ;; Finally, try with the "full" 'mdns'. | ||
| 171 | (name-service | ||
| 172 | (name "mdns")))))) | ||
| 173 | |||
| 151 | 174 | ||
| 152 | ;;; | 175 | ;;; |
| 153 | ;;; Serialization. | 176 | ;;; Serialization. |
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 16b9e4b555c..aa976526787 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm | |||
| @@ -21,12 +21,17 @@ | |||
| 21 | #:use-module (guix gexp) | 21 | #:use-module (guix gexp) |
| 22 | #:use-module (guix store) | 22 | #:use-module (guix store) |
| 23 | #:use-module (guix monads) | 23 | #:use-module (guix monads) |
| 24 | #:use-module (guix sets) | ||
| 25 | #:use-module (guix ui) | ||
| 24 | #:use-module ((gnu system file-systems) | 26 | #:use-module ((gnu system file-systems) |
| 25 | #:select (%tty-gid)) | 27 | #:select (%tty-gid)) |
| 26 | #:use-module ((gnu packages admin) | 28 | #:use-module ((gnu packages admin) |
| 27 | #:select (shadow)) | 29 | #:select (shadow)) |
| 28 | #:use-module (gnu packages bash) | 30 | #:use-module (gnu packages bash) |
| 29 | #:use-module (gnu packages guile-wm) | 31 | #:use-module (gnu packages guile-wm) |
| 32 | #:use-module (srfi srfi-26) | ||
| 33 | #:use-module (srfi srfi-34) | ||
| 34 | #:use-module (srfi srfi-35) | ||
| 30 | #:export (user-account | 35 | #:export (user-account |
| 31 | user-account? | 36 | user-account? |
| 32 | user-account-name | 37 | user-account-name |
| @@ -48,7 +53,9 @@ | |||
| 48 | 53 | ||
| 49 | default-skeletons | 54 | default-skeletons |
| 50 | skeleton-directory | 55 | skeleton-directory |
| 51 | %base-groups)) | 56 | %base-groups |
| 57 | %base-user-accounts | ||
| 58 | assert-valid-users/groups)) | ||
| 52 | 59 | ||
| 53 | ;;; Commentary: | 60 | ;;; Commentary: |
| 54 | ;;; | 61 | ;;; |
| @@ -107,6 +114,16 @@ | |||
| 107 | (system-group (name "tape")) | 114 | (system-group (name "tape")) |
| 108 | (system-group (name "kvm"))))) ; for /dev/kvm | 115 | (system-group (name "kvm"))))) ; for /dev/kvm |
| 109 | 116 | ||
| 117 | (define %base-user-accounts | ||
| 118 | ;; List of standard user accounts. Note that "root" is a special case, so | ||
| 119 | ;; it's not listed here. | ||
| 120 | (list (user-account | ||
| 121 | (name "nobody") | ||
| 122 | (uid 65534) | ||
| 123 | (group "nogroup") | ||
| 124 | (home-directory "/var/empty") | ||
| 125 | (system? #t)))) | ||
| 126 | |||
| 110 | (define (default-skeletons) | 127 | (define (default-skeletons) |
| 111 | "Return the default skeleton files for /etc/skel. These files are copied by | 128 | "Return the default skeleton files for /etc/skel. These files are copied by |
| 112 | 'useradd' in the home directory of newly created user accounts." | 129 | 'useradd' in the home directory of newly created user accounts." |
| @@ -176,4 +193,31 @@ set debug-file-directory ~/.guix-profile/lib/debug\n"))) | |||
| 176 | '#$skeletons) | 193 | '#$skeletons) |
| 177 | #t))) | 194 | #t))) |
| 178 | 195 | ||
| 196 | (define (assert-valid-users/groups users groups) | ||
| 197 | "Raise an error if USERS refer to groups not listed in GROUPS." | ||
| 198 | (let ((groups (list->set (map user-group-name groups)))) | ||
| 199 | (define (validate-supplementary-group user group) | ||
| 200 | (unless (set-contains? groups group) | ||
| 201 | (raise (condition | ||
| 202 | (&message | ||
| 203 | (message | ||
| 204 | (format #f (_ "supplementary group '~a' \ | ||
| 205 | of user '~a' is undeclared") | ||
| 206 | group | ||
| 207 | (user-account-name user)))))))) | ||
| 208 | |||
| 209 | (for-each (lambda (user) | ||
| 210 | (unless (set-contains? groups (user-account-group user)) | ||
| 211 | (raise (condition | ||
| 212 | (&message | ||
| 213 | (message | ||
| 214 | (format #f (_ "primary group '~a' \ | ||
| 215 | of user '~a' is undeclared") | ||
| 216 | (user-account-group user) | ||
| 217 | (user-account-name user))))))) | ||
| 218 | |||
| 219 | (for-each (cut validate-supplementary-group user <>) | ||
| 220 | (user-account-supplementary-groups user))) | ||
| 221 | users))) | ||
| 222 | |||
| 179 | ;;; shadow.scm ends here | 223 | ;;; shadow.scm ends here |
diff --git a/guix/base32.scm b/guix/base32.scm index e0599dc01e9..7b2e2a67121 100644 --- a/guix/base32.scm +++ b/guix/base32.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -18,6 +18,8 @@ | |||
| 18 | 18 | ||
| 19 | (define-module (guix base32) | 19 | (define-module (guix base32) |
| 20 | #:use-module (srfi srfi-1) | 20 | #:use-module (srfi srfi-1) |
| 21 | #:use-module (srfi srfi-34) | ||
| 22 | #:use-module (srfi srfi-35) | ||
| 21 | #:use-module (srfi srfi-60) | 23 | #:use-module (srfi srfi-60) |
| 22 | #:use-module (rnrs bytevectors) | 24 | #:use-module (rnrs bytevectors) |
| 23 | #:use-module (ice-9 vlist) | 25 | #:use-module (ice-9 vlist) |
| @@ -25,7 +27,11 @@ | |||
| 25 | bytevector->base32-string | 27 | bytevector->base32-string |
| 26 | bytevector->nix-base32-string | 28 | bytevector->nix-base32-string |
| 27 | base32-string->bytevector | 29 | base32-string->bytevector |
| 28 | nix-base32-string->bytevector)) | 30 | nix-base32-string->bytevector |
| 31 | &invalid-base32-character | ||
| 32 | invalid-base32-character? | ||
| 33 | invalid-base32-character-value | ||
| 34 | invalid-base32-character-string)) | ||
| 29 | 35 | ||
| 30 | ;;; Commentary: | 36 | ;;; Commentary: |
| 31 | ;;; | 37 | ;;; |
| @@ -264,6 +270,12 @@ starting from the right of S." | |||
| 264 | s) | 270 | s) |
| 265 | bv)) | 271 | bv)) |
| 266 | 272 | ||
| 273 | ;; Invalid base32 character error condition when decoding base32. | ||
| 274 | (define-condition-type &invalid-base32-character &error | ||
| 275 | invalid-base32-character? | ||
| 276 | (character invalid-base32-character-value) | ||
| 277 | (string invalid-base32-character-string)) | ||
| 278 | |||
| 267 | (define (make-base32-string->bytevector base32-string-unfold base32-chars) | 279 | (define (make-base32-string->bytevector base32-string-unfold base32-chars) |
| 268 | (let ((char->value (let loop ((i 0) | 280 | (let ((char->value (let loop ((i 0) |
| 269 | (v vlist-null)) | 281 | (v vlist-null)) |
| @@ -276,7 +288,10 @@ starting from the right of S." | |||
| 276 | "Return the binary representation of base32 string S as a bytevector." | 288 | "Return the binary representation of base32 string S as a bytevector." |
| 277 | (base32-string-unfold (lambda (chr) | 289 | (base32-string-unfold (lambda (chr) |
| 278 | (or (and=> (vhash-assv chr char->value) cdr) | 290 | (or (and=> (vhash-assv chr char->value) cdr) |
| 279 | (error "invalid base32 character" chr))) | 291 | (raise (condition |
| 292 | (&invalid-base32-character | ||
| 293 | (character chr) | ||
| 294 | (string s)))))) | ||
| 280 | s)))) | 295 | s)))) |
| 281 | 296 | ||
| 282 | (define base32-string->bytevector | 297 | (define base32-string->bytevector |
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index 1bc1879be52..25ac262d5d7 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #:use-module (guix store) | 21 | #:use-module (guix store) |
| 22 | #:use-module (guix utils) | 22 | #:use-module (guix utils) |
| 23 | #:use-module (guix derivations) | 23 | #:use-module (guix derivations) |
| 24 | #:use-module (guix search-paths) | ||
| 24 | #:use-module (guix build-system) | 25 | #:use-module (guix build-system) |
| 25 | #:use-module (guix build-system gnu) | 26 | #:use-module (guix build-system gnu) |
| 26 | #:use-module (guix packages) | 27 | #:use-module (guix packages) |
diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm index 954c716893f..a1f0a9b8a4b 100644 --- a/guix/build-system/glib-or-gtk.scm +++ b/guix/build-system/glib-or-gtk.scm | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #:use-module (guix store) | 22 | #:use-module (guix store) |
| 23 | #:use-module (guix utils) | 23 | #:use-module (guix utils) |
| 24 | #:use-module (guix derivations) | 24 | #:use-module (guix derivations) |
| 25 | #:use-module (guix search-paths) | ||
| 25 | #:use-module (guix build-system) | 26 | #:use-module (guix build-system) |
| 26 | #:use-module (guix build-system gnu) | 27 | #:use-module (guix build-system gnu) |
| 27 | #:use-module (guix packages) | 28 | #:use-module (guix packages) |
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 3ccdef1328d..da664e54221 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #:use-module (guix store) | 20 | #:use-module (guix store) |
| 21 | #:use-module (guix utils) | 21 | #:use-module (guix utils) |
| 22 | #:use-module (guix derivations) | 22 | #:use-module (guix derivations) |
| 23 | #:use-module (guix search-paths) | ||
| 23 | #:use-module (guix build-system) | 24 | #:use-module (guix build-system) |
| 24 | #:use-module (guix packages) | 25 | #:use-module (guix packages) |
| 25 | #:use-module (srfi srfi-1) | 26 | #:use-module (srfi srfi-1) |
| @@ -204,9 +205,10 @@ runs `make distcheck' and whose result is one or more source tarballs." | |||
| 204 | ;; Add autotools & co. as inputs. | 205 | ;; Add autotools & co. as inputs. |
| 205 | (let ((ref (lambda (module var) | 206 | (let ((ref (lambda (module var) |
| 206 | (module-ref (resolve-interface module) var)))) | 207 | (module-ref (resolve-interface module) var)))) |
| 207 | `(("autoconf" ,(ref '(gnu packages autotools) 'autoconf)) | 208 | `(,@(package-native-inputs p) |
| 209 | ("autoconf" ,(ref '(gnu packages autotools) 'autoconf)) | ||
| 208 | ("automake" ,(ref '(gnu packages autotools) 'automake)) | 210 | ("automake" ,(ref '(gnu packages autotools) 'automake)) |
| 209 | ("libtool" ,(ref '(gnu packages autotools) 'libtool) "bin") | 211 | ("libtool" ,(ref '(gnu packages autotools) 'libtool)) |
| 210 | ("gettext" ,(ref '(gnu packages gettext) 'gnu-gettext)) | 212 | ("gettext" ,(ref '(gnu packages gettext) 'gnu-gettext)) |
| 211 | ("texinfo" ,(ref '(gnu packages texinfo) 'texinfo)))))))) | 213 | ("texinfo" ,(ref '(gnu packages texinfo) 'texinfo)))))))) |
| 212 | 214 | ||
diff --git a/guix/build-system/haskell.scm b/guix/build-system/haskell.scm index 0fbf0b8e759..1cb734631c6 100644 --- a/guix/build-system/haskell.scm +++ b/guix/build-system/haskell.scm | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #:use-module (guix utils) | 21 | #:use-module (guix utils) |
| 22 | #:use-module (guix packages) | 22 | #:use-module (guix packages) |
| 23 | #:use-module (guix derivations) | 23 | #:use-module (guix derivations) |
| 24 | #:use-module (guix search-paths) | ||
| 24 | #:use-module (guix build-system) | 25 | #:use-module (guix build-system) |
| 25 | #:use-module (guix build-system gnu) | 26 | #:use-module (guix build-system gnu) |
| 26 | #:use-module (ice-9 match) | 27 | #:use-module (ice-9 match) |
diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm index 78331536766..06af1dd20e7 100644 --- a/guix/build-system/perl.scm +++ b/guix/build-system/perl.scm | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #:use-module (guix store) | 20 | #:use-module (guix store) |
| 21 | #:use-module (guix utils) | 21 | #:use-module (guix utils) |
| 22 | #:use-module (guix derivations) | 22 | #:use-module (guix derivations) |
| 23 | #:use-module (guix search-paths) | ||
| 23 | #:use-module (guix build-system) | 24 | #:use-module (guix build-system) |
| 24 | #:use-module (guix build-system gnu) | 25 | #:use-module (guix build-system gnu) |
| 25 | #:use-module (guix packages) | 26 | #:use-module (guix packages) |
diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index d498cf618bf..e9fffcc62f7 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #:use-module (guix utils) | 23 | #:use-module (guix utils) |
| 24 | #:use-module (guix packages) | 24 | #:use-module (guix packages) |
| 25 | #:use-module (guix derivations) | 25 | #:use-module (guix derivations) |
| 26 | #:use-module (guix search-paths) | ||
| 26 | #:use-module (guix build-system) | 27 | #:use-module (guix build-system) |
| 27 | #:use-module (guix build-system gnu) | 28 | #:use-module (guix build-system gnu) |
| 28 | #:use-module (ice-9 match) | 29 | #:use-module (ice-9 match) |
diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm index 83bc93d9016..e4fda30cf39 100644 --- a/guix/build-system/ruby.scm +++ b/guix/build-system/ruby.scm | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #:use-module (guix utils) | 22 | #:use-module (guix utils) |
| 23 | #:use-module (guix packages) | 23 | #:use-module (guix packages) |
| 24 | #:use-module (guix derivations) | 24 | #:use-module (guix derivations) |
| 25 | #:use-module (guix search-paths) | ||
| 25 | #:use-module (guix build-system) | 26 | #:use-module (guix build-system) |
| 26 | #:use-module (guix build-system gnu) | 27 | #:use-module (guix build-system gnu) |
| 27 | #:use-module (ice-9 match) | 28 | #:use-module (ice-9 match) |
diff --git a/guix/build-system/waf.scm b/guix/build-system/waf.scm index c67f649fa7b..044d2a08299 100644 --- a/guix/build-system/waf.scm +++ b/guix/build-system/waf.scm | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #:use-module (guix utils) | 21 | #:use-module (guix utils) |
| 22 | #:use-module (guix packages) | 22 | #:use-module (guix packages) |
| 23 | #:use-module (guix derivations) | 23 | #:use-module (guix derivations) |
| 24 | #:use-module (guix search-paths) | ||
| 24 | #:use-module (guix build-system) | 25 | #:use-module (guix build-system) |
| 25 | #:use-module (guix build-system gnu) | 26 | #:use-module (guix build-system gnu) |
| 26 | #:use-module ((guix build-system python) | 27 | #:use-module ((guix build-system python) |
diff --git a/guix/build/download.scm b/guix/build/download.scm index 2e0b019d38b..65d18eb8397 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | (define-module (guix build download) | 20 | (define-module (guix build download) |
| 21 | #:use-module (web uri) | 21 | #:use-module (web uri) |
| 22 | #:use-module (web client) | 22 | #:use-module ((web client) #:hide (open-socket-for-uri)) |
| 23 | #:use-module (web response) | 23 | #:use-module (web response) |
| 24 | #:use-module (guix ftp-client) | 24 | #:use-module (guix ftp-client) |
| 25 | #:use-module (guix build utils) | 25 | #:use-module (guix build utils) |
| @@ -30,7 +30,8 @@ | |||
| 30 | #:use-module (srfi srfi-26) | 30 | #:use-module (srfi srfi-26) |
| 31 | #:use-module (ice-9 match) | 31 | #:use-module (ice-9 match) |
| 32 | #:use-module (ice-9 format) | 32 | #:use-module (ice-9 format) |
| 33 | #:export (open-connection-for-uri | 33 | #:export (open-socket-for-uri |
| 34 | open-connection-for-uri | ||
| 34 | resolve-uri-reference | 35 | resolve-uri-reference |
| 35 | maybe-expand-mirrors | 36 | maybe-expand-mirrors |
| 36 | url-fetch | 37 | url-fetch |
| @@ -195,6 +196,25 @@ host name without trailing dot." | |||
| 195 | (add-weak-reference record port) | 196 | (add-weak-reference record port) |
| 196 | record))) | 197 | record))) |
| 197 | 198 | ||
| 199 | (define (open-socket-for-uri uri) | ||
| 200 | "Return an open port for URI. This variant works around | ||
| 201 | <http://bugs.gnu.org/15368> which affects Guile's 'open-socket-for-uri' up to | ||
| 202 | 2.0.11 included." | ||
| 203 | (define rmem-max | ||
| 204 | ;; The maximum size for a receive buffer on Linux, see socket(7). | ||
| 205 | "/proc/sys/net/core/rmem_max") | ||
| 206 | |||
| 207 | (define buffer-size | ||
| 208 | (if (file-exists? rmem-max) | ||
| 209 | (call-with-input-file rmem-max read) | ||
| 210 | 126976)) ;the default for Linux, per 'rmem_default' | ||
| 211 | |||
| 212 | (let ((s ((@ (web client) open-socket-for-uri) uri))) | ||
| 213 | ;; Work around <http://bugs.gnu.org/15368> by restoring a decent | ||
| 214 | ;; buffer size. | ||
| 215 | (setsockopt s SOL_SOCKET SO_RCVBUF buffer-size) | ||
| 216 | s)) | ||
| 217 | |||
| 198 | (define (open-connection-for-uri uri) | 218 | (define (open-connection-for-uri uri) |
| 199 | "Like 'open-socket-for-uri', but also handle HTTPS connections." | 219 | "Like 'open-socket-for-uri', but also handle HTTPS connections." |
| 200 | (define https? | 220 | (define https? |
| @@ -218,6 +238,9 @@ host name without trailing dot." | |||
| 218 | (thunk))))))) | 238 | (thunk))))))) |
| 219 | (with-https-proxy | 239 | (with-https-proxy |
| 220 | (let ((s (open-socket-for-uri uri))) | 240 | (let ((s (open-socket-for-uri uri))) |
| 241 | ;; Buffer input and output on this port. | ||
| 242 | (setvbuf s _IOFBF %http-receive-buffer-size) | ||
| 243 | |||
| 221 | (if https? | 244 | (if https? |
| 222 | (tls-wrap s (uri-host uri)) | 245 | (tls-wrap s (uri-host uri)) |
| 223 | s))))) | 246 | s))))) |
diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm new file mode 100644 index 00000000000..6e316d5d2c4 --- /dev/null +++ b/guix/build/profiles.scm | |||
| @@ -0,0 +1,149 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (guix build profiles) | ||
| 20 | #:use-module (guix build union) | ||
| 21 | #:use-module (guix build utils) | ||
| 22 | #:use-module (guix search-paths) | ||
| 23 | #:use-module (srfi srfi-26) | ||
| 24 | #:use-module (ice-9 ftw) | ||
| 25 | #:use-module (ice-9 match) | ||
| 26 | #:use-module (ice-9 pretty-print) | ||
| 27 | #:export (ensure-writable-directory | ||
| 28 | build-profile)) | ||
| 29 | |||
| 30 | ;;; Commentary: | ||
| 31 | ;;; | ||
| 32 | ;;; Build a user profile (essentially the union of all the installed packages) | ||
| 33 | ;;; with its associated meta-data. | ||
| 34 | ;;; | ||
| 35 | ;;; Code: | ||
| 36 | |||
| 37 | (define (abstract-profile profile) | ||
| 38 | "Return a procedure that replaces PROFILE in VALUE with a reference to the | ||
| 39 | 'GUIX_PROFILE' environment variable. This allows users to specify what the | ||
| 40 | user-friendly name of the profile is, for instance ~/.guix-profile rather than | ||
| 41 | /gnu/store/...-profile." | ||
| 42 | (let ((replacement (string-append "${GUIX_PROFILE:-" profile "}"))) | ||
| 43 | (match-lambda | ||
| 44 | ((search-path . value) | ||
| 45 | (let* ((separator (search-path-specification-separator search-path)) | ||
| 46 | (items (string-tokenize* value separator)) | ||
| 47 | (crop (cute string-drop <> (string-length profile)))) | ||
| 48 | (cons search-path | ||
| 49 | (string-join (map (lambda (str) | ||
| 50 | (string-append replacement (crop str))) | ||
| 51 | items) | ||
| 52 | separator))))))) | ||
| 53 | |||
| 54 | (define (write-environment-variable-definition port) | ||
| 55 | "Write the given environment variable definition to PORT." | ||
| 56 | (match-lambda | ||
| 57 | ((search-path . value) | ||
| 58 | (display (search-path-definition search-path value #:kind 'prefix) | ||
| 59 | port) | ||
| 60 | (newline port)))) | ||
| 61 | |||
| 62 | (define (build-etc/profile output search-paths) | ||
| 63 | "Build the 'OUTPUT/etc/profile' shell file containing environment variable | ||
| 64 | definitions for all the SEARCH-PATHS." | ||
| 65 | (mkdir-p (string-append output "/etc")) | ||
| 66 | (call-with-output-file (string-append output "/etc/profile") | ||
| 67 | (lambda (port) | ||
| 68 | ;; The use of $GUIX_PROFILE described below is not great. Another | ||
| 69 | ;; option would have been to use "$1" and have users run: | ||
| 70 | ;; | ||
| 71 | ;; source ~/.guix-profile/etc/profile ~/.guix-profile | ||
| 72 | ;; | ||
| 73 | ;; However, when 'source' is used with no arguments, $1 refers to the | ||
| 74 | ;; first positional parameter of the calling scripts, so we can rely on | ||
| 75 | ;; it. | ||
| 76 | (display "\ | ||
| 77 | # Source this file to define all the relevant environment variables in Bash | ||
| 78 | # for this profile. You may want to define the 'GUIX_PROFILE' environment | ||
| 79 | # variable to point to the \"visible\" name of the profile, like this: | ||
| 80 | # | ||
| 81 | # GUIX_PROFILE=/path/to/profile | ||
| 82 | # source /path/to/profile/etc/profile | ||
| 83 | # | ||
| 84 | # When GUIX_PROFILE is undefined, the various environment variables refer | ||
| 85 | # to this specific profile generation. | ||
| 86 | \n" port) | ||
| 87 | (let ((variables (evaluate-search-paths (cons $PATH search-paths) | ||
| 88 | (list output)))) | ||
| 89 | (for-each (write-environment-variable-definition port) | ||
| 90 | (map (abstract-profile output) variables)))))) | ||
| 91 | |||
| 92 | (define (ensure-writable-directory directory) | ||
| 93 | "Ensure DIRECTORY exists and is writable. If DIRECTORY is currently a | ||
| 94 | symlink (to a read-only directory in the store), then delete the symlink and | ||
| 95 | instead make DIRECTORY a \"real\" directory containing symlinks." | ||
| 96 | (define (unsymlink link) | ||
| 97 | (let* ((target (readlink link)) | ||
| 98 | ;; TARGET might itself be a symlink, so append "/" to make sure | ||
| 99 | ;; 'scandir' enters it. | ||
| 100 | (files (scandir (string-append target "/") | ||
| 101 | (negate (cut member <> '("." "..")))))) | ||
| 102 | (delete-file link) | ||
| 103 | (mkdir link) | ||
| 104 | (for-each (lambda (file) | ||
| 105 | (symlink (string-append target "/" file) | ||
| 106 | (string-append link "/" file))) | ||
| 107 | files))) | ||
| 108 | |||
| 109 | (catch 'system-error | ||
| 110 | (lambda () | ||
| 111 | (mkdir directory)) | ||
| 112 | (lambda args | ||
| 113 | (let ((errno (system-error-errno args))) | ||
| 114 | (if (= errno EEXIST) | ||
| 115 | (let ((stat (lstat directory))) | ||
| 116 | (case (stat:type stat) | ||
| 117 | ((symlink) | ||
| 118 | ;; "Unsymlink" DIRECTORY so that it is writable. | ||
| 119 | (unsymlink directory)) | ||
| 120 | ((directory) | ||
| 121 | #t) | ||
| 122 | (else | ||
| 123 | (error "cannot mkdir because a same-named file exists" | ||
| 124 | directory)))) | ||
| 125 | (apply throw args)))))) | ||
| 126 | |||
| 127 | (define* (build-profile output inputs | ||
| 128 | #:key manifest search-paths) | ||
| 129 | "Build a user profile from INPUTS in directory OUTPUT. Write MANIFEST, an | ||
| 130 | sexp, to OUTPUT/manifest. Create OUTPUT/etc/profile with Bash definitions for | ||
| 131 | -all the variables listed in SEARCH-PATHS." | ||
| 132 | ;; Make the symlinks. | ||
| 133 | (union-build output inputs | ||
| 134 | #:log-port (%make-void-port "w")) | ||
| 135 | |||
| 136 | ;; Store meta-data. | ||
| 137 | (call-with-output-file (string-append output "/manifest") | ||
| 138 | (lambda (p) | ||
| 139 | (pretty-print manifest p))) | ||
| 140 | |||
| 141 | ;; Make sure we can write to 'OUTPUT/etc'. 'union-build' above could have | ||
| 142 | ;; made 'etc' a symlink to a read-only sub-directory in the store so we need | ||
| 143 | ;; to work around that. | ||
| 144 | (ensure-writable-directory (string-append output "/etc")) | ||
| 145 | |||
| 146 | ;; Write 'OUTPUT/etc/profile'. | ||
| 147 | (build-etc/profile output search-paths)) | ||
| 148 | |||
| 149 | ;;; profile.scm ends here | ||
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index b62a8cce648..3585bf27a87 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -29,6 +29,7 @@ | |||
| 29 | MS_REMOUNT | 29 | MS_REMOUNT |
| 30 | MS_BIND | 30 | MS_BIND |
| 31 | MS_MOVE | 31 | MS_MOVE |
| 32 | restart-on-EINTR | ||
| 32 | mount | 33 | mount |
| 33 | umount | 34 | umount |
| 34 | mount-points | 35 | mount-points |
| @@ -46,6 +47,7 @@ | |||
| 46 | network-interface-address | 47 | network-interface-address |
| 47 | set-network-interface-flags | 48 | set-network-interface-flags |
| 48 | set-network-interface-address | 49 | set-network-interface-address |
| 50 | set-network-interface-up | ||
| 49 | configure-network-interface)) | 51 | configure-network-interface)) |
| 50 | 52 | ||
| 51 | ;;; Commentary: | 53 | ;;; Commentary: |
| @@ -88,6 +90,19 @@ | |||
| 88 | (ref bv)))) | 90 | (ref bv)))) |
| 89 | (lambda () 0))) | 91 | (lambda () 0))) |
| 90 | 92 | ||
| 93 | (define (call-with-restart-on-EINTR thunk) | ||
| 94 | (let loop () | ||
| 95 | (catch 'system-error | ||
| 96 | thunk | ||
| 97 | (lambda args | ||
| 98 | (if (= (system-error-errno args) EINTR) | ||
| 99 | (loop) | ||
| 100 | (apply throw args)))))) | ||
| 101 | |||
| 102 | (define-syntax-rule (restart-on-EINTR expr) | ||
| 103 | "Evaluate EXPR and restart upon EINTR. Return the value of EXPR." | ||
| 104 | (call-with-restart-on-EINTR (lambda () expr))) | ||
| 105 | |||
| 91 | (define (augment-mtab source target type options) | 106 | (define (augment-mtab source target type options) |
| 92 | "Augment /etc/mtab with information about the given mount point." | 107 | "Augment /etc/mtab with information about the given mount point." |
| 93 | (let ((port (open-file "/etc/mtab" "a"))) | 108 | (let ((port (open-file "/etc/mtab" "a"))) |
| @@ -203,7 +218,7 @@ constants from <sys/mount.h>." | |||
| 203 | (let ((ret (proc (string->pointer device))) | 218 | (let ((ret (proc (string->pointer device))) |
| 204 | (err (errno))) | 219 | (err (errno))) |
| 205 | (unless (zero? ret) | 220 | (unless (zero? ret) |
| 206 | (throw 'system-error "swapff" "~S: ~A" | 221 | (throw 'system-error "swapoff" "~S: ~A" |
| 207 | (list device (strerror err)) | 222 | (list device (strerror err)) |
| 208 | (list err))))))) | 223 | (list err))))))) |
| 209 | 224 | ||
| @@ -552,4 +567,17 @@ the same type as that returned by 'make-socket-address'." | |||
| 552 | (lambda () | 567 | (lambda () |
| 553 | (close-port sock))))) | 568 | (close-port sock))))) |
| 554 | 569 | ||
| 570 | (define* (set-network-interface-up name | ||
| 571 | #:key (family AF_INET)) | ||
| 572 | "Turn up the interface NAME." | ||
| 573 | (let ((sock (socket family SOCK_STREAM 0))) | ||
| 574 | (dynamic-wind | ||
| 575 | (const #t) | ||
| 576 | (lambda () | ||
| 577 | (let ((flags (network-interface-flags sock name))) | ||
| 578 | (set-network-interface-flags sock name | ||
| 579 | (logior flags IFF_UP)))) | ||
| 580 | (lambda () | ||
| 581 | (close-port sock))))) | ||
| 582 | |||
| 555 | ;;; syscalls.scm ends here | 583 | ;;; syscalls.scm ends here |
diff --git a/guix/ftp-client.scm b/guix/ftp-client.scm index ab72405df08..37feb895a54 100644 --- a/guix/ftp-client.scm +++ b/guix/ftp-client.scm | |||
| @@ -109,11 +109,8 @@ or a TCP port number), and return it." | |||
| 109 | (%ftp-login "anonymous" "guix@example.com" s) | 109 | (%ftp-login "anonymous" "guix@example.com" s) |
| 110 | (%make-ftp-connection s ai)) | 110 | (%make-ftp-connection s ai)) |
| 111 | (begin | 111 | (begin |
| 112 | (format (current-error-port) | ||
| 113 | "FTP to `~a' failed: ~A: ~A~%" | ||
| 114 | host code message) | ||
| 115 | (close s) | 112 | (close s) |
| 116 | #f)))) | 113 | (throw 'ftp-error s "log-in" code message))))) |
| 117 | 114 | ||
| 118 | (lambda args | 115 | (lambda args |
| 119 | ;; Connection failed, so try one of the other addresses. | 116 | ;; Connection failed, so try one of the other addresses. |
diff --git a/guix/gexp.scm b/guix/gexp.scm index b08a3612323..10056e5a1f8 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm | |||
| @@ -31,8 +31,17 @@ | |||
| 31 | 31 | ||
| 32 | gexp-input | 32 | gexp-input |
| 33 | gexp-input? | 33 | gexp-input? |
| 34 | |||
| 34 | local-file | 35 | local-file |
| 35 | local-file? | 36 | local-file? |
| 37 | local-file-file | ||
| 38 | local-file-name | ||
| 39 | local-file-recursive? | ||
| 40 | |||
| 41 | plain-file | ||
| 42 | plain-file? | ||
| 43 | plain-file-name | ||
| 44 | plain-file-content | ||
| 36 | 45 | ||
| 37 | gexp->derivation | 46 | gexp->derivation |
| 38 | gexp->file | 47 | gexp->file |
| @@ -137,7 +146,7 @@ cross-compiling.)" | |||
| 137 | 146 | ||
| 138 | 147 | ||
| 139 | ;;; | 148 | ;;; |
| 140 | ;;; Local files. | 149 | ;;; File declarations. |
| 141 | ;;; | 150 | ;;; |
| 142 | 151 | ||
| 143 | (define-record-type <local-file> | 152 | (define-record-type <local-file> |
| @@ -166,6 +175,28 @@ This is the declarative counterpart of the 'interned-file' monadic procedure." | |||
| 166 | (($ <local-file> file name recursive?) | 175 | (($ <local-file> file name recursive?) |
| 167 | (interned-file file name #:recursive? recursive?)))) | 176 | (interned-file file name #:recursive? recursive?)))) |
| 168 | 177 | ||
| 178 | (define-record-type <plain-file> | ||
| 179 | (%plain-file name content references) | ||
| 180 | plain-file? | ||
| 181 | (name plain-file-name) ;string | ||
| 182 | (content plain-file-content) ;string | ||
| 183 | (references plain-file-references)) ;list (currently unused) | ||
| 184 | |||
| 185 | (define (plain-file name content) | ||
| 186 | "Return an object representing a text file called NAME with the given | ||
| 187 | CONTENT (a string) to be added to the store. | ||
| 188 | |||
| 189 | This is the declarative counterpart of 'text-file'." | ||
| 190 | ;; XXX: For now just ignore 'references' because it's not clear how to use | ||
| 191 | ;; them in a declarative context. | ||
| 192 | (%plain-file name content '())) | ||
| 193 | |||
| 194 | (define-gexp-compiler (plain-file-compiler (file plain-file?) system target) | ||
| 195 | ;; "Compile" FILE by adding it to the store. | ||
| 196 | (match file | ||
| 197 | (($ <plain-file> name content references) | ||
| 198 | (text-file name content references)))) | ||
| 199 | |||
| 169 | 200 | ||
| 170 | ;;; | 201 | ;;; |
| 171 | ;;; Inputs & outputs. | 202 | ;;; Inputs & outputs. |
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 0528e9f2533..8d47cee4871 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2010, 2011, 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org> | 3 | ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -179,9 +179,18 @@ network to check in GNU's database." | |||
| 179 | (define (mirror-type url) | 179 | (define (mirror-type url) |
| 180 | (let ((uri (string->uri url))) | 180 | (let ((uri (string->uri url))) |
| 181 | (and (eq? (uri-scheme uri) 'mirror) | 181 | (and (eq? (uri-scheme uri) 'mirror) |
| 182 | (if (member (uri-host uri) '("gnu" "gnupg" "gcc")) | 182 | (cond |
| 183 | 'gnu | 183 | ((member (uri-host uri) |
| 184 | 'non-gnu)))) | 184 | '("gnu" "gnupg" "gcc" "gnome")) |
| 185 | ;; Definitely GNU. | ||
| 186 | 'gnu) | ||
| 187 | ((equal? (uri-host uri) "cran") | ||
| 188 | ;; Possibly GNU: mirror://cran could be either GNU R itself | ||
| 189 | ;; or a non-GNU package. | ||
| 190 | #f) | ||
| 191 | (else | ||
| 192 | ;; Definitely non-GNU. | ||
| 193 | 'non-gnu))))) | ||
| 185 | 194 | ||
| 186 | (let ((url (and=> (package-source package) origin-uri)) | 195 | (let ((url (and=> (package-source package) origin-uri)) |
| 187 | (name (package-name package))) | 196 | (name (package-name package))) |
| @@ -348,7 +357,8 @@ open (resp. close) FTP connections; this can be useful to reuse connections." | |||
| 348 | (let-values (((server directory) (ftp-server/directory project))) | 357 | (let-values (((server directory) (ftp-server/directory project))) |
| 349 | (define conn (ftp-open server)) | 358 | (define conn (ftp-open server)) |
| 350 | 359 | ||
| 351 | (let loop ((directory directory)) | 360 | (let loop ((directory directory) |
| 361 | (result #f)) | ||
| 352 | (let* ((entries (ftp-list conn directory)) | 362 | (let* ((entries (ftp-list conn directory)) |
| 353 | 363 | ||
| 354 | ;; Filter out sub-directories that do not contain digits---e.g., | 364 | ;; Filter out sub-directories that do not contain digits---e.g., |
| @@ -360,32 +370,38 @@ open (resp. close) FTP connections; this can be useful to reuse connections." | |||
| 360 | (((? contains-digit? dir) 'directory . _) | 370 | (((? contains-digit? dir) 'directory . _) |
| 361 | dir) | 371 | dir) |
| 362 | (_ #f)) | 372 | (_ #f)) |
| 363 | entries))) | 373 | entries)) |
| 364 | (match subdirs | 374 | |
| 365 | (() | 375 | ;; Whether or not SUBDIRS is empty, compute the latest releases |
| 366 | ;; No sub-directories, so assume that tarballs are here. | 376 | ;; for the current directory. This is necessary for packages |
| 367 | (let ((releases (filter-map (match-lambda | 377 | ;; such as 'sharutils' that have a sub-directory that contains |
| 368 | ((file 'file . _) | 378 | ;; only an older release. |
| 369 | (and (release-file? project file) | 379 | (releases (filter-map (match-lambda |
| 370 | (gnu-release | 380 | ((file 'file . _) |
| 371 | (package project) | 381 | (and (release-file? project file) |
| 372 | (version | 382 | (gnu-release |
| 373 | (tarball->version file)) | 383 | (package project) |
| 374 | (directory directory) | 384 | (version |
| 375 | (files (list file))))) | 385 | (tarball->version file)) |
| 376 | (_ #f)) | 386 | (directory directory) |
| 377 | entries))) | 387 | (files (list file))))) |
| 378 | (ftp-close conn) | 388 | (_ #f)) |
| 379 | (reduce latest-release #f (coalesce-releases releases)))) | 389 | entries))) |
| 380 | ((subdirs ...) | 390 | |
| 381 | ;; Assume that SUBDIRS correspond to versions, and jump into the | 391 | ;; Assume that SUBDIRS correspond to versions, and jump into the |
| 382 | ;; one with the highest version number. | 392 | ;; one with the highest version number. |
| 383 | (let ((target (reduce latest #f subdirs))) | 393 | (let* ((release (reduce latest-release #f |
| 384 | (if target | 394 | (coalesce-releases releases))) |
| 385 | (loop (string-append directory "/" target)) | 395 | (result (if (and result release) |
| 386 | (begin | 396 | (latest-release release result) |
| 387 | (ftp-close conn) | 397 | (or release result))) |
| 388 | #f))))))))) | 398 | (target (reduce latest #f subdirs))) |
| 399 | (if target | ||
| 400 | (loop (string-append directory "/" target) | ||
| 401 | result) | ||
| 402 | (begin | ||
| 403 | (ftp-close conn) | ||
| 404 | result))))))) | ||
| 389 | 405 | ||
| 390 | (define (gnu-release-archive-types release) | 406 | (define (gnu-release-archive-types release) |
| 391 | "Return the available types of archives for RELEASE---a list of strings such | 407 | "Return the available types of archives for RELEASE---a list of strings such |
diff --git a/guix/http-client.scm b/guix/http-client.scm index 3bffbb1c248..dc8d3298fc7 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
| 4 | ;;; Copyright © 2012, 2015 Free Software Foundation, Inc. | 4 | ;;; Copyright © 2012, 2015 Free Software Foundation, Inc. |
| 5 | ;;; | 5 | ;;; |
| @@ -21,7 +21,7 @@ | |||
| 21 | (define-module (guix http-client) | 21 | (define-module (guix http-client) |
| 22 | #:use-module (guix utils) | 22 | #:use-module (guix utils) |
| 23 | #:use-module (web uri) | 23 | #:use-module (web uri) |
| 24 | #:use-module (web client) | 24 | #:use-module ((web client) #:hide (open-socket-for-uri)) |
| 25 | #:use-module (web response) | 25 | #:use-module (web response) |
| 26 | #:use-module (srfi srfi-11) | 26 | #:use-module (srfi srfi-11) |
| 27 | #:use-module (srfi srfi-34) | 27 | #:use-module (srfi srfi-34) |
| @@ -30,14 +30,15 @@ | |||
| 30 | #:use-module (rnrs bytevectors) | 30 | #:use-module (rnrs bytevectors) |
| 31 | #:use-module (guix ui) | 31 | #:use-module (guix ui) |
| 32 | #:use-module (guix utils) | 32 | #:use-module (guix utils) |
| 33 | #:use-module ((guix build download) #:select (resolve-uri-reference)) | 33 | #:use-module ((guix build download) |
| 34 | #:select (open-socket-for-uri resolve-uri-reference)) | ||
| 35 | #:re-export (open-socket-for-uri) | ||
| 34 | #:export (&http-get-error | 36 | #:export (&http-get-error |
| 35 | http-get-error? | 37 | http-get-error? |
| 36 | http-get-error-uri | 38 | http-get-error-uri |
| 37 | http-get-error-code | 39 | http-get-error-code |
| 38 | http-get-error-reason | 40 | http-get-error-reason |
| 39 | 41 | ||
| 40 | open-socket-for-uri | ||
| 41 | http-fetch)) | 42 | http-fetch)) |
| 42 | 43 | ||
| 43 | ;;; Commentary: | 44 | ;;; Commentary: |
| @@ -174,59 +175,13 @@ closes PORT, unless KEEP-ALIVE? is true." | |||
| 174 | ;; Guile <= 2.0.9 had a bug whereby 'response-body-port' would read more | 175 | ;; Guile <= 2.0.9 had a bug whereby 'response-body-port' would read more |
| 175 | ;; than what 'content-length' says. See Guile commit 802a25b. | 176 | ;; than what 'content-length' says. See Guile commit 802a25b. |
| 176 | (module-set! (resolve-module '(web response)) | 177 | (module-set! (resolve-module '(web response)) |
| 177 | 'make-delimited-input-port make-delimited-input-port)) | 178 | 'make-delimited-input-port make-delimited-input-port))) |
| 178 | |||
| 179 | (define (read-response-body* r) | ||
| 180 | "Reads the response body from @var{r}, as a bytevector. Returns | ||
| 181 | @code{#f} if there was no response body." | ||
| 182 | (define bad-response | ||
| 183 | (@@ (web response) bad-response)) | ||
| 184 | |||
| 185 | (if (member '(chunked) (response-transfer-encoding r)) | ||
| 186 | (let ((chunk-port (make-chunked-input-port (response-port r) | ||
| 187 | #:keep-alive? #t))) | ||
| 188 | (get-bytevector-all chunk-port)) | ||
| 189 | (let ((nbytes (response-content-length r))) | ||
| 190 | ;; Backport of Guile commit 84dfde82ae8f6ec247c1c147c1e2ae50b207bad9 | ||
| 191 | ;; ("fix response-body-port for responses without content-length"). | ||
| 192 | (if nbytes | ||
| 193 | (let ((bv (get-bytevector-n (response-port r) nbytes))) | ||
| 194 | (if (= (bytevector-length bv) nbytes) | ||
| 195 | bv | ||
| 196 | (bad-response "EOF while reading response body: ~a bytes of ~a" | ||
| 197 | (bytevector-length bv) nbytes))) | ||
| 198 | (get-bytevector-all (response-port r)))))) | ||
| 199 | |||
| 200 | ;; Install this patch only on Guile 2.0.5. | ||
| 201 | (unless (guile-version>? "2.0.5") | ||
| 202 | (module-set! (resolve-module '(web response)) | ||
| 203 | 'read-response-body read-response-body*))) | ||
| 204 | 179 | ||
| 205 | ;; XXX: Work around <http://bugs.gnu.org/13095>, present in Guile | 180 | ;; XXX: Work around <http://bugs.gnu.org/13095>, present in Guile |
| 206 | ;; up to 2.0.7. | 181 | ;; up to 2.0.7. |
| 207 | (module-define! (resolve-module '(web client)) | 182 | (module-define! (resolve-module '(web client)) |
| 208 | 'shutdown (const #f)) | 183 | 'shutdown (const #f)) |
| 209 | 184 | ||
| 210 | (define* (open-socket-for-uri uri #:key (buffered? #t)) | ||
| 211 | "Return an open port for URI. When BUFFERED? is false, the returned port is | ||
| 212 | unbuffered." | ||
| 213 | (define rmem-max | ||
| 214 | ;; The maximum size for a receive buffer on Linux, see socket(7). | ||
| 215 | "/proc/sys/net/core/rmem_max") | ||
| 216 | |||
| 217 | (define buffer-size | ||
| 218 | (if (file-exists? rmem-max) | ||
| 219 | (call-with-input-file rmem-max read) | ||
| 220 | 126976)) ; the default for Linux, per 'rmem_default' | ||
| 221 | |||
| 222 | (let ((s ((@ (web client) open-socket-for-uri) uri))) | ||
| 223 | ;; Work around <http://bugs.gnu.org/15368> by restoring a decent | ||
| 224 | ;; buffer size. | ||
| 225 | (setsockopt s SOL_SOCKET SO_RCVBUF buffer-size) | ||
| 226 | (unless buffered? | ||
| 227 | (setvbuf s _IONBF)) | ||
| 228 | s)) | ||
| 229 | |||
| 230 | (define* (http-fetch uri #:key port (text? #f) (buffered? #t)) | 185 | (define* (http-fetch uri #:key port (text? #f) (buffered? #t)) |
| 231 | "Return an input port containing the data at URI, and the expected number of | 186 | "Return an input port containing the data at URI, and the expected number of |
| 232 | bytes available or #f. If TEXT? is true, the data at URI is considered to be | 187 | bytes available or #f. If TEXT? is true, the data at URI is considered to be |
| @@ -235,44 +190,20 @@ unbuffered port, suitable for use in `filtered-port'. | |||
| 235 | 190 | ||
| 236 | Raise an '&http-get-error' condition if downloading fails." | 191 | Raise an '&http-get-error' condition if downloading fails." |
| 237 | (let loop ((uri uri)) | 192 | (let loop ((uri uri)) |
| 238 | (let ((port (or port | 193 | (let ((port (or port (open-socket-for-uri uri)))) |
| 239 | (open-socket-for-uri uri | 194 | (unless buffered? |
| 240 | #:buffered? buffered?)))) | 195 | (setvbuf port _IONBF)) |
| 241 | (let*-values (((resp data) | 196 | (let*-values (((resp data) |
| 242 | ;; Try hard to use the API du jour to get an input port. | 197 | ;; Try hard to use the API du jour to get an input port. |
| 243 | ;; On Guile 2.0.5 and before, we can only get a string or | ||
| 244 | ;; bytevector, and not an input port. Work around that. | ||
| 245 | (if (guile-version>? "2.0.7") | 198 | (if (guile-version>? "2.0.7") |
| 246 | (http-get uri #:streaming? #t #:port port) ; 2.0.9+ | 199 | (http-get uri #:streaming? #t #:port port) ; 2.0.9+ |
| 247 | (if (defined? 'http-get*) | 200 | (http-get* uri #:decode-body? text? ; 2.0.7 |
| 248 | (http-get* uri #:decode-body? text? | 201 | #:port port))) |
| 249 | #:port port) ; 2.0.7 | ||
| 250 | (http-get uri #:decode-body? text? | ||
| 251 | #:port port)))) ; 2.0.5- | ||
| 252 | ((code) | 202 | ((code) |
| 253 | (response-code resp))) | 203 | (response-code resp))) |
| 254 | (case code | 204 | (case code |
| 255 | ((200) | 205 | ((200) |
| 256 | (let ((len (response-content-length resp))) | 206 | (values data (response-content-length resp))) |
| 257 | (cond ((not data) | ||
| 258 | (begin | ||
| 259 | ;; Guile 2.0.5 and earlier did not support chunked | ||
| 260 | ;; transfer encoding, which is required for instance when | ||
| 261 | ;; fetching %PACKAGE-LIST-URL (see | ||
| 262 | ;; <http://lists.gnu.org/archive/html/guile-devel/2011-09/msg00089.html>). | ||
| 263 | ;; Normally the `when-guile<=2.0.5' block above fixes | ||
| 264 | ;; that, but who knows what could happen. | ||
| 265 | (warning (_ "using Guile ~a, which does not support ~s encoding~%") | ||
| 266 | (version) | ||
| 267 | (response-transfer-encoding resp)) | ||
| 268 | (leave (_ "download failed; use a newer Guile~%") | ||
| 269 | uri resp))) | ||
| 270 | ((string? data) ; `http-get' from 2.0.5- | ||
| 271 | (values (open-input-string data) len)) | ||
| 272 | ((bytevector? data) ; likewise | ||
| 273 | (values (open-bytevector-input-port data) len)) | ||
| 274 | (else ; input port | ||
| 275 | (values data len))))) | ||
| 276 | ((301 ; moved permanently | 207 | ((301 ; moved permanently |
| 277 | 302) ; found (redirection) | 208 | 302) ; found (redirection) |
| 278 | (let ((uri (resolve-uri-reference (response-location resp) uri))) | 209 | (let ((uri (resolve-uri-reference (response-location resp) uri))) |
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm new file mode 100644 index 00000000000..dfeba88312e --- /dev/null +++ b/guix/import/cabal.scm | |||
| @@ -0,0 +1,815 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (guix import cabal) | ||
| 20 | #:use-module (ice-9 match) | ||
| 21 | #:use-module (ice-9 regex) | ||
| 22 | #:use-module (ice-9 rdelim) | ||
| 23 | #:use-module (ice-9 receive) | ||
| 24 | #:use-module (srfi srfi-26) | ||
| 25 | #:use-module (srfi srfi-34) | ||
| 26 | #:use-module (srfi srfi-35) | ||
| 27 | #:use-module (srfi srfi-11) | ||
| 28 | #:use-module (srfi srfi-1) | ||
| 29 | #:use-module (srfi srfi-9) | ||
| 30 | #:use-module (srfi srfi-9 gnu) | ||
| 31 | #:use-module (system base lalr) | ||
| 32 | #:use-module (rnrs enums) | ||
| 33 | #:export (read-cabal | ||
| 34 | eval-cabal | ||
| 35 | |||
| 36 | cabal-package? | ||
| 37 | cabal-package-name | ||
| 38 | cabal-package-version | ||
| 39 | cabal-package-license | ||
| 40 | cabal-package-home-page | ||
| 41 | cabal-package-source-repository | ||
| 42 | cabal-package-synopsis | ||
| 43 | cabal-package-description | ||
| 44 | cabal-package-executables | ||
| 45 | cabal-package-library | ||
| 46 | cabal-package-test-suites | ||
| 47 | cabal-package-flags | ||
| 48 | cabal-package-eval-environment | ||
| 49 | |||
| 50 | cabal-source-repository? | ||
| 51 | cabal-source-repository-use-case | ||
| 52 | cabal-source-repository-type | ||
| 53 | cabal-source-repository-location | ||
| 54 | |||
| 55 | cabal-flag? | ||
| 56 | cabal-flag-name | ||
| 57 | cabal-flag-description | ||
| 58 | cabal-flag-default | ||
| 59 | cabal-flag-manual | ||
| 60 | |||
| 61 | cabal-dependency? | ||
| 62 | cabal-dependency-name | ||
| 63 | cabal-dependency-version | ||
| 64 | |||
| 65 | cabal-executable? | ||
| 66 | cabal-executable-name | ||
| 67 | cabal-executable-dependencies | ||
| 68 | |||
| 69 | cabal-library? | ||
| 70 | cabal-library-dependencies | ||
| 71 | |||
| 72 | cabal-test-suite? | ||
| 73 | cabal-test-suite-name | ||
| 74 | cabal-test-suite-dependencies)) | ||
| 75 | |||
| 76 | ;; Part 1: | ||
| 77 | ;; | ||
| 78 | ;; Functions used to read a Cabal file. | ||
| 79 | |||
| 80 | ;; Comment: | ||
| 81 | ;; | ||
| 82 | ;; The use of virtual closing braces VCCURLY and some lexer functions were | ||
| 83 | ;; inspired from http://hackage.haskell.org/package/haskell-src | ||
| 84 | |||
| 85 | ;; Object containing information about the structure of a block: (i) delimited | ||
| 86 | ;; by braces or by indentation, (ii) minimum indentation. | ||
| 87 | (define-record-type <parse-context> | ||
| 88 | (make-parse-context mode indentation) | ||
| 89 | parse-context? | ||
| 90 | (mode parse-context-mode) ; 'layout or 'no-layout | ||
| 91 | (indentation parse-context-indentation)) ; #f for 'no-layout | ||
| 92 | |||
| 93 | ;; <parse-context> mode set universe | ||
| 94 | (define-enumeration context (layout no-layout) make-context) | ||
| 95 | |||
| 96 | (define (make-stack) | ||
| 97 | "Creates a simple stack closure. Actions on the generated stack are | ||
| 98 | requested by calling it with one of the following symbols as the first | ||
| 99 | argument: 'empty?, 'push!, 'top, 'pop! and 'clear!. The action 'push! is the | ||
| 100 | only one requiring a second argument corresponding to the object to be added | ||
| 101 | to the stack." | ||
| 102 | (let ((stack '())) | ||
| 103 | (lambda (msg . args) | ||
| 104 | (cond ((eqv? msg 'empty?) (null? stack)) | ||
| 105 | ((eqv? msg 'push!) (set! stack (cons (first args) stack))) | ||
| 106 | ((eqv? msg 'top) (if (null? stack) '() (first stack))) | ||
| 107 | ((eqv? msg 'pop!) (match stack | ||
| 108 | ((e r ...) (set! stack (cdr stack)) e) | ||
| 109 | (_ #f))) | ||
| 110 | ((eqv? msg 'clear!) (set! stack '())) | ||
| 111 | (else #f))))) | ||
| 112 | |||
| 113 | ;; Stack to track the structure of nested blocks and simple interface | ||
| 114 | (define context-stack (make-parameter (make-stack))) | ||
| 115 | |||
| 116 | (define (context-stack-empty?) ((context-stack) 'empty?)) | ||
| 117 | |||
| 118 | (define (context-stack-push! e) ((context-stack) 'push! e)) | ||
| 119 | |||
| 120 | (define (context-stack-top) ((context-stack) 'top)) | ||
| 121 | |||
| 122 | (define (context-stack-pop!) ((context-stack) 'pop!)) | ||
| 123 | |||
| 124 | (define (context-stack-clear!) ((context-stack) 'clear!)) | ||
| 125 | |||
| 126 | ;; Indentation of the line being parsed. | ||
| 127 | (define current-indentation (make-parameter 0)) | ||
| 128 | |||
| 129 | ;; Signal to reprocess the beginning of line, in case we need to close more | ||
| 130 | ;; than one indentation level. | ||
| 131 | (define check-bol? (make-parameter #f)) | ||
| 132 | |||
| 133 | ;; Name of the file being parsed. Used in error messages. | ||
| 134 | (define cabal-file-name (make-parameter "unknowk")) | ||
| 135 | |||
| 136 | ;; Specify the grammar of a Cabal file and generate a suitable syntax analyser. | ||
| 137 | (define (make-cabal-parser) | ||
| 138 | "Generate a parser for Cabal files." | ||
| 139 | (lalr-parser | ||
| 140 | ;; --- token definitions | ||
| 141 | (CCURLY VCCURLY OPAREN CPAREN TEST ID VERSION RELATION | ||
| 142 | (right: IF FLAG EXEC TEST-SUITE SOURCE-REPO BENCHMARK LIB OCURLY) | ||
| 143 | (left: OR) | ||
| 144 | (left: PROPERTY AND) | ||
| 145 | (right: ELSE NOT)) | ||
| 146 | ;; --- rules | ||
| 147 | (body (properties sections) : (append $1 $2)) | ||
| 148 | (sections (sections flags) : (append $1 $2) | ||
| 149 | (sections source-repo) : (append $1 (list $2)) | ||
| 150 | (sections executables) : (append $1 $2) | ||
| 151 | (sections test-suites) : (append $1 $2) | ||
| 152 | (sections benchmarks) : (append $1 $2) | ||
| 153 | (sections lib-sec) : (append $1 (list $2)) | ||
| 154 | () : '()) | ||
| 155 | (flags (flags flag-sec) : (append $1 (list $2)) | ||
| 156 | (flag-sec) : (list $1)) | ||
| 157 | (flag-sec (FLAG OCURLY properties CCURLY) : `(section flag ,$1 ,$3) | ||
| 158 | (FLAG open properties close) : `(section flag ,$1 ,$3) | ||
| 159 | (FLAG) : `(section flag ,$1 '())) | ||
| 160 | (source-repo (SOURCE-REPO OCURLY properties CCURLY) | ||
| 161 | : `(section source-repository ,$1 ,$3) | ||
| 162 | (SOURCE-REPO open properties close) | ||
| 163 | : `(section source-repository ,$1 ,$3)) | ||
| 164 | (properties (properties PROPERTY) : (append $1 (list $2)) | ||
| 165 | (PROPERTY) : (list $1)) | ||
| 166 | (executables (executables exec-sec) : (append $1 (list $2)) | ||
| 167 | (exec-sec) : (list $1)) | ||
| 168 | (exec-sec (EXEC OCURLY exprs CCURLY) : `(section executable ,$1 ,$3) | ||
| 169 | (EXEC open exprs close) : `(section executable ,$1 ,$3)) | ||
| 170 | (test-suites (test-suites ts-sec) : (append $1 (list $2)) | ||
| 171 | (ts-sec) : (list $1)) | ||
| 172 | (ts-sec (TEST-SUITE OCURLY exprs CCURLY) : `(section test-suite ,$1 ,$3) | ||
| 173 | (TEST-SUITE open exprs close) : `(section test-suite ,$1 ,$3)) | ||
| 174 | (benchmarks (benchmarks bm-sec) : (append $1 (list $2)) | ||
| 175 | (bm-sec) : (list $1)) | ||
| 176 | (bm-sec (BENCHMARK OCURLY exprs CCURLY) : `(section benchmark ,$1 ,$3) | ||
| 177 | (BENCHMARK open exprs close) : `(section benchmark ,$1 ,$3)) | ||
| 178 | (lib-sec (LIB OCURLY exprs CCURLY) : `(section library ,$3) | ||
| 179 | (LIB open exprs close) : `(section library ,$3)) | ||
| 180 | (exprs (exprs PROPERTY) : (append $1 (list $2)) | ||
| 181 | (PROPERTY) : (list $1) | ||
| 182 | (exprs if-then-else) : (append $1 (list $2)) | ||
| 183 | (if-then-else) : (list $1) | ||
| 184 | (exprs if-then) : (append $1 (list $2)) | ||
| 185 | (if-then) : (list $1)) | ||
| 186 | (if-then-else (IF tests OCURLY exprs CCURLY ELSE OCURLY exprs CCURLY) | ||
| 187 | : `(if ,$2 ,$4 ,$8) | ||
| 188 | (IF tests open exprs close ELSE OCURLY exprs CCURLY) | ||
| 189 | : `(if ,$2 ,$4 ,$8) | ||
| 190 | ;; The 'open' token after 'tests' is shifted after an 'exprs' | ||
| 191 | ;; is found. This is because, instead of 'exprs' a 'OCURLY' | ||
| 192 | ;; token is a valid alternative. For this reason, 'open' | ||
| 193 | ;; pushes a <parse-context> with a line indentation equal to | ||
| 194 | ;; the indentation of 'exprs'. | ||
| 195 | ;; | ||
| 196 | ;; Differently from this, without the rule above this | ||
| 197 | ;; comment, when an 'ELSE' token is found, the 'open' token | ||
| 198 | ;; following the 'ELSE' would be shifted immediately, before | ||
| 199 | ;; the 'exprs' is found (because there are no other valid | ||
| 200 | ;; tokens). The 'open' would therefore create a | ||
| 201 | ;; <parse-context> with the indentation of 'ELSE' and not | ||
| 202 | ;; 'exprs', creating an inconsistency. We therefore allow | ||
| 203 | ;; mixed style conditionals. | ||
| 204 | (IF tests open exprs close ELSE open exprs close) | ||
| 205 | : `(if ,$2 ,$4 ,$8)) | ||
| 206 | (if-then (IF tests OCURLY exprs CCURLY) : `(if ,$2 ,$4 ()) | ||
| 207 | (IF tests open exprs close) : `(if ,$2 ,$4 ())) | ||
| 208 | (tests (TEST OPAREN ID CPAREN) : `(,$1 ,$3) | ||
| 209 | (TEST OPAREN ID RELATION VERSION CPAREN) | ||
| 210 | : `(,$1 ,(string-append $3 " " $4 " " $5)) | ||
| 211 | (TEST OPAREN ID RELATION VERSION AND RELATION VERSION CPAREN) | ||
| 212 | : `(and (,$1 ,(string-append $3 " " $4 " " $5)) | ||
| 213 | (,$1 ,(string-append $3 " " $7 " " $8))) | ||
| 214 | (NOT tests) : `(not ,$2) | ||
| 215 | (tests AND tests) : `(and ,$1 ,$3) | ||
| 216 | (tests OR tests) : `(or ,$1 ,$3) | ||
| 217 | (OPAREN tests CPAREN) : $2) | ||
| 218 | (open () : (context-stack-push! | ||
| 219 | (make-parse-context (context layout) | ||
| 220 | (current-indentation)))) | ||
| 221 | (close (VCCURLY)))) | ||
| 222 | |||
| 223 | (define (peek-next-line-indent port) | ||
| 224 | "This function can be called when the next character on PORT is #\newline | ||
| 225 | and returns the indentation of the line starting after the #\newline | ||
| 226 | character. Discard (and consume) empty and comment lines." | ||
| 227 | (let ((initial-newline (string (read-char port)))) | ||
| 228 | (let loop ((char (peek-char port)) | ||
| 229 | (word "")) | ||
| 230 | (cond ((eqv? char #\newline) (read-char port) | ||
| 231 | (loop (peek-char port) "")) | ||
| 232 | ((or (eqv? char #\space) (eqv? char #\tab)) | ||
| 233 | (let ((c (read-char port))) | ||
| 234 | (loop (peek-char port) (string-append word (string c))))) | ||
| 235 | ((comment-line port char) (loop (peek-char port) "")) | ||
| 236 | (else | ||
| 237 | (let ((len (string-length word))) | ||
| 238 | (unread-string (string-append initial-newline word) port) | ||
| 239 | len)))))) | ||
| 240 | |||
| 241 | (define* (read-value port value min-indent #:optional (separator " ")) | ||
| 242 | "The next character on PORT must be #\newline. Append to VALUE the | ||
| 243 | following lines with indentation larger than MIN-INDENT." | ||
| 244 | (let loop ((val (string-trim-both value)) | ||
| 245 | (x (peek-next-line-indent port))) | ||
| 246 | (if (> x min-indent) | ||
| 247 | (begin | ||
| 248 | (read-char port) ; consume #\newline | ||
| 249 | (loop (string-append | ||
| 250 | val (if (string-null? val) "" separator) | ||
| 251 | (string-trim-both (read-delimited "\n" port 'peek))) | ||
| 252 | (peek-next-line-indent port))) | ||
| 253 | val))) | ||
| 254 | |||
| 255 | (define (lex-white-space port bol) | ||
| 256 | "Consume white spaces and comment lines on PORT. If a new line is started return #t, | ||
| 257 | otherwise return BOL (beginning-of-line)." | ||
| 258 | (let loop ((c (peek-char port)) | ||
| 259 | (bol bol)) | ||
| 260 | (cond | ||
| 261 | ((and (not (eof-object? c)) | ||
| 262 | (or (char=? c #\space) (char=? c #\tab))) | ||
| 263 | (read-char port) | ||
| 264 | (loop (peek-char port) bol)) | ||
| 265 | ((and (not (eof-object? c)) (char=? c #\newline)) | ||
| 266 | (read-char port) | ||
| 267 | (loop (peek-char port) #t)) | ||
| 268 | ((comment-line port c) | ||
| 269 | (lex-white-space port bol)) | ||
| 270 | (else | ||
| 271 | bol)))) | ||
| 272 | |||
| 273 | (define (lex-bol port) | ||
| 274 | "Process the beginning of a line on PORT: update current-indentation and | ||
| 275 | check the end of an indentation based context." | ||
| 276 | (let ((loc (make-source-location (cabal-file-name) (port-line port) | ||
| 277 | (port-column port) -1 -1))) | ||
| 278 | (current-indentation (source-location-column loc)) | ||
| 279 | (case (get-offside port) | ||
| 280 | ((less-than) | ||
| 281 | (check-bol? #t) ; need to check if closing more than 1 indent level. | ||
| 282 | (unless (context-stack-empty?) (context-stack-pop!)) | ||
| 283 | (make-lexical-token 'VCCURLY loc #f)) | ||
| 284 | (else | ||
| 285 | (lex-token port))))) | ||
| 286 | |||
| 287 | (define (bol? port) (or (check-bol?) (= (port-column port) 0))) | ||
| 288 | |||
| 289 | (define (comment-line port c) | ||
| 290 | "If PORT starts with a comment line, consume it up to, but not including | ||
| 291 | #\newline. C is the next character on PORT." | ||
| 292 | (cond ((and (not (eof-object? c)) (char=? c #\-)) | ||
| 293 | (read-char port) | ||
| 294 | (let ((c2 (peek-char port))) | ||
| 295 | (if (char=? c2 #\-) | ||
| 296 | (read-delimited "\n" port 'peek) | ||
| 297 | (begin (unread-char c port) #f)))) | ||
| 298 | (else #f))) | ||
| 299 | |||
| 300 | (define-enumeration ordering (less-than equal greater-than) make-ordering) | ||
| 301 | |||
| 302 | (define (get-offside port) | ||
| 303 | "In an indentation based context return the symbol 'greater-than, 'equal or | ||
| 304 | 'less-than to signal if the current column number on PORT is greater-, equal-, | ||
| 305 | or less-than the indentation of the current context." | ||
| 306 | (let ((x (port-column port))) | ||
| 307 | (match (context-stack-top) | ||
| 308 | (($ <parse-context> 'layout indentation) | ||
| 309 | (cond | ||
| 310 | ((> x indentation) (ordering greater-than)) | ||
| 311 | ((= x indentation) (ordering equal)) | ||
| 312 | (else (ordering less-than)))) | ||
| 313 | (_ (ordering greater-than))))) | ||
| 314 | |||
| 315 | ;; (Semi-)Predicates for individual tokens. | ||
| 316 | |||
| 317 | (define (is-relation? c) | ||
| 318 | (and (char? c) (any (cut char=? c <>) '(#\< #\> #\=)))) | ||
| 319 | |||
| 320 | (define (make-rx-matcher pat) | ||
| 321 | "Compile PAT into a regular expression and creates a function matching a | ||
| 322 | string against the created regexp." | ||
| 323 | (let ((rx (make-regexp pat))) (cut regexp-exec rx <>))) | ||
| 324 | |||
| 325 | (define is-property (make-rx-matcher "([a-zA-Z0-9-]+):[ \t]*(\\w?.*)$")) | ||
| 326 | |||
| 327 | (define is-flag (make-rx-matcher "^[Ff]lag +([a-zA-Z0-9_-]+)")) | ||
| 328 | |||
| 329 | (define is-src-repo | ||
| 330 | (make-rx-matcher "^[Ss]ource-[Rr]epository +([a-zA-Z0-9_-]+)")) | ||
| 331 | |||
| 332 | (define is-exec (make-rx-matcher "^[Ee]xecutable +([a-zA-Z0-9_-]+)")) | ||
| 333 | |||
| 334 | (define is-test-suite (make-rx-matcher "^[Tt]est-[Ss]uite +([a-zA-Z0-9_-]+)")) | ||
| 335 | |||
| 336 | (define is-benchmark (make-rx-matcher "^[Bb]enchmark +([a-zA-Z0-9_-]+)")) | ||
| 337 | |||
| 338 | (define is-lib (make-rx-matcher "^[Ll]ibrary *")) | ||
| 339 | |||
| 340 | (define is-else (make-rx-matcher "^else")) | ||
| 341 | |||
| 342 | (define (is-if s) (string=? s "if")) | ||
| 343 | |||
| 344 | (define (is-and s) (string=? s "&&")) | ||
| 345 | |||
| 346 | (define (is-or s) (string=? s "||")) | ||
| 347 | |||
| 348 | (define (is-id s) | ||
| 349 | (let ((cabal-reserved-words | ||
| 350 | '("if" "else" "library" "flag" "executable" "test-suite" | ||
| 351 | "source-repository" "benchmark"))) | ||
| 352 | (and (every (cut string-ci<> s <>) cabal-reserved-words) | ||
| 353 | (not (char=? (last (string->list s)) #\:))))) | ||
| 354 | |||
| 355 | (define (is-test s port) | ||
| 356 | (let ((tests-rx (make-regexp "os|arch|flag|impl")) | ||
| 357 | (c (peek-char port))) | ||
| 358 | (and (regexp-exec tests-rx s) (char=? #\( c)))) | ||
| 359 | |||
| 360 | ;; Lexers for individual tokens. | ||
| 361 | |||
| 362 | (define (lex-relation loc port) | ||
| 363 | (make-lexical-token 'RELATION loc (read-while is-relation? port))) | ||
| 364 | |||
| 365 | (define (lex-version loc port) | ||
| 366 | (make-lexical-token 'VERSION loc | ||
| 367 | (read-while char-numeric? port | ||
| 368 | (cut char=? #\. <>) char-numeric?))) | ||
| 369 | |||
| 370 | (define* (read-while is? port #:optional | ||
| 371 | (is-if-followed-by? (lambda (c) #f)) | ||
| 372 | (is-allowed-follower? (lambda (c) #f))) | ||
| 373 | "Read from PORT as long as: (i) either the read character satisfies the | ||
| 374 | predicate IS?, or (ii) it satisfies the predicate IS-IF-FOLLOWED-BY? and the | ||
| 375 | character immediately following it satisfies IS-ALLOWED-FOLLOWER?. Returns a | ||
| 376 | string with the read characters." | ||
| 377 | (let loop ((c (peek-char port)) | ||
| 378 | (res '())) | ||
| 379 | (cond ((and (not (eof-object? c)) (is? c)) | ||
| 380 | (let ((c (read-char port))) | ||
| 381 | (loop (peek-char port) (append res (list c))))) | ||
| 382 | ((and (not (eof-object? c)) (is-if-followed-by? c)) | ||
| 383 | (let ((c (read-char port)) | ||
| 384 | (c2 (peek-char port))) | ||
| 385 | (if (and (not (eof-object? c2)) (is-allowed-follower? c2)) | ||
| 386 | (loop c2 (append res (list c))) | ||
| 387 | (begin (unread-char c) (list->string res))))) | ||
| 388 | (else (list->string res))))) | ||
| 389 | |||
| 390 | (define (lex-property k-v-rx-res loc port) | ||
| 391 | (let ((key (string-downcase (match:substring k-v-rx-res 1))) | ||
| 392 | (value (match:substring k-v-rx-res 2))) | ||
| 393 | (make-lexical-token | ||
| 394 | 'PROPERTY loc | ||
| 395 | (list key `(,(read-value port value (current-indentation))))))) | ||
| 396 | |||
| 397 | (define (lex-rx-res rx-res token loc) | ||
| 398 | (let ((name (string-downcase (match:substring rx-res 1)))) | ||
| 399 | (make-lexical-token token loc name))) | ||
| 400 | |||
| 401 | (define (lex-flag flag-rx-res loc) (lex-rx-res flag-rx-res 'FLAG loc)) | ||
| 402 | |||
| 403 | (define (lex-src-repo src-repo-rx-res loc) | ||
| 404 | (lex-rx-res src-repo-rx-res 'SOURCE-REPO loc)) | ||
| 405 | |||
| 406 | (define (lex-exec exec-rx-res loc) (lex-rx-res exec-rx-res 'EXEC loc)) | ||
| 407 | |||
| 408 | (define (lex-test-suite ts-rx-res loc) (lex-rx-res ts-rx-res 'TEST-SUITE loc)) | ||
| 409 | |||
| 410 | (define (lex-benchmark bm-rx-res loc) (lex-rx-res bm-rx-res 'BENCHMARK loc)) | ||
| 411 | |||
| 412 | (define (lex-lib loc) (make-lexical-token 'LIB loc #f)) | ||
| 413 | |||
| 414 | (define (lex-else loc) (make-lexical-token 'ELSE loc #f)) | ||
| 415 | |||
| 416 | (define (lex-if loc) (make-lexical-token 'IF loc #f)) | ||
| 417 | |||
| 418 | (define (lex-and loc) (make-lexical-token 'AND loc #f)) | ||
| 419 | |||
| 420 | (define (lex-or loc) (make-lexical-token 'OR loc #f)) | ||
| 421 | |||
| 422 | (define (lex-id w loc) (make-lexical-token 'ID loc w)) | ||
| 423 | |||
| 424 | (define (lex-test w loc) (make-lexical-token 'TEST loc (string->symbol w))) | ||
| 425 | |||
| 426 | ;; Lexer for tokens recognizable by single char. | ||
| 427 | |||
| 428 | (define* (is-ref-char->token ref-char next-char token loc port | ||
| 429 | #:optional (hook-fn #f)) | ||
| 430 | "If the next character NEXT-CHAR on PORT is REF-CHAR, then read it, | ||
| 431 | execute HOOK-FN if it isn't #f and return a lexical token of type TOKEN with | ||
| 432 | location information LOC." | ||
| 433 | (cond ((char=? next-char ref-char) | ||
| 434 | (read-char port) | ||
| 435 | (when hook-fn (hook-fn)) | ||
| 436 | (make-lexical-token token loc (string next-char))) | ||
| 437 | (else #f))) | ||
| 438 | |||
| 439 | (define (is-ocurly->token c loc port) | ||
| 440 | (is-ref-char->token #\{ c 'OCURLY loc port | ||
| 441 | (lambda () | ||
| 442 | (context-stack-push! (make-parse-context | ||
| 443 | (context no-layout) #f))))) | ||
| 444 | |||
| 445 | (define (is-ccurly->token c loc port) | ||
| 446 | (is-ref-char->token #\} c 'CCURLY loc port (lambda () (context-stack-pop!)))) | ||
| 447 | |||
| 448 | (define (is-oparen->token c loc port) | ||
| 449 | (is-ref-char->token #\( c 'OPAREN loc port)) | ||
| 450 | |||
| 451 | (define (is-cparen->token c loc port) | ||
| 452 | (is-ref-char->token #\) c 'CPAREN loc port)) | ||
| 453 | |||
| 454 | (define (is-not->token c loc port) | ||
| 455 | (is-ref-char->token #\! c 'NOT loc port)) | ||
| 456 | |||
| 457 | (define (is-version? c) (char-numeric? c)) | ||
| 458 | |||
| 459 | ;; Main lexer functions | ||
| 460 | |||
| 461 | (define (lex-single-char port loc) | ||
| 462 | "Process tokens which can be recognised by peeking the next character on | ||
| 463 | PORT. If no token can be recognized return #f. LOC is the current port | ||
| 464 | location." | ||
| 465 | (let* ((c (peek-char port))) | ||
| 466 | (cond ((eof-object? c) (read-char port) '*eoi*) | ||
| 467 | ((is-ocurly->token c loc port)) | ||
| 468 | ((is-ccurly->token c loc port)) | ||
| 469 | ((is-oparen->token c loc port)) | ||
| 470 | ((is-cparen->token c loc port)) | ||
| 471 | ((is-not->token c loc port)) | ||
| 472 | ((is-version? c) (lex-version loc port)) | ||
| 473 | ((is-relation? c) (lex-relation loc port)) | ||
| 474 | (else | ||
| 475 | #f)))) | ||
| 476 | |||
| 477 | (define (lex-word port loc) | ||
| 478 | "Process tokens which can be recognized by reading the next word form PORT. | ||
| 479 | LOC is the current port location." | ||
| 480 | (let* ((w (read-delimited " ()\t\n" port 'peek))) | ||
| 481 | (cond ((is-if w) (lex-if loc)) | ||
| 482 | ((is-test w port) (lex-test w loc)) | ||
| 483 | ((is-and w) (lex-and loc)) | ||
| 484 | ((is-or w) (lex-or loc)) | ||
| 485 | ((is-id w) (lex-id w loc)) | ||
| 486 | (else (unread-string w port) #f)))) | ||
| 487 | |||
| 488 | (define (lex-line port loc) | ||
| 489 | "Process tokens which can be recognised by reading a line from PORT. LOC is | ||
| 490 | the current port location." | ||
| 491 | (let* ((s (read-delimited "\n{}" port 'peek))) | ||
| 492 | (cond | ||
| 493 | ((is-property s) => (cut lex-property <> loc port)) | ||
| 494 | ((is-flag s) => (cut lex-flag <> loc)) | ||
| 495 | ((is-src-repo s) => (cut lex-src-repo <> loc)) | ||
| 496 | ((is-exec s) => (cut lex-exec <> loc)) | ||
| 497 | ((is-test-suite s) => (cut lex-test-suite <> loc)) | ||
| 498 | ((is-benchmark s) => (cut lex-benchmark <> loc)) | ||
| 499 | ((is-lib s) (lex-lib loc)) | ||
| 500 | ((is-else s) (lex-else loc)) | ||
| 501 | (else | ||
| 502 | #f)))) | ||
| 503 | |||
| 504 | (define (lex-token port) | ||
| 505 | (let* ((loc (make-source-location (cabal-file-name) (port-line port) | ||
| 506 | (port-column port) -1 -1))) | ||
| 507 | (or (lex-single-char port loc) (lex-word port loc) (lex-line port loc)))) | ||
| 508 | |||
| 509 | ;; Lexer- and error-function generators | ||
| 510 | |||
| 511 | (define (errorp) | ||
| 512 | "Generates the lexer error function." | ||
| 513 | (let ((p (current-error-port))) | ||
| 514 | (lambda (message . args) | ||
| 515 | (format p "~a" message) | ||
| 516 | (if (and (pair? args) (lexical-token? (car args))) | ||
| 517 | (let* ((token (car args)) | ||
| 518 | (source (lexical-token-source token)) | ||
| 519 | (line (source-location-line source)) | ||
| 520 | (column (source-location-column source))) | ||
| 521 | (format p "~a " (or (lexical-token-value token) | ||
| 522 | (lexical-token-category token))) | ||
| 523 | (when (and (number? line) (number? column)) | ||
| 524 | (format p "(at line ~a, column ~a)" (1+ line) column))) | ||
| 525 | (for-each display args)) | ||
| 526 | (format p "~%")))) | ||
| 527 | |||
| 528 | (define (make-lexer port) | ||
| 529 | "Generate the Cabal lexical analyser reading from PORT." | ||
| 530 | (let ((p port)) | ||
| 531 | (lambda () | ||
| 532 | (let ((bol (lex-white-space p (bol? p)))) | ||
| 533 | (check-bol? #f) | ||
| 534 | (if bol (lex-bol p) (lex-token p)))))) | ||
| 535 | |||
| 536 | (define* (read-cabal #:optional (port (current-input-port)) | ||
| 537 | (file-name #f)) | ||
| 538 | "Read a Cabal file from PORT. FILE-NAME is a string used in error messages. | ||
| 539 | If #f use the function 'port-filename' to obtain it." | ||
| 540 | (let ((cabal-parser (make-cabal-parser))) | ||
| 541 | (parameterize ((cabal-file-name | ||
| 542 | (or file-name (port-filename port) "standard input")) | ||
| 543 | (current-indentation 0) | ||
| 544 | (check-bol? #f) | ||
| 545 | (context-stack (make-stack))) | ||
| 546 | (cabal-parser (make-lexer port) (errorp))))) | ||
| 547 | |||
| 548 | ;; Part 2: | ||
| 549 | ;; | ||
| 550 | ;; Evaluate the S-expression returned by 'read-cabal'. | ||
| 551 | |||
| 552 | ;; This defines the object and interface that we provide to access the Cabal | ||
| 553 | ;; file information. Note that this does not include all the pieces of | ||
| 554 | ;; information of the Cabal file, but only the ones we currently are | ||
| 555 | ;; interested in. | ||
| 556 | (define-record-type <cabal-package> | ||
| 557 | (make-cabal-package name version license home-page source-repository | ||
| 558 | synopsis description | ||
| 559 | executables lib test-suites | ||
| 560 | flags eval-environment) | ||
| 561 | cabal-package? | ||
| 562 | (name cabal-package-name) | ||
| 563 | (version cabal-package-version) | ||
| 564 | (license cabal-package-license) | ||
| 565 | (home-page cabal-package-home-page) | ||
| 566 | (source-repository cabal-package-source-repository) | ||
| 567 | (synopsis cabal-package-synopsis) | ||
| 568 | (description cabal-package-description) | ||
| 569 | (executables cabal-package-executables) | ||
| 570 | (lib cabal-package-library) ; 'library' is a Scheme keyword | ||
| 571 | (test-suites cabal-package-test-suites) | ||
| 572 | (flags cabal-package-flags) | ||
| 573 | (eval-environment cabal-package-eval-environment)) ; alist | ||
| 574 | |||
| 575 | (set-record-type-printer! <cabal-package> | ||
| 576 | (lambda (package port) | ||
| 577 | (format port "#<cabal-package ~a-~a>" | ||
| 578 | (cabal-package-name package) | ||
| 579 | (cabal-package-version package)))) | ||
| 580 | |||
| 581 | (define-record-type <cabal-source-repository> | ||
| 582 | (make-cabal-source-repository use-case type location) | ||
| 583 | cabal-source-repository? | ||
| 584 | (use-case cabal-source-repository-use-case) | ||
| 585 | (type cabal-source-repository-type) | ||
| 586 | (location cabal-source-repository-location)) | ||
| 587 | |||
| 588 | ;; We need to be able to distinguish the value of a flag from the Scheme #t | ||
| 589 | ;; and #f values. | ||
| 590 | (define-record-type <cabal-flag> | ||
| 591 | (make-cabal-flag name description default manual) | ||
| 592 | cabal-flag? | ||
| 593 | (name cabal-flag-name) | ||
| 594 | (description cabal-flag-description) | ||
| 595 | (default cabal-flag-default) ; 'true or 'false | ||
| 596 | (manual cabal-flag-manual)) ; 'true or 'false | ||
| 597 | |||
| 598 | (set-record-type-printer! <cabal-flag> | ||
| 599 | (lambda (package port) | ||
| 600 | (format port "#<cabal-flag ~a default:~a>" | ||
| 601 | (cabal-flag-name package) | ||
| 602 | (cabal-flag-default package)))) | ||
| 603 | |||
| 604 | (define-record-type <cabal-dependency> | ||
| 605 | (make-cabal-dependency name version) | ||
| 606 | cabal-dependency? | ||
| 607 | (name cabal-dependency-name) | ||
| 608 | (version cabal-dependency-version)) | ||
| 609 | |||
| 610 | (define-record-type <cabal-executable> | ||
| 611 | (make-cabal-executable name dependencies) | ||
| 612 | cabal-executable? | ||
| 613 | (name cabal-executable-name) | ||
| 614 | (dependencies cabal-executable-dependencies)) ; list of <cabal-dependency> | ||
| 615 | |||
| 616 | (define-record-type <cabal-library> | ||
| 617 | (make-cabal-library dependencies) | ||
| 618 | cabal-library? | ||
| 619 | (dependencies cabal-library-dependencies)) ; list of <cabal-dependency> | ||
| 620 | |||
| 621 | (define-record-type <cabal-test-suite> | ||
| 622 | (make-cabal-test-suite name dependencies) | ||
| 623 | cabal-test-suite? | ||
| 624 | (name cabal-test-suite-name) | ||
| 625 | (dependencies cabal-test-suite-dependencies)) ; list of <cabal-dependency> | ||
| 626 | |||
| 627 | (define (cabal-flags->alist flag-list) | ||
| 628 | "Retrun an alist associating the flag name to its default value from a | ||
| 629 | list of <cabal-flag> objects." | ||
| 630 | (map (lambda (flag) (cons (cabal-flag-name flag) (cabal-flag-default flag))) | ||
| 631 | flag-list)) | ||
| 632 | |||
| 633 | (define (eval-cabal cabal-sexp env) | ||
| 634 | "Given the CABAL-SEXP produced by 'read-cabal', evaluate all conditionals | ||
| 635 | and return a 'cabal-package' object. The values of all tests can be | ||
| 636 | overwritten by specifying the desired value in ENV. ENV must be an alist. | ||
| 637 | The accepted keys are: \"os\", \"arch\", \"impl\" and a name of a flag. The | ||
| 638 | value associated with a flag has to be either \"true\" or \"false\". The | ||
| 639 | value associated with other keys has to conform to the Cabal file format | ||
| 640 | definition." | ||
| 641 | (define (os name) | ||
| 642 | (let ((env-os (or (assoc-ref env "os") "linux"))) | ||
| 643 | (string-match env-os name))) | ||
| 644 | |||
| 645 | (define (arch name) | ||
| 646 | (let ((env-arch (or (assoc-ref env "arch") "x86_64"))) | ||
| 647 | (string-match env-arch name))) | ||
| 648 | |||
| 649 | (define (comp-name+version haskell) | ||
| 650 | "Extract the compiler name and version from the string HASKELL." | ||
| 651 | (let* ((matcher-fn (make-rx-matcher "([a-zA-Z0-9_]+)-([0-9.]+)")) | ||
| 652 | (name (or (and=> (matcher-fn haskell) (cut match:substring <> 1)) | ||
| 653 | haskell)) | ||
| 654 | (version (and=> (matcher-fn haskell) (cut match:substring <> 2)))) | ||
| 655 | (values name version))) | ||
| 656 | |||
| 657 | (define (comp-spec-name+op+version spec) | ||
| 658 | "Extract the compiler specification from SPEC. Return the compiler name, | ||
| 659 | the ordering operation and the version." | ||
| 660 | (let* ((with-ver-matcher-fn (make-rx-matcher | ||
| 661 | "([a-zA-Z0-9_-]+) *([<>=]+) *([0-9.]+) *")) | ||
| 662 | (without-ver-matcher-fn (make-rx-matcher "([a-zA-Z0-9_-]+)")) | ||
| 663 | (name (or (and=> (with-ver-matcher-fn spec) | ||
| 664 | (cut match:substring <> 1)) | ||
| 665 | (match:substring (without-ver-matcher-fn spec) 1))) | ||
| 666 | (operator (and=> (with-ver-matcher-fn spec) | ||
| 667 | (cut match:substring <> 2))) | ||
| 668 | (version (and=> (with-ver-matcher-fn spec) | ||
| 669 | (cut match:substring <> 3)))) | ||
| 670 | (values name operator version))) | ||
| 671 | |||
| 672 | (define (impl haskell) | ||
| 673 | (let*-values (((comp-name comp-ver) | ||
| 674 | (comp-name+version (or (assoc-ref env "impl") "ghc"))) | ||
| 675 | ((spec-name spec-op spec-ver) | ||
| 676 | (comp-spec-name+op+version haskell))) | ||
| 677 | (if (and spec-ver comp-ver) | ||
| 678 | (eval-string | ||
| 679 | (string-append "(string" spec-op " \"" comp-name "\"" | ||
| 680 | " \"" spec-name "-" spec-ver "\")")) | ||
| 681 | (string-match spec-name comp-name)))) | ||
| 682 | |||
| 683 | (define (cabal-flags) | ||
| 684 | (make-cabal-section cabal-sexp 'flag)) | ||
| 685 | |||
| 686 | (define (flag name) | ||
| 687 | (let ((value (or (assoc-ref env name) | ||
| 688 | (assoc-ref (cabal-flags->alist (cabal-flags)) name)))) | ||
| 689 | (if (eq? value 'false) #f #t))) | ||
| 690 | |||
| 691 | (define (eval sexp) | ||
| 692 | (match sexp | ||
| 693 | (() '()) | ||
| 694 | ;; nested 'if' | ||
| 695 | ((('if predicate true-group false-group) rest ...) | ||
| 696 | (append (if (eval predicate) | ||
| 697 | (eval true-group) | ||
| 698 | (eval false-group)) | ||
| 699 | (eval rest))) | ||
| 700 | (('if predicate true-group false-group) | ||
| 701 | (if (eval predicate) | ||
| 702 | (eval true-group) | ||
| 703 | (eval false-group))) | ||
| 704 | (('flag name) (flag name)) | ||
| 705 | (('os name) (os name)) | ||
| 706 | (('arch name) (arch name)) | ||
| 707 | (('impl name) (impl name)) | ||
| 708 | (('not name) (not (eval name))) | ||
| 709 | ;; 'and' and 'or' aren't functions, thus we can't use apply | ||
| 710 | (('and args ...) (fold (lambda (e s) (and e s)) #t (eval args))) | ||
| 711 | (('or args ...) (fold (lambda (e s) (or e s)) #f (eval args))) | ||
| 712 | ;; no need to evaluate flag parameters | ||
| 713 | (('section 'flag name parameters) | ||
| 714 | (list 'section 'flag name parameters)) | ||
| 715 | ;; library does not have a name parameter | ||
| 716 | (('section 'library parameters) | ||
| 717 | (list 'section 'library (eval parameters))) | ||
| 718 | (('section type name parameters) | ||
| 719 | (list 'section type name (eval parameters))) | ||
| 720 | (((? string? name) values) | ||
| 721 | (list name values)) | ||
| 722 | ((element rest ...) | ||
| 723 | (cons (eval element) (eval rest))) | ||
| 724 | (_ (raise (condition | ||
| 725 | (&message (message "Failed to evaluate Cabal file. \ | ||
| 726 | See the manual for limitations."))))))) | ||
| 727 | |||
| 728 | (define (cabal-evaluated-sexp->package evaluated-sexp) | ||
| 729 | (let* ((name (lookup-join evaluated-sexp "name")) | ||
| 730 | (version (lookup-join evaluated-sexp "version")) | ||
| 731 | (license (lookup-join evaluated-sexp "license")) | ||
| 732 | (home-page (lookup-join evaluated-sexp "homepage")) | ||
| 733 | (home-page-or-hackage | ||
| 734 | (if (string-null? home-page) | ||
| 735 | (string-append "http://hackage.haskell.org/package/" name) | ||
| 736 | home-page)) | ||
| 737 | (source-repository (make-cabal-section evaluated-sexp | ||
| 738 | 'source-repository)) | ||
| 739 | (synopsis (lookup-join evaluated-sexp "synopsis")) | ||
| 740 | (description (lookup-join evaluated-sexp "description")) | ||
| 741 | (executables (make-cabal-section evaluated-sexp 'executable)) | ||
| 742 | (lib (make-cabal-section evaluated-sexp 'library)) | ||
| 743 | (test-suites (make-cabal-section evaluated-sexp 'test-suite)) | ||
| 744 | (flags (make-cabal-section evaluated-sexp 'flag)) | ||
| 745 | (eval-environment '())) | ||
| 746 | (make-cabal-package name version license home-page-or-hackage | ||
| 747 | source-repository synopsis description executables lib | ||
| 748 | test-suites flags eval-environment))) | ||
| 749 | |||
| 750 | ((compose cabal-evaluated-sexp->package eval) cabal-sexp)) | ||
| 751 | |||
| 752 | (define (make-cabal-section sexp section-type) | ||
| 753 | "Given an SEXP as produced by 'read-cabal', produce a list of objects | ||
| 754 | pertaining to SECTION-TYPE sections. SECTION-TYPE must be one of: | ||
| 755 | 'executable, 'flag, 'test-suite, 'source-repository or 'library." | ||
| 756 | (filter-map (cut match <> | ||
| 757 | (('section (? (cut equal? <> section-type)) name parameters) | ||
| 758 | (case section-type | ||
| 759 | ((test-suite) (make-cabal-test-suite | ||
| 760 | name (dependencies parameters))) | ||
| 761 | ((executable) (make-cabal-executable | ||
| 762 | name (dependencies parameters))) | ||
| 763 | ((source-repository) (make-cabal-source-repository | ||
| 764 | name | ||
| 765 | (lookup-join parameters "type") | ||
| 766 | (lookup-join parameters "location"))) | ||
| 767 | ((flag) | ||
| 768 | (let* ((default (lookup-join parameters "default")) | ||
| 769 | (default-true-or-false | ||
| 770 | (if (and default (string-ci=? "false" default)) | ||
| 771 | 'false | ||
| 772 | 'true)) | ||
| 773 | (description (lookup-join parameters "description")) | ||
| 774 | (manual (lookup-join parameters "manual")) | ||
| 775 | (manual-true-or-false | ||
| 776 | (if (and manual (string-ci=? "true" manual)) | ||
| 777 | 'true | ||
| 778 | 'false))) | ||
| 779 | (make-cabal-flag name description | ||
| 780 | default-true-or-false | ||
| 781 | manual-true-or-false))) | ||
| 782 | (else #f))) | ||
| 783 | (('section (? (cut equal? <> section-type) lib) parameters) | ||
| 784 | (make-cabal-library (dependencies parameters))) | ||
| 785 | (_ #f)) | ||
| 786 | sexp)) | ||
| 787 | |||
| 788 | (define* (lookup-join key-values-list key #:optional (delimiter " ")) | ||
| 789 | "Lookup and joint all values pertaining to keys of value KEY in | ||
| 790 | KEY-VALUES-LIST. The optional DELIMITER is used to specify a delimiter string | ||
| 791 | to be added between the values found in different key/value pairs." | ||
| 792 | (string-join | ||
| 793 | (filter-map (cut match <> | ||
| 794 | (((? (lambda(x) (equal? x key))) value) | ||
| 795 | (string-join value delimiter)) | ||
| 796 | (_ #f)) | ||
| 797 | key-values-list) | ||
| 798 | delimiter)) | ||
| 799 | |||
| 800 | (define dependency-name-version-rx | ||
| 801 | (make-regexp "([a-zA-Z0-9_-]+) *(.*)")) | ||
| 802 | |||
| 803 | (define (dependencies key-values-list) | ||
| 804 | "Return a list of 'cabal-dependency' objects for the dependencies found in | ||
| 805 | KEY-VALUES-LIST." | ||
| 806 | (let ((deps (string-tokenize (lookup-join key-values-list "build-depends" ",") | ||
| 807 | (char-set-complement (char-set #\,))))) | ||
| 808 | (map (lambda (d) | ||
| 809 | (let ((rx-result (regexp-exec dependency-name-version-rx d))) | ||
| 810 | (make-cabal-dependency | ||
| 811 | (match:substring rx-result 1) | ||
| 812 | (match:substring rx-result 2)))) | ||
| 813 | deps))) | ||
| 814 | |||
| 815 | ;;; cabal.scm ends here | ||
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 1b27803dba0..b5574a8d9fe 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm | |||
| @@ -18,28 +18,19 @@ | |||
| 18 | 18 | ||
| 19 | (define-module (guix import hackage) | 19 | (define-module (guix import hackage) |
| 20 | #:use-module (ice-9 match) | 20 | #:use-module (ice-9 match) |
| 21 | #:use-module (ice-9 regex) | ||
| 22 | #:use-module (ice-9 rdelim) | ||
| 23 | #:use-module (ice-9 receive) | ||
| 24 | #:use-module (ice-9 pretty-print) | ||
| 25 | #:use-module (srfi srfi-26) | 21 | #:use-module (srfi srfi-26) |
| 26 | #:use-module (srfi srfi-34) | ||
| 27 | #:use-module (srfi srfi-35) | ||
| 28 | #:use-module (srfi srfi-11) | 22 | #:use-module (srfi srfi-11) |
| 29 | #:use-module (srfi srfi-1) | 23 | #:use-module (srfi srfi-1) |
| 30 | #:use-module ((guix download) #:select (download-to-store)) | 24 | #:use-module ((guix download) #:select (download-to-store)) |
| 31 | #:use-module ((guix utils) #:select (package-name->name+version)) | 25 | #:use-module ((guix utils) #:select (package-name->name+version)) |
| 32 | #:use-module (guix import utils) | 26 | #:use-module (guix import utils) |
| 27 | #:use-module (guix import cabal) | ||
| 33 | #:use-module (guix store) | 28 | #:use-module (guix store) |
| 34 | #:use-module (guix hash) | 29 | #:use-module (guix hash) |
| 35 | #:use-module (guix base32) | 30 | #:use-module (guix base32) |
| 36 | #:use-module ((guix utils) #:select (call-with-temporary-output-file)) | 31 | #:use-module ((guix utils) #:select (call-with-temporary-output-file)) |
| 37 | #:export (hackage->guix-package)) | 32 | #:export (hackage->guix-package)) |
| 38 | 33 | ||
| 39 | ;; Part 1: | ||
| 40 | ;; | ||
| 41 | ;; Functions used to read a Cabal file. | ||
| 42 | |||
| 43 | (define ghc-standard-libraries | 34 | (define ghc-standard-libraries |
| 44 | ;; List of libraries distributed with ghc (7.8.4). We include GHC itself as | 35 | ;; List of libraries distributed with ghc (7.8.4). We include GHC itself as |
| 45 | ;; some packages list it. | 36 | ;; some packages list it. |
| @@ -75,588 +66,12 @@ | |||
| 75 | 66 | ||
| 76 | (define package-name-prefix "ghc-") | 67 | (define package-name-prefix "ghc-") |
| 77 | 68 | ||
| 78 | (define key-value-rx | ||
| 79 | ;; Regular expression matching "key: value" | ||
| 80 | (make-regexp "([a-zA-Z0-9-]+):[ \t]*(\\w?.*)$")) | ||
| 81 | |||
| 82 | (define sections-rx | ||
| 83 | ;; Regular expression matching a section "head sub-head ..." | ||
| 84 | (make-regexp "([a-zA-Z0-9\\(\\)-]+)")) | ||
| 85 | |||
| 86 | (define comment-rx | ||
| 87 | ;; Regexp matching Cabal comment lines. | ||
| 88 | (make-regexp "^ *--")) | ||
| 89 | |||
| 90 | (define (has-key? line) | ||
| 91 | "Check if LINE includes a key." | ||
| 92 | (regexp-exec key-value-rx line)) | ||
| 93 | |||
| 94 | (define (comment-line? line) | ||
| 95 | "Check if LINE is a comment line." | ||
| 96 | (regexp-exec comment-rx line)) | ||
| 97 | |||
| 98 | (define (line-indentation+rest line) | ||
| 99 | "Returns two results: The number of indentation spaces and the rest of the | ||
| 100 | line (without indentation)." | ||
| 101 | (let loop ((line-lst (string->list line)) | ||
| 102 | (count 0)) | ||
| 103 | ;; Sometimes values are spread over multiple lines and new lines start | ||
| 104 | ;; with a comma ',' with the wrong indentation. See e.g. haddock-api. | ||
| 105 | (if (or (null? line-lst) | ||
| 106 | (not (or | ||
| 107 | (eqv? (first line-lst) #\space) | ||
| 108 | (eqv? (first line-lst) #\,) ; see, e.g., haddock-api.cabal | ||
| 109 | (eqv? (first line-lst) #\tab)))) | ||
| 110 | (values count (list->string line-lst)) | ||
| 111 | (loop (cdr line-lst) (+ count 1))))) | ||
| 112 | |||
| 113 | (define (multi-line-value lines seed) | ||
| 114 | "Function to read a value split across multiple lines. LINES are the | ||
| 115 | remaining input lines to be read. SEED is the value read on the same line as | ||
| 116 | the key. Return two values: A list with values and the remaining lines to be | ||
| 117 | processed." | ||
| 118 | (define (multi-line-value-with-min-indent lines seed min-indent) | ||
| 119 | (if (null? lines) | ||
| 120 | (values '() '()) | ||
| 121 | (let-values (((current-indent value) (line-indentation+rest (first lines))) | ||
| 122 | ((next-line-indent next-line-value) | ||
| 123 | (if (null? (cdr lines)) | ||
| 124 | (values #f "") | ||
| 125 | (line-indentation+rest (second lines))))) | ||
| 126 | (if (or (not next-line-indent) (< next-line-indent min-indent) | ||
| 127 | (regexp-exec condition-rx next-line-value)) | ||
| 128 | (values (reverse (cons value seed)) (cdr lines)) | ||
| 129 | (multi-line-value-with-min-indent (cdr lines) (cons value seed) | ||
| 130 | min-indent))))) | ||
| 131 | |||
| 132 | (let-values (((current-indent value) (line-indentation+rest (first lines)))) | ||
| 133 | (multi-line-value-with-min-indent lines seed current-indent))) | ||
| 134 | |||
| 135 | (define (read-cabal port) | ||
| 136 | "Parses a Cabal file from PORT. Return a list of list pairs: | ||
| 137 | |||
| 138 | (((head1 sub-head1 ... key1) (value)) | ||
| 139 | ((head2 sub-head2 ... key2) (value2)) | ||
| 140 | ...). | ||
| 141 | |||
| 142 | We try do deduce the Cabal format from the following document: | ||
| 143 | https://www.haskell.org/cabal/users-guide/developing-packages.html | ||
| 144 | |||
| 145 | Keys are case-insensitive. We therefore lowercase them. Values are | ||
| 146 | case-sensitive. Currently only indentation-structured files are parsed. | ||
| 147 | Braces structured files are not handled." ;" <- make emacs happy. | ||
| 148 | (define (read-and-trim-line port) | ||
| 149 | (let ((line (read-line port))) | ||
| 150 | (if (string? line) | ||
| 151 | (string-trim-both line #\return) | ||
| 152 | line))) | ||
| 153 | |||
| 154 | (define (strip-insignificant-lines port) | ||
| 155 | (let loop ((line (read-and-trim-line port)) | ||
| 156 | (result '())) | ||
| 157 | (cond | ||
| 158 | ((eof-object? line) | ||
| 159 | (reverse result)) | ||
| 160 | ((or (string-null? line) (comment-line? line)) | ||
| 161 | (loop (read-and-trim-line port) result)) | ||
| 162 | (else | ||
| 163 | (loop (read-and-trim-line port) (cons line result)))))) | ||
| 164 | |||
| 165 | (let loop | ||
| 166 | ((lines (strip-insignificant-lines port)) | ||
| 167 | (indents '()) ; only includes indents at start of section heads. | ||
| 168 | (sections '()) | ||
| 169 | (result '())) | ||
| 170 | (let-values | ||
| 171 | (((current-indent line) | ||
| 172 | (if (null? lines) | ||
| 173 | (values 0 "") | ||
| 174 | (line-indentation+rest (first lines)))) | ||
| 175 | ((next-line-indent next-line) | ||
| 176 | (if (or (null? lines) (null? (cdr lines))) | ||
| 177 | (values 0 "") | ||
| 178 | (line-indentation+rest (second lines))))) | ||
| 179 | (if (null? lines) | ||
| 180 | (reverse result) | ||
| 181 | (let ((rx-result (has-key? line))) | ||
| 182 | (cond | ||
| 183 | (rx-result | ||
| 184 | (let ((key (string-downcase (match:substring rx-result 1))) | ||
| 185 | (value (match:substring rx-result 2))) | ||
| 186 | (cond | ||
| 187 | ;; Simple single line "key: value". | ||
| 188 | ((= next-line-indent current-indent) | ||
| 189 | (loop (cdr lines) indents sections | ||
| 190 | (cons | ||
| 191 | (list (reverse (cons key sections)) (list value)) | ||
| 192 | result))) | ||
| 193 | ;; Multi line "key: value\n value cont...". | ||
| 194 | ((> next-line-indent current-indent) | ||
| 195 | (let*-values (((value-lst lines) | ||
| 196 | (multi-line-value (cdr lines) | ||
| 197 | (if (string-null? value) | ||
| 198 | '() | ||
| 199 | `(,value))))) | ||
| 200 | ;; multi-line-value returns to the first line after the | ||
| 201 | ;; multi-value. | ||
| 202 | (loop lines indents sections | ||
| 203 | (cons | ||
| 204 | (list (reverse (cons key sections)) value-lst) | ||
| 205 | result)))) | ||
| 206 | ;; Section ended. | ||
| 207 | (else | ||
| 208 | ;; Indentation is reduced. Check by how many levels. | ||
| 209 | (let* ((idx (and=> (list-index | ||
| 210 | (lambda (x) (= next-line-indent x)) | ||
| 211 | indents) | ||
| 212 | (cut + <> | ||
| 213 | (if (has-key? next-line) 1 0)))) | ||
| 214 | (sec | ||
| 215 | (if idx | ||
| 216 | (drop sections idx) | ||
| 217 | (raise | ||
| 218 | (condition | ||
| 219 | (&message | ||
| 220 | (message "unable to parse Cabal file")))))) | ||
| 221 | (ind (drop indents idx))) | ||
| 222 | (loop (cdr lines) ind sec | ||
| 223 | (cons | ||
| 224 | (list (reverse (cons key sections)) (list value)) | ||
| 225 | result))))))) | ||
| 226 | ;; Start of a new section. | ||
| 227 | ((or (null? indents) | ||
| 228 | (> current-indent (first indents))) | ||
| 229 | (loop (cdr lines) (cons current-indent indents) | ||
| 230 | (cons (string-downcase line) sections) result)) | ||
| 231 | (else | ||
| 232 | (loop (cdr lines) indents | ||
| 233 | (cons (string-downcase line) (cdr sections)) | ||
| 234 | result)))))))) | ||
| 235 | |||
| 236 | (define condition-rx | ||
| 237 | ;; Regexp for conditionals. | ||
| 238 | (make-regexp "^if +(.*)$")) | ||
| 239 | |||
| 240 | (define (split-section section) | ||
| 241 | "Split SECTION in individual words with exception for the predicate of an | ||
| 242 | 'if' conditional." | ||
| 243 | (let ((rx-result (regexp-exec condition-rx section))) | ||
| 244 | (if rx-result | ||
| 245 | `("if" ,(match:substring rx-result 1)) | ||
| 246 | (map match:substring (list-matches sections-rx section))))) | ||
| 247 | |||
| 248 | (define (join-sections sec1 sec2) | ||
| 249 | (fold-right cons sec2 sec1)) | ||
| 250 | |||
| 251 | (define (pre-process-keys key) | ||
| 252 | (match key | ||
| 253 | (() '()) | ||
| 254 | ((sec1 rest ...) | ||
| 255 | (join-sections (split-section sec1) (pre-process-keys rest))))) | ||
| 256 | |||
| 257 | (define (pre-process-entry-keys entry) | ||
| 258 | (match entry | ||
| 259 | ((key value) | ||
| 260 | (list (pre-process-keys key) value)) | ||
| 261 | (() '()))) | ||
| 262 | |||
| 263 | (define (pre-process-entries-keys entries) | ||
| 264 | "ENTRIES is a list of list pairs, a keys list and a valules list, as | ||
| 265 | produced by 'read-cabal'. Split each element of the keys list into individual | ||
| 266 | words. This pre-processing is used to read flags." | ||
| 267 | (match entries | ||
| 268 | ((entry rest ...) | ||
| 269 | (cons (pre-process-entry-keys entry) | ||
| 270 | (pre-process-entries-keys rest))) | ||
| 271 | (() | ||
| 272 | '()))) | ||
| 273 | |||
| 274 | (define (get-flags pre-processed-entries) | ||
| 275 | "PRE-PROCESSED-ENTRIES is a list of list pairs, a keys list and a values | ||
| 276 | list, as produced by 'read-cabal' and pre-processed by | ||
| 277 | 'pre-process-entries-keys'. Return a list of pairs with the name of flags and | ||
| 278 | their default value (one of \"False\" or \"True\") as specified in the Cabal file: | ||
| 279 | |||
| 280 | ((\"flag1-name\" . \"False-or-True\") ...)." ;" <- make emacs happy | ||
| 281 | (match pre-processed-entries | ||
| 282 | (() '()) | ||
| 283 | (((("flag" flag-name "default") (flag-val)) rest ...) | ||
| 284 | (cons (cons flag-name flag-val) | ||
| 285 | (get-flags rest))) | ||
| 286 | ((entry rest ... ) | ||
| 287 | (get-flags rest)) | ||
| 288 | (_ #f))) | ||
| 289 | |||
| 290 | ;; Part 2: | ||
| 291 | ;; | ||
| 292 | ;; Functions to read information from the Cabal object created by 'read-cabal' | ||
| 293 | ;; and convert Cabal format dependencies conditionals into equivalent | ||
| 294 | ;; S-expressions. | ||
| 295 | |||
| 296 | (define tests-rx | ||
| 297 | ;; Cabal test keywords | ||
| 298 | (make-regexp "(os|arch|flag|impl) *\\(([ a-zA-Z0-9_.<>=-]+)\\)")) | ||
| 299 | |||
| 300 | (define parens-rx | ||
| 301 | ;; Parentheses within conditions | ||
| 302 | (make-regexp "\\((.+)\\)")) | ||
| 303 | |||
| 304 | (define or-rx | ||
| 305 | ;; OR operator in conditions | ||
| 306 | (make-regexp " +\\|\\| +")) | ||
| 307 | |||
| 308 | (define and-rx | ||
| 309 | ;; AND operator in conditions | ||
| 310 | (make-regexp " +&& +")) | ||
| 311 | |||
| 312 | (define not-rx | ||
| 313 | ;; NOT operator in conditions | ||
| 314 | (make-regexp "^!.+")) | ||
| 315 | |||
| 316 | (define (bi-op-args str match-lst) | ||
| 317 | "Return a list with the arguments of (logic) bianry operators. MATCH-LST | ||
| 318 | is the result of 'list-match' against a binary operator regexp on STR." | ||
| 319 | (let ((operators (length match-lst))) | ||
| 320 | (map (lambda (from to) | ||
| 321 | (substring str from to)) | ||
| 322 | (cons 0 (map match:end match-lst)) | ||
| 323 | (append (map match:start match-lst) (list (string-length str)))))) | ||
| 324 | |||
| 325 | (define (bi-op->sexp-like bi-op args) | ||
| 326 | "BI-OP is a string with the name of a Scheme operator which in a Cabal file | ||
| 327 | is represented by a binary operator. ARGS are the arguments of said operator. | ||
| 328 | Return a string representing an S-expression of the operator applied to its | ||
| 329 | arguments." | ||
| 330 | (if (= (length args) 1) | ||
| 331 | (first args) | ||
| 332 | (string-append "(" bi-op | ||
| 333 | (fold (lambda (arg seed) (string-append seed " " arg)) | ||
| 334 | "" args) ")"))) | ||
| 335 | |||
| 336 | (define (not->sexp-like arg) | ||
| 337 | "If the string ARG is prefixed by a Cabal negation operator, convert it to | ||
| 338 | an equivalent Scheme S-expression string." | ||
| 339 | (if (regexp-exec not-rx arg) | ||
| 340 | (string-append "(not " | ||
| 341 | (substring arg 1 (string-length arg)) | ||
| 342 | ")") | ||
| 343 | arg)) | ||
| 344 | |||
| 345 | (define (parens-less-cond->sexp-like conditional) | ||
| 346 | "Convert a Cabal CONDITIONAL string into a string with equivalent Scheme | ||
| 347 | syntax. This procedure accepts only simple conditionals without parentheses." | ||
| 348 | ;; The outher operation is the one with the lowest priority: OR | ||
| 349 | (bi-op->sexp-like | ||
| 350 | "or" | ||
| 351 | ;; each OR argument may be an AND operation | ||
| 352 | (map (lambda (or-arg) | ||
| 353 | (let ((m-lst (list-matches and-rx or-arg))) | ||
| 354 | ;; is there an AND operation? | ||
| 355 | (if (> (length m-lst) 0) | ||
| 356 | (bi-op->sexp-like | ||
| 357 | "and" | ||
| 358 | ;; expand NOT operators when there are ANDs | ||
| 359 | (map not->sexp-like (bi-op-args or-arg m-lst))) | ||
| 360 | ;; ... and when there aren't. | ||
| 361 | (not->sexp-like or-arg)))) | ||
| 362 | ;; list of OR arguments | ||
| 363 | (bi-op-args conditional (list-matches or-rx conditional))))) | ||
| 364 | |||
| 365 | (define test-keyword-ornament "__") | ||
| 366 | |||
| 367 | (define (conditional->sexp-like conditional) | ||
| 368 | "Convert a Cabal CONDITIONAL string into a string with equivalent Scheme | ||
| 369 | syntax." | ||
| 370 | ;; First we substitute TEST-KEYWORD-ORNAMENT for parentheses around tests | ||
| 371 | ;; keywords so that parentheses are only used to set precedences. This | ||
| 372 | ;; substantially simplify parsing. | ||
| 373 | (let ((conditional | ||
| 374 | (regexp-substitute/global #f tests-rx conditional | ||
| 375 | 'pre 1 test-keyword-ornament 2 | ||
| 376 | test-keyword-ornament 'post))) | ||
| 377 | (let loop ((sub-cond conditional)) | ||
| 378 | (let ((rx-result (regexp-exec parens-rx sub-cond))) | ||
| 379 | (cond | ||
| 380 | (rx-result | ||
| 381 | (parens-less-cond->sexp-like | ||
| 382 | (string-append | ||
| 383 | (match:prefix rx-result) | ||
| 384 | (loop (match:substring rx-result 1)) | ||
| 385 | (match:suffix rx-result)))) | ||
| 386 | (else | ||
| 387 | (parens-less-cond->sexp-like sub-cond))))))) | ||
| 388 | |||
| 389 | (define (eval-flags sexp-like-cond flags) | ||
| 390 | "SEXP-LIKE-COND is a string representing an S-expression conditional. FLAGS | ||
| 391 | is a list of flag name and value pairs as produced by 'get-flags'. Substitute | ||
| 392 | \"#t\" or \"#f\" according to the value of flags. (Default to \"True\")." | ||
| 393 | (fold-right | ||
| 394 | (lambda (flag sexp) | ||
| 395 | (match flag | ||
| 396 | ((name . value) | ||
| 397 | (let ((rx (make-regexp | ||
| 398 | (string-append "flag" test-keyword-ornament name | ||
| 399 | test-keyword-ornament)))) | ||
| 400 | (regexp-substitute/global | ||
| 401 | #f rx sexp | ||
| 402 | 'pre (if (string-ci= value "False") "#f" "#t") 'post))) | ||
| 403 | (_ sexp))) | ||
| 404 | sexp-like-cond | ||
| 405 | (cons '("[a-zA-Z0-9_-]+" . "True") flags))) | ||
| 406 | |||
| 407 | (define (eval-tests->sexp sexp-like-cond) | ||
| 408 | "In the string SEXP-LIKE-COND substitute test keywords \"os(...)\" and | ||
| 409 | \"arch(...)\" with equivalent Scheme checks. Retrun an S-expression." | ||
| 410 | (with-input-from-string | ||
| 411 | (fold-right | ||
| 412 | (lambda (test sexp) | ||
| 413 | (match test | ||
| 414 | ((type pre-match post-match) | ||
| 415 | (let ((rx (make-regexp | ||
| 416 | (string-append type test-keyword-ornament "(\\w+)" | ||
| 417 | test-keyword-ornament)))) | ||
| 418 | (regexp-substitute/global | ||
| 419 | #f rx sexp | ||
| 420 | 'pre pre-match 2 post-match 'post))) | ||
| 421 | (_ sexp))) | ||
| 422 | sexp-like-cond | ||
| 423 | ;; (%current-system) returns, e.g., "x86_64-linux" or "i686-linux". | ||
| 424 | '(("(os|arch)" "(string-match \"" "\" (%current-system))"))) | ||
| 425 | read)) | ||
| 426 | |||
| 427 | (define (eval-impl sexp-like-cond) | ||
| 428 | "Check for the Cabal test \"impl(...)\" in the string SEXP-LIKE-COND. | ||
| 429 | Assume the module declaring the generated package includes a local variable | ||
| 430 | called \"haskell-implementation\" with a string value of the form NAME-VERSION | ||
| 431 | against which we compare." | ||
| 432 | (with-output-to-string | ||
| 433 | (lambda () | ||
| 434 | (write | ||
| 435 | (with-input-from-string | ||
| 436 | (fold-right | ||
| 437 | (lambda (test sexp) | ||
| 438 | (match test | ||
| 439 | ((pre-match post-match) | ||
| 440 | (let ((rx-with-version | ||
| 441 | (make-regexp | ||
| 442 | (string-append | ||
| 443 | "impl" test-keyword-ornament | ||
| 444 | "([a-zA-Z0-9_-]+) *([<>=]+) *([0-9.]+) *" | ||
| 445 | test-keyword-ornament))) | ||
| 446 | (rx-without-version | ||
| 447 | (make-regexp | ||
| 448 | (string-append "impl" test-keyword-ornament "(\\w+)" | ||
| 449 | test-keyword-ornament)))) | ||
| 450 | (if (regexp-exec rx-with-version sexp) | ||
| 451 | (regexp-substitute/global | ||
| 452 | #f rx-with-version sexp | ||
| 453 | 'pre pre-match 2 " " post-match " \"" 1 "-" 3 "\")" 'post) | ||
| 454 | (regexp-substitute/global | ||
| 455 | #f rx-without-version sexp | ||
| 456 | 'pre pre-match "-match \"" 1 "\" " post-match ")" 'post)))) | ||
| 457 | (_ sexp))) | ||
| 458 | sexp-like-cond | ||
| 459 | '(("(string" "haskell-implementation"))) | ||
| 460 | read))))) | ||
| 461 | |||
| 462 | (define (eval-cabal-keywords sexp-like-cond flags) | ||
| 463 | ((compose eval-tests->sexp eval-impl (cut eval-flags <> flags)) | ||
| 464 | sexp-like-cond)) | ||
| 465 | |||
| 466 | (define (key->values meta key) | ||
| 467 | "META is the representation of a Cabal file as produced by 'read-cabal'. | ||
| 468 | Return the list of values associated with a specific KEY (a string)." | ||
| 469 | (match meta | ||
| 470 | (() '()) | ||
| 471 | (((((? (lambda(x) (equal? x key)))) v) r ...) | ||
| 472 | v) | ||
| 473 | (((k v) r ...) | ||
| 474 | (key->values (cdr meta) key)) | ||
| 475 | (_ "key Not fount"))) | ||
| 476 | |||
| 477 | (define (key-start-end->entries meta key-start-rx key-end-rx) | ||
| 478 | "META is the representation of a Cabal file as produced by 'read-cabal'. | ||
| 479 | Return all entries whose keys list starts with KEY-START and ends with | ||
| 480 | KEY-END." | ||
| 481 | (let ((pred | ||
| 482 | (lambda (x) | ||
| 483 | (and (regexp-exec key-start-rx (first x)) | ||
| 484 | (regexp-exec key-end-rx (last x)))))) | ||
| 485 | ;; (equal? (list key-start key-end) (list (first x) (last x)))))) | ||
| 486 | (match meta | ||
| 487 | (() '()) | ||
| 488 | ((((? pred k) v) r ...) | ||
| 489 | (cons `(,k ,v) | ||
| 490 | (key-start-end->entries (cdr meta) key-start-rx key-end-rx))) | ||
| 491 | (((k v) r ...) | ||
| 492 | (key-start-end->entries (cdr meta) key-start-rx key-end-rx)) | ||
| 493 | (_ "key Not fount")))) | ||
| 494 | |||
| 495 | (define else-rx | ||
| 496 | (make-regexp "^else$")) | ||
| 497 | |||
| 498 | (define (count-if-else rx-result-ls) | ||
| 499 | (apply + (map (lambda (m) (if m 1 0)) rx-result-ls))) | ||
| 500 | |||
| 501 | (define (analyze-entry-cond entry) | ||
| 502 | (let* ((keys (first entry)) | ||
| 503 | (vals (second entry)) | ||
| 504 | (rx-cond-result | ||
| 505 | (map (cut regexp-exec condition-rx <>) keys)) | ||
| 506 | (rx-else-result | ||
| 507 | (map (cut regexp-exec else-rx <>) keys)) | ||
| 508 | (cond-no (count-if-else rx-cond-result)) | ||
| 509 | (else-no (count-if-else rx-else-result)) | ||
| 510 | (cond-idx (list-index (lambda (rx) (if rx #t #f)) rx-cond-result)) | ||
| 511 | (else-idx (list-index (lambda (rx) (if rx #t #f)) rx-else-result)) | ||
| 512 | (key-cond | ||
| 513 | (cond | ||
| 514 | ((or (and cond-idx else-idx (< cond-idx else-idx)) | ||
| 515 | (and cond-idx (not else-idx))) | ||
| 516 | (match:substring | ||
| 517 | (receive (head tail) | ||
| 518 | (split-at rx-cond-result cond-idx) (first tail)))) | ||
| 519 | ((or (and cond-idx else-idx (> cond-idx else-idx)) | ||
| 520 | (and (not cond-idx) else-idx)) | ||
| 521 | (match:substring | ||
| 522 | (receive (head tail) | ||
| 523 | (split-at rx-else-result else-idx) (first tail)))) | ||
| 524 | (else | ||
| 525 | "")))) | ||
| 526 | (values keys vals rx-cond-result | ||
| 527 | rx-else-result cond-no else-no key-cond))) | ||
| 528 | |||
| 529 | (define (remove-cond entry cond) | ||
| 530 | (match entry | ||
| 531 | ((k v) | ||
| 532 | (list (cdr (member cond k)) v)))) | ||
| 533 | |||
| 534 | (define (group-and-reduce-level entries group group-cond) | ||
| 535 | (let loop | ||
| 536 | ((true-group group) | ||
| 537 | (false-group '()) | ||
| 538 | (entries entries)) | ||
| 539 | (if (null? entries) | ||
| 540 | (values (reverse true-group) (reverse false-group) entries) | ||
| 541 | (let*-values (((entry) (first entries)) | ||
| 542 | ((keys vals rx-cond-result rx-else-result | ||
| 543 | cond-no else-no key-cond) | ||
| 544 | (analyze-entry-cond entry))) | ||
| 545 | (cond | ||
| 546 | ((and (>= (+ cond-no else-no) 1) (string= group-cond key-cond)) | ||
| 547 | (loop (cons (remove-cond entry group-cond) true-group) false-group | ||
| 548 | (cdr entries))) | ||
| 549 | ((and (>= (+ cond-no else-no) 1) (string= key-cond "else")) | ||
| 550 | (loop true-group (cons (remove-cond entry "else") false-group) | ||
| 551 | (cdr entries))) | ||
| 552 | (else | ||
| 553 | (values (reverse true-group) (reverse false-group) entries))))))) | ||
| 554 | |||
| 555 | (define dependencies-rx | ||
| 556 | (make-regexp "([a-zA-Z0-9_-]+) *[^,]*,?")) | ||
| 557 | |||
| 558 | (define (hackage-name->package-name name) | 69 | (define (hackage-name->package-name name) |
| 70 | "Given the NAME of a Cabal package, return the corresponding Guix name." | ||
| 559 | (if (string-prefix? package-name-prefix name) | 71 | (if (string-prefix? package-name-prefix name) |
| 560 | (string-downcase name) | 72 | (string-downcase name) |
| 561 | (string-append package-name-prefix (string-downcase name)))) | 73 | (string-append package-name-prefix (string-downcase name)))) |
| 562 | 74 | ||
| 563 | (define (split-and-filter-dependencies ls names-to-filter) | ||
| 564 | "Split the comma separated list of dependencies LS coming from the Cabal | ||
| 565 | file, filter packages included in NAMES-TO-FILTER and return a list with | ||
| 566 | inputs suitable for the Guix package. Currently the version information is | ||
| 567 | discarded." | ||
| 568 | (define (split-at-comma-and-filter d) | ||
| 569 | (fold | ||
| 570 | (lambda (m seed) | ||
| 571 | (let* ((name (string-downcase (match:substring m 1))) | ||
| 572 | (pkg-name (hackage-name->package-name name))) | ||
| 573 | (if (member name names-to-filter) | ||
| 574 | seed | ||
| 575 | (cons (list pkg-name (list 'unquote (string->symbol pkg-name))) | ||
| 576 | seed)))) | ||
| 577 | '() | ||
| 578 | (list-matches dependencies-rx d))) | ||
| 579 | |||
| 580 | (fold (lambda (d p) (append (split-at-comma-and-filter d) p)) '() ls)) | ||
| 581 | |||
| 582 | (define* (dependencies-cond->sexp meta #:key (include-test-dependencies? #t)) | ||
| 583 | "META is the representation of a Cabal file as produced by 'read-cabal'. | ||
| 584 | Return an S-expression containing the list of dependencies as expected by the | ||
| 585 | 'inputs' field of a package. The generated S-expressions may include | ||
| 586 | conditionals as defined in the cabal file. During this process we discard the | ||
| 587 | version information of the packages." | ||
| 588 | (define (take-dependencies meta) | ||
| 589 | (let ((key-start-exe (make-regexp "executable")) | ||
| 590 | (key-start-lib (make-regexp "library")) | ||
| 591 | (key-start-tests (make-regexp "test-suite")) | ||
| 592 | (key-end (make-regexp "build-depends"))) | ||
| 593 | (append | ||
| 594 | (key-start-end->entries meta key-start-exe key-end) | ||
| 595 | (key-start-end->entries meta key-start-lib key-end) | ||
| 596 | (if include-test-dependencies? | ||
| 597 | (key-start-end->entries meta key-start-tests key-end) | ||
| 598 | '())))) | ||
| 599 | |||
| 600 | (let ((flags (get-flags (pre-process-entries-keys meta))) | ||
| 601 | (augmented-ghc-std-libs (append (key->values meta "name") | ||
| 602 | ghc-standard-libraries))) | ||
| 603 | (delete-duplicates | ||
| 604 | (let loop ((entries (take-dependencies meta)) | ||
| 605 | (result '())) | ||
| 606 | (if (null? entries) | ||
| 607 | (reverse result) | ||
| 608 | (let*-values (((entry) (first entries)) | ||
| 609 | ((keys vals rx-cond-result rx-else-result | ||
| 610 | cond-no else-no key-cond) | ||
| 611 | (analyze-entry-cond entry))) | ||
| 612 | (cond | ||
| 613 | ((= (+ cond-no else-no) 0) | ||
| 614 | (loop (cdr entries) | ||
| 615 | (append | ||
| 616 | (split-and-filter-dependencies vals | ||
| 617 | augmented-ghc-std-libs) | ||
| 618 | result))) | ||
| 619 | (else | ||
| 620 | (let-values (((true-group false-group entries) | ||
| 621 | (group-and-reduce-level entries '() | ||
| 622 | key-cond)) | ||
| 623 | ((cond-final) (eval-cabal-keywords | ||
| 624 | (conditional->sexp-like | ||
| 625 | (last (split-section key-cond))) | ||
| 626 | flags))) | ||
| 627 | (loop entries | ||
| 628 | (cond | ||
| 629 | ((or (eq? cond-final #t) (equal? cond-final '(not #f))) | ||
| 630 | (append (loop true-group '()) result)) | ||
| 631 | ((or (eq? cond-final #f) (equal? cond-final '(not #t))) | ||
| 632 | (append (loop false-group '()) result)) | ||
| 633 | (else | ||
| 634 | (let ((true-group-result (loop true-group '())) | ||
| 635 | (false-group-result (loop false-group '()))) | ||
| 636 | (cond | ||
| 637 | ((and (null? true-group-result) | ||
| 638 | (null? false-group-result)) | ||
| 639 | result) | ||
| 640 | ((null? false-group-result) | ||
| 641 | (cons `(unquote-splicing | ||
| 642 | (when ,cond-final ,true-group-result)) | ||
| 643 | result)) | ||
| 644 | ((null? true-group-result) | ||
| 645 | (cons `(unquote-splicing | ||
| 646 | (unless ,cond-final ,false-group-result)) | ||
| 647 | result)) | ||
| 648 | (else | ||
| 649 | (cons `(unquote-splicing | ||
| 650 | (if ,cond-final | ||
| 651 | ,true-group-result | ||
| 652 | ,false-group-result)) | ||
| 653 | result)))))))))))))))) | ||
| 654 | |||
| 655 | ;; Part 3: | ||
| 656 | ;; | ||
| 657 | ;; Retrive the desired package and its Cabal file from | ||
| 658 | ;; http://hackage.haskell.org and construct the Guix package S-expression. | ||
| 659 | |||
| 660 | (define (hackage-fetch name-version) | 75 | (define (hackage-fetch name-version) |
| 661 | "Return the Cabal file for the package NAME-VERSION, or #f on failure. If | 76 | "Return the Cabal file for the package NAME-VERSION, or #f on failure. If |
| 662 | the version part is omitted from the package name, then return the latest | 77 | the version part is omitted from the package name, then return the latest |
| @@ -696,33 +111,63 @@ version." | |||
| 696 | ((lst ...) `(list ,@(map string->license lst))) | 111 | ((lst ...) `(list ,@(map string->license lst))) |
| 697 | (_ #f))) | 112 | (_ #f))) |
| 698 | 113 | ||
| 699 | (define* (hackage-module->sexp meta #:key (include-test-dependencies? #t)) | 114 | |
| 700 | "Return the `package' S-expression for a Cabal package. META is the | 115 | (define (cabal-dependencies->names cabal include-test-dependencies?) |
| 116 | "Return the list of dependencies names from the CABAL package object. If | ||
| 117 | INCLUDE-TEST-DEPENDENCIES? is #f, do not include dependencies required by test | ||
| 118 | suites." | ||
| 119 | (let* ((lib (cabal-package-library cabal)) | ||
| 120 | (lib-deps (if (pair? lib) | ||
| 121 | (map cabal-dependency-name | ||
| 122 | (append-map cabal-library-dependencies lib)) | ||
| 123 | '())) | ||
| 124 | (exe (cabal-package-executables cabal)) | ||
| 125 | (exe-deps (if (pair? exe) | ||
| 126 | (map cabal-dependency-name | ||
| 127 | (append-map cabal-executable-dependencies exe)) | ||
| 128 | '())) | ||
| 129 | (ts (cabal-package-test-suites cabal)) | ||
| 130 | (ts-deps (if (pair? ts) | ||
| 131 | (map cabal-dependency-name | ||
| 132 | (append-map cabal-test-suite-dependencies ts)) | ||
| 133 | '()))) | ||
| 134 | (if include-test-dependencies? | ||
| 135 | (delete-duplicates (append lib-deps exe-deps ts-deps)) | ||
| 136 | (delete-duplicates (append lib-deps exe-deps))))) | ||
| 137 | |||
| 138 | (define (filter-dependencies dependencies own-name) | ||
| 139 | "Filter the dependencies included with the GHC compiler from DEPENDENCIES, a | ||
| 140 | list with the names of dependencies. OWN-NAME is the name of the Cabal | ||
| 141 | package being processed and is used to filter references to itself." | ||
| 142 | (filter (lambda (d) (not (member (string-downcase d) | ||
| 143 | (cons own-name ghc-standard-libraries)))) | ||
| 144 | dependencies)) | ||
| 145 | |||
| 146 | (define* (hackage-module->sexp cabal #:key (include-test-dependencies? #t)) | ||
| 147 | "Return the `package' S-expression for a Cabal package. CABAL is the | ||
| 701 | representation of a Cabal file as produced by 'read-cabal'." | 148 | representation of a Cabal file as produced by 'read-cabal'." |
| 702 | 149 | ||
| 703 | (define name | 150 | (define name |
| 704 | (first (key->values meta "name"))) | 151 | (cabal-package-name cabal)) |
| 705 | 152 | ||
| 706 | (define version | 153 | (define version |
| 707 | (first (key->values meta "version"))) | 154 | (cabal-package-version cabal)) |
| 708 | |||
| 709 | (define description | ||
| 710 | (let*-values (((description) (key->values meta "description")) | ||
| 711 | ((lines last) | ||
| 712 | (split-at description (- (length description) 1)))) | ||
| 713 | (fold-right (lambda (line seed) (string-append line "\n" seed)) | ||
| 714 | (first last) lines))) | ||
| 715 | 155 | ||
| 716 | (define source-url | 156 | (define source-url |
| 717 | (string-append "http://hackage.haskell.org/package/" name | 157 | (string-append "http://hackage.haskell.org/package/" name |
| 718 | "/" name "-" version ".tar.gz")) | 158 | "/" name "-" version ".tar.gz")) |
| 719 | 159 | ||
| 720 | ;; Several packages do not have an official home-page other than on Hackage. | 160 | (define dependencies |
| 721 | (define home-page | 161 | (let ((names |
| 722 | (let ((home-page-entry (key->values meta "homepage"))) | 162 | (map hackage-name->package-name |
| 723 | (if (null? home-page-entry) | 163 | ((compose (cut filter-dependencies <> |
| 724 | (string-append "http://hackage.haskell.org/package/" name) | 164 | (cabal-package-name cabal)) |
| 725 | (first home-page-entry)))) | 165 | (cut cabal-dependencies->names <> |
| 166 | include-test-dependencies?)) | ||
| 167 | cabal)))) | ||
| 168 | (map (lambda (name) | ||
| 169 | (list name (list 'unquote (string->symbol name)))) | ||
| 170 | names))) | ||
| 726 | 171 | ||
| 727 | (define (maybe-inputs input-type inputs) | 172 | (define (maybe-inputs input-type inputs) |
| 728 | (match inputs | 173 | (match inputs |
| @@ -732,6 +177,11 @@ representation of a Cabal file as produced by 'read-cabal'." | |||
| 732 | (list (list input-type | 177 | (list (list input-type |
| 733 | (list 'quasiquote inputs)))))) | 178 | (list 'quasiquote inputs)))))) |
| 734 | 179 | ||
| 180 | (define (maybe-arguments) | ||
| 181 | (if (not include-test-dependencies?) | ||
| 182 | '((arguments `(#:tests? #f))) | ||
| 183 | '())) | ||
| 184 | |||
| 735 | (let ((tarball (with-store store | 185 | (let ((tarball (with-store store |
| 736 | (download-to-store store source-url)))) | 186 | (download-to-store store source-url)))) |
| 737 | `(package | 187 | `(package |
| @@ -746,22 +196,33 @@ representation of a Cabal file as produced by 'read-cabal'." | |||
| 746 | (bytevector->nix-base32-string (file-sha256 tarball)) | 196 | (bytevector->nix-base32-string (file-sha256 tarball)) |
| 747 | "failed to download tar archive"))))) | 197 | "failed to download tar archive"))))) |
| 748 | (build-system haskell-build-system) | 198 | (build-system haskell-build-system) |
| 749 | ,@(maybe-inputs 'inputs | 199 | ,@(maybe-inputs 'inputs dependencies) |
| 750 | (dependencies-cond->sexp meta | 200 | ,@(maybe-arguments) |
| 751 | #:include-test-dependencies? | 201 | (home-page ,(cabal-package-home-page cabal)) |
| 752 | include-test-dependencies?)) | 202 | (synopsis ,(cabal-package-synopsis cabal)) |
| 753 | (home-page ,home-page) | 203 | (description ,(cabal-package-description cabal)) |
| 754 | (synopsis ,@(key->values meta "synopsis")) | 204 | (license ,(string->license (cabal-package-license cabal)))))) |
| 755 | (description ,description) | 205 | |
| 756 | (license ,(string->license (key->values meta "license")))))) | 206 | (define* (hackage->guix-package package-name #:key |
| 757 | 207 | (include-test-dependencies? #t) | |
| 758 | (define* (hackage->guix-package module-name | 208 | (port #f) |
| 759 | #:key (include-test-dependencies? #t)) | 209 | (cabal-environment '())) |
| 760 | "Fetch the Cabal file for PACKAGE-NAME from hackage.haskell.org, and return | 210 | "Fetch the Cabal file for PACKAGE-NAME from hackage.haskell.org, or, if the |
| 761 | the `package' S-expression corresponding to that package, or #f on failure." | 211 | called with keyword parameter PORT, from PORT. Return the `package' |
| 762 | (let ((module-meta (hackage-fetch module-name))) | 212 | S-expression corresponding to that package, or #f on failure. |
| 763 | (and=> module-meta (cut hackage-module->sexp <> | 213 | CABAL-ENVIRONMENT is an alist defining the environment in which the Cabal |
| 764 | #:include-test-dependencies? | 214 | conditionals are evaluated. The accepted keys are: \"os\", \"arch\", \"impl\" |
| 765 | include-test-dependencies?)))) | 215 | and the name of a flag. The value associated with a flag has to be either the |
| 216 | symbol 'true' or 'false'. The value associated with other keys has to conform | ||
| 217 | to the Cabal file format definition. The default value associated with the | ||
| 218 | keys \"os\", \"arch\" and \"impl\" is \"linux\", \"x86_64\" and \"ghc\" | ||
| 219 | respectively." | ||
| 220 | (let ((cabal-meta (if port | ||
| 221 | (read-cabal port) | ||
| 222 | (hackage-fetch package-name)))) | ||
| 223 | (and=> cabal-meta (compose (cut hackage-module->sexp <> | ||
| 224 | #:include-test-dependencies? | ||
| 225 | include-test-dependencies?) | ||
| 226 | (cut eval-cabal <> cabal-environment))))) | ||
| 766 | 227 | ||
| 767 | ;;; cabal.scm ends here | 228 | ;;; cabal.scm ends here |
diff --git a/guix/licenses.scm b/guix/licenses.scm index 1be35001ffc..480442158d6 100644 --- a/guix/licenses.scm +++ b/guix/licenses.scm | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | freetype | 37 | freetype |
| 38 | gpl1 gpl1+ gpl2 gpl2+ gpl3 gpl3+ | 38 | gpl1 gpl1+ gpl2 gpl2+ gpl3 gpl3+ |
| 39 | fdl1.3+ | 39 | fdl1.3+ |
| 40 | opl1.0+ | ||
| 40 | isc | 41 | isc |
| 41 | ijg | 42 | ijg |
| 42 | ibmpl1.0 | 43 | ibmpl1.0 |
| @@ -206,6 +207,11 @@ at URI, which may be a file:// URI pointing the package's tree." | |||
| 206 | "https://www.gnu.org/licenses/fdl.html" | 207 | "https://www.gnu.org/licenses/fdl.html" |
| 207 | "https://www.gnu.org/licenses/license-list#FDL")) | 208 | "https://www.gnu.org/licenses/license-list#FDL")) |
| 208 | 209 | ||
| 210 | (define opl1.0+ | ||
| 211 | (license "Open Publication License 1.0 or later" | ||
| 212 | "http://opencontent.org/openpub/" | ||
| 213 | "https://www.gnu.org/licenses/license-list#OpenPublicationL")) | ||
| 214 | |||
| 209 | (define isc | 215 | (define isc |
| 210 | (license "ISC" | 216 | (license "ISC" |
| 211 | "http://directory.fsf.org/wiki/License:ISC" | 217 | "http://directory.fsf.org/wiki/License:ISC" |
diff --git a/guix/monads.scm b/guix/monads.scm index f693e99a599..2196a9c991c 100644 --- a/guix/monads.scm +++ b/guix/monads.scm | |||
| @@ -112,6 +112,29 @@ | |||
| 112 | (lambda (s) | 112 | (lambda (s) |
| 113 | (syntax-violation 'return "return used outside of 'with-monad'" s))) | 113 | (syntax-violation 'return "return used outside of 'with-monad'" s))) |
| 114 | 114 | ||
| 115 | (define-syntax-rule (bind-syntax bind) | ||
| 116 | "Return a macro transformer that handles the expansion of '>>=' expressions | ||
| 117 | using BIND as the binary bind operator. | ||
| 118 | |||
| 119 | This macro exists to allow the expansion of n-ary '>>=' expressions, even | ||
| 120 | though BIND is simply binary, as in: | ||
| 121 | |||
| 122 | (with-monad %state-monad | ||
| 123 | (>>= (return 1) | ||
| 124 | (lift 1+ %state-monad) | ||
| 125 | (lift 1+ %state-monad))) | ||
| 126 | " | ||
| 127 | (lambda (stx) | ||
| 128 | (define (expand body) | ||
| 129 | (syntax-case body () | ||
| 130 | ((_ mval mproc) | ||
| 131 | #'(bind mval mproc)) | ||
| 132 | ((x mval mproc0 mprocs (... ...)) | ||
| 133 | (expand #'(>>= (>>= mval mproc0) | ||
| 134 | mprocs (... ...)))))) | ||
| 135 | |||
| 136 | (expand stx))) | ||
| 137 | |||
| 115 | (define-syntax with-monad | 138 | (define-syntax with-monad |
| 116 | (lambda (s) | 139 | (lambda (s) |
| 117 | "Evaluate BODY in the context of MONAD, and return its result." | 140 | "Evaluate BODY in the context of MONAD, and return its result." |
| @@ -120,13 +143,13 @@ | |||
| 120 | (eq? 'macro (syntax-local-binding #'monad)) | 143 | (eq? 'macro (syntax-local-binding #'monad)) |
| 121 | ;; MONAD is a syntax transformer, so we can obtain the bind and return | 144 | ;; MONAD is a syntax transformer, so we can obtain the bind and return |
| 122 | ;; methods by directly querying it. | 145 | ;; methods by directly querying it. |
| 123 | #'(syntax-parameterize ((>>= (identifier-syntax (monad %bind))) | 146 | #'(syntax-parameterize ((>>= (bind-syntax (monad %bind))) |
| 124 | (return (identifier-syntax (monad %return)))) | 147 | (return (identifier-syntax (monad %return)))) |
| 125 | body ...)) | 148 | body ...)) |
| 126 | ((_ monad body ...) | 149 | ((_ monad body ...) |
| 127 | ;; MONAD refers to the <monad> record that represents the monad at run | 150 | ;; MONAD refers to the <monad> record that represents the monad at run |
| 128 | ;; time, so use the slow method. | 151 | ;; time, so use the slow method. |
| 129 | #'(syntax-parameterize ((>>= (identifier-syntax | 152 | #'(syntax-parameterize ((>>= (bind-syntax |
| 130 | (monad-bind monad))) | 153 | (monad-bind monad))) |
| 131 | (return (identifier-syntax | 154 | (return (identifier-syntax |
| 132 | (monad-return monad)))) | 155 | (monad-return monad)))) |
| @@ -225,8 +248,11 @@ MONAD---i.e., return a monadic function in MONAD." | |||
| 225 | (return (apply proc args))))) | 248 | (return (apply proc args))))) |
| 226 | 249 | ||
| 227 | (define (foldm monad mproc init lst) | 250 | (define (foldm monad mproc init lst) |
| 228 | "Fold MPROC over LST, a list of monadic values in MONAD, and return a | 251 | "Fold MPROC over LST and return a monadic value seeded by INIT. |
| 229 | monadic value seeded by INIT." | 252 | |
| 253 | (foldm %state-monad (lift2 cons %state-monad) '() '(a b c)) | ||
| 254 | => '(c b a) ;monadic | ||
| 255 | " | ||
| 230 | (with-monad monad | 256 | (with-monad monad |
| 231 | (let loop ((lst lst) | 257 | (let loop ((lst lst) |
| 232 | (result init)) | 258 | (result init)) |
| @@ -234,18 +260,21 @@ monadic value seeded by INIT." | |||
| 234 | (() | 260 | (() |
| 235 | (return result)) | 261 | (return result)) |
| 236 | ((head tail ...) | 262 | ((head tail ...) |
| 237 | (mlet* monad ((item head) | 263 | (>>= (mproc head result) |
| 238 | (result (mproc item result))) | 264 | (lambda (result) |
| 239 | (loop tail result))))))) | 265 | (loop tail result)))))))) |
| 240 | 266 | ||
| 241 | (define (mapm monad mproc lst) | 267 | (define (mapm monad mproc lst) |
| 242 | "Map MPROC over LST, a list of monadic values in MONAD, and return a monadic | 268 | "Map MPROC over LST and return a monadic list. |
| 243 | list. LST items are bound from left to right, so effects in MONAD are known | 269 | |
| 244 | to happen in that order." | 270 | (mapm %state-monad (lift1 1+ %state-monad) '(0 1 2)) |
| 271 | => (1 2 3) ;monadic | ||
| 272 | " | ||
| 245 | (mlet monad ((result (foldm monad | 273 | (mlet monad ((result (foldm monad |
| 246 | (lambda (item result) | 274 | (lambda (item result) |
| 247 | (mlet monad ((item (mproc item))) | 275 | (>>= (mproc item) |
| 248 | (return (cons item result)))) | 276 | (lambda (item) |
| 277 | (return (cons item result))))) | ||
| 249 | '() | 278 | '() |
| 250 | lst))) | 279 | lst))) |
| 251 | (return (reverse result)))) | 280 | (return (reverse result)))) |
| @@ -268,20 +297,24 @@ evaluating each item of LST in sequence." | |||
| 268 | (lambda (item) | 297 | (lambda (item) |
| 269 | (seq tail (cons item result))))))))) | 298 | (seq tail (cons item result))))))))) |
| 270 | 299 | ||
| 271 | (define (anym monad proc lst) | 300 | (define (anym monad mproc lst) |
| 272 | "Apply PROC to the list of monadic values LST; return the first value, | 301 | "Apply MPROC to the list of values LST; return as a monadic value the first |
| 273 | lifted in MONAD, for which PROC returns true." | 302 | value for which MPROC returns a true monadic value or #f. For example: |
| 303 | |||
| 304 | (anym %state-monad (lift1 odd? %state-monad) '(0 1 2)) | ||
| 305 | => #t ;monadic | ||
| 306 | " | ||
| 274 | (with-monad monad | 307 | (with-monad monad |
| 275 | (let loop ((lst lst)) | 308 | (let loop ((lst lst)) |
| 276 | (match lst | 309 | (match lst |
| 277 | (() | 310 | (() |
| 278 | (return #f)) | 311 | (return #f)) |
| 279 | ((head tail ...) | 312 | ((head tail ...) |
| 280 | (mlet* monad ((value head) | 313 | (>>= (mproc head) |
| 281 | (result -> (proc value))) | 314 | (lambda (result) |
| 282 | (if result | 315 | (if result |
| 283 | (return result) | 316 | (return result) |
| 284 | (loop tail)))))))) | 317 | (loop tail))))))))) |
| 285 | 318 | ||
| 286 | (define-syntax listm | 319 | (define-syntax listm |
| 287 | (lambda (s) | 320 | (lambda (s) |
diff --git a/guix/packages.scm b/guix/packages.scm index d5bf6dbf65b..cbe6127f284 100644 --- a/guix/packages.scm +++ b/guix/packages.scm | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #:use-module (guix base32) | 26 | #:use-module (guix base32) |
| 27 | #:use-module (guix derivations) | 27 | #:use-module (guix derivations) |
| 28 | #:use-module (guix build-system) | 28 | #:use-module (guix build-system) |
| 29 | #:use-module (guix search-paths) | ||
| 29 | #:use-module (guix gexp) | 30 | #:use-module (guix gexp) |
| 30 | #:use-module (ice-9 match) | 31 | #:use-module (ice-9 match) |
| 31 | #:use-module (ice-9 vlist) | 32 | #:use-module (ice-9 vlist) |
| @@ -36,7 +37,8 @@ | |||
| 36 | #:use-module (srfi srfi-34) | 37 | #:use-module (srfi srfi-34) |
| 37 | #:use-module (srfi srfi-35) | 38 | #:use-module (srfi srfi-35) |
| 38 | #:re-export (%current-system | 39 | #:re-export (%current-system |
| 39 | %current-target-system) | 40 | %current-target-system |
| 41 | search-path-specification) ;for convenience | ||
| 40 | #:export (origin | 42 | #:export (origin |
| 41 | origin? | 43 | origin? |
| 42 | origin-uri | 44 | origin-uri |
| @@ -52,11 +54,6 @@ | |||
| 52 | origin-imported-modules | 54 | origin-imported-modules |
| 53 | base32 | 55 | base32 |
| 54 | 56 | ||
| 55 | <search-path-specification> | ||
| 56 | search-path-specification | ||
| 57 | search-path-specification? | ||
| 58 | search-path-specification->sexp | ||
| 59 | |||
| 60 | package | 57 | package |
| 61 | package? | 58 | package? |
| 62 | package-name | 59 | package-name |
| @@ -82,6 +79,8 @@ | |||
| 82 | package-location | 79 | package-location |
| 83 | package-field-location | 80 | package-field-location |
| 84 | 81 | ||
| 82 | package-direct-sources | ||
| 83 | package-transitive-sources | ||
| 85 | package-direct-inputs | 84 | package-direct-inputs |
| 86 | package-transitive-inputs | 85 | package-transitive-inputs |
| 87 | package-transitive-target-inputs | 86 | package-transitive-target-inputs |
| @@ -186,26 +185,6 @@ representation." | |||
| 186 | ((_ str) | 185 | ((_ str) |
| 187 | #'(nix-base32-string->bytevector str))))) | 186 | #'(nix-base32-string->bytevector str))))) |
| 188 | 187 | ||
| 189 | ;; The specification of a search path. | ||
| 190 | (define-record-type* <search-path-specification> | ||
| 191 | search-path-specification make-search-path-specification | ||
| 192 | search-path-specification? | ||
| 193 | (variable search-path-specification-variable) ;string | ||
| 194 | (files search-path-specification-files) ;list of strings | ||
| 195 | (separator search-path-specification-separator ;string | ||
| 196 | (default ":")) | ||
| 197 | (file-type search-path-specification-file-type ;symbol | ||
| 198 | (default 'directory)) | ||
| 199 | (file-pattern search-path-specification-file-pattern ;#f | string | ||
| 200 | (default #f))) | ||
| 201 | |||
| 202 | (define (search-path-specification->sexp spec) | ||
| 203 | "Return an sexp representing SPEC, a <search-path-specification>. The sexp | ||
| 204 | corresponds to the arguments expected by `set-path-environment-variable'." | ||
| 205 | (match spec | ||
| 206 | (($ <search-path-specification> variable files separator type pattern) | ||
| 207 | `(,variable ,files ,separator ,type ,pattern)))) | ||
| 208 | |||
| 209 | (define %supported-systems | 188 | (define %supported-systems |
| 210 | ;; This is the list of system types that are supported. By default, we | 189 | ;; This is the list of system types that are supported. By default, we |
| 211 | ;; expect all packages to build successfully here. | 190 | ;; expect all packages to build successfully here. |
| @@ -527,6 +506,28 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." | |||
| 527 | ((input rest ...) | 506 | ((input rest ...) |
| 528 | (loop rest (cons input result)))))) | 507 | (loop rest (cons input result)))))) |
| 529 | 508 | ||
| 509 | (define (package-direct-sources package) | ||
| 510 | "Return all source origins associated with PACKAGE; including origins in | ||
| 511 | PACKAGE's inputs." | ||
| 512 | `(,@(or (and=> (package-source package) list) '()) | ||
| 513 | ,@(filter-map (match-lambda | ||
| 514 | ((_ (? origin? orig) _ ...) | ||
| 515 | orig) | ||
| 516 | (_ #f)) | ||
| 517 | (package-direct-inputs package)))) | ||
| 518 | |||
| 519 | (define (package-transitive-sources package) | ||
| 520 | "Return PACKAGE's direct sources, and their direct sources, recursively." | ||
| 521 | (delete-duplicates | ||
| 522 | (concatenate (filter-map (match-lambda | ||
| 523 | ((_ (? origin? orig) _ ...) | ||
| 524 | (list orig)) | ||
| 525 | ((_ (? package? p) _ ...) | ||
| 526 | (package-direct-sources p)) | ||
| 527 | (_ #f)) | ||
| 528 | (bag-transitive-inputs | ||
| 529 | (package->bag package)))))) | ||
| 530 | |||
| 530 | (define (package-direct-inputs package) | 531 | (define (package-direct-inputs package) |
| 531 | "Return all the direct inputs of PACKAGE---i.e, its direct inputs along | 532 | "Return all the direct inputs of PACKAGE---i.e, its direct inputs along |
| 532 | with their propagated inputs." | 533 | with their propagated inputs." |
diff --git a/guix/profiles.scm b/guix/profiles.scm index 4bb309305b1..28150affb6f 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> | 3 | ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> |
| 4 | ;;; Copyright © 2014 Alex Kost <alezost@gmail.com> | 4 | ;;; Copyright © 2014 Alex Kost <alezost@gmail.com> |
| 5 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | 5 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
| 6 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> | ||
| 6 | ;;; | 7 | ;;; |
| 7 | ;;; This file is part of GNU Guix. | 8 | ;;; This file is part of GNU Guix. |
| 8 | ;;; | 9 | ;;; |
| @@ -22,8 +23,9 @@ | |||
| 22 | (define-module (guix profiles) | 23 | (define-module (guix profiles) |
| 23 | #:use-module (guix utils) | 24 | #:use-module (guix utils) |
| 24 | #:use-module (guix records) | 25 | #:use-module (guix records) |
| 25 | #:use-module (guix derivations) | ||
| 26 | #:use-module (guix packages) | 26 | #:use-module (guix packages) |
| 27 | #:use-module (guix derivations) | ||
| 28 | #:use-module (guix search-paths) | ||
| 27 | #:use-module (guix gexp) | 29 | #:use-module (guix gexp) |
| 28 | #:use-module (guix monads) | 30 | #:use-module (guix monads) |
| 29 | #:use-module (guix store) | 31 | #:use-module (guix store) |
| @@ -59,6 +61,7 @@ | |||
| 59 | manifest-entry-output | 61 | manifest-entry-output |
| 60 | manifest-entry-item | 62 | manifest-entry-item |
| 61 | manifest-entry-dependencies | 63 | manifest-entry-dependencies |
| 64 | manifest-entry-search-paths | ||
| 62 | 65 | ||
| 63 | manifest-pattern | 66 | manifest-pattern |
| 64 | manifest-pattern? | 67 | manifest-pattern? |
| @@ -78,6 +81,7 @@ | |||
| 78 | 81 | ||
| 79 | profile-manifest | 82 | profile-manifest |
| 80 | package->manifest-entry | 83 | package->manifest-entry |
| 84 | packages->manifest | ||
| 81 | %default-profile-hooks | 85 | %default-profile-hooks |
| 82 | profile-derivation | 86 | profile-derivation |
| 83 | generation-number | 87 | generation-number |
| @@ -133,6 +137,8 @@ | |||
| 133 | (default "out")) | 137 | (default "out")) |
| 134 | (item manifest-entry-item) ; package | store path | 138 | (item manifest-entry-item) ; package | store path |
| 135 | (dependencies manifest-entry-dependencies ; (store path | package)* | 139 | (dependencies manifest-entry-dependencies ; (store path | package)* |
| 140 | (default '())) | ||
| 141 | (search-paths manifest-entry-search-paths ; search-path-specification* | ||
| 136 | (default '()))) | 142 | (default '()))) |
| 137 | 143 | ||
| 138 | (define-record-type* <manifest-pattern> manifest-pattern | 144 | (define-record-type* <manifest-pattern> manifest-pattern |
| @@ -165,25 +171,72 @@ omitted or #f, use the first output of PACKAGE." | |||
| 165 | (version (package-version package)) | 171 | (version (package-version package)) |
| 166 | (output (or output (car (package-outputs package)))) | 172 | (output (or output (car (package-outputs package)))) |
| 167 | (item package) | 173 | (item package) |
| 168 | (dependencies (delete-duplicates deps))))) | 174 | (dependencies (delete-duplicates deps)) |
| 175 | (search-paths (package-native-search-paths package))))) | ||
| 176 | |||
| 177 | (define (packages->manifest packages) | ||
| 178 | "Return a list of manifest entries, one for each item listed in PACKAGES. | ||
| 179 | Elements of PACKAGES can be either package objects or package/string tuples | ||
| 180 | denoting a specific output of a package." | ||
| 181 | (manifest | ||
| 182 | (map (match-lambda | ||
| 183 | ((package output) | ||
| 184 | (package->manifest-entry package output)) | ||
| 185 | (package | ||
| 186 | (package->manifest-entry package))) | ||
| 187 | packages))) | ||
| 169 | 188 | ||
| 170 | (define (manifest->gexp manifest) | 189 | (define (manifest->gexp manifest) |
| 171 | "Return a representation of MANIFEST as a gexp." | 190 | "Return a representation of MANIFEST as a gexp." |
| 172 | (define (entry->gexp entry) | 191 | (define (entry->gexp entry) |
| 173 | (match entry | 192 | (match entry |
| 174 | (($ <manifest-entry> name version output (? string? path) (deps ...)) | 193 | (($ <manifest-entry> name version output (? string? path) |
| 175 | #~(#$name #$version #$output #$path #$deps)) | 194 | (deps ...) (search-paths ...)) |
| 176 | (($ <manifest-entry> name version output (? package? package) (deps ...)) | 195 | #~(#$name #$version #$output #$path |
| 196 | (propagated-inputs #$deps) | ||
| 197 | (search-paths #$(map search-path-specification->sexp | ||
| 198 | search-paths)))) | ||
| 199 | (($ <manifest-entry> name version output (? package? package) | ||
| 200 | (deps ...) (search-paths ...)) | ||
| 177 | #~(#$name #$version #$output | 201 | #~(#$name #$version #$output |
| 178 | (ungexp package (or output "out")) #$deps)))) | 202 | (ungexp package (or output "out")) |
| 203 | (propagated-inputs #$deps) | ||
| 204 | (search-paths #$(map search-path-specification->sexp | ||
| 205 | search-paths)))))) | ||
| 179 | 206 | ||
| 180 | (match manifest | 207 | (match manifest |
| 181 | (($ <manifest> (entries ...)) | 208 | (($ <manifest> (entries ...)) |
| 182 | #~(manifest (version 1) | 209 | #~(manifest (version 2) |
| 183 | (packages #$(map entry->gexp entries)))))) | 210 | (packages #$(map entry->gexp entries)))))) |
| 184 | 211 | ||
| 212 | (define (find-package name version) | ||
| 213 | "Return a package from the distro matching NAME and possibly VERSION. This | ||
| 214 | procedure is here for backward-compatibility and will eventually vanish." | ||
| 215 | (define find-best-packages-by-name ;break abstractions | ||
| 216 | (module-ref (resolve-interface '(gnu packages)) | ||
| 217 | 'find-best-packages-by-name)) | ||
| 218 | |||
| 219 | ;; Use 'find-best-packages-by-name' and not 'find-packages-by-name'; the | ||
| 220 | ;; former traverses the module tree only once and then allows for efficient | ||
| 221 | ;; access via a vhash. | ||
| 222 | (match (find-best-packages-by-name name version) | ||
| 223 | ((p _ ...) p) | ||
| 224 | (_ | ||
| 225 | (match (find-best-packages-by-name name #f) | ||
| 226 | ((p _ ...) p) | ||
| 227 | (_ #f))))) | ||
| 228 | |||
| 185 | (define (sexp->manifest sexp) | 229 | (define (sexp->manifest sexp) |
| 186 | "Parse SEXP as a manifest." | 230 | "Parse SEXP as a manifest." |
| 231 | (define (infer-search-paths name version) | ||
| 232 | ;; Infer the search path specifications for NAME-VERSION by looking up a | ||
| 233 | ;; same-named package in the distro. Useful for the old manifest formats | ||
| 234 | ;; that did not store search path info. | ||
| 235 | (let ((package (find-package name version))) | ||
| 236 | (if package | ||
| 237 | (package-native-search-paths package) | ||
| 238 | '()))) | ||
| 239 | |||
| 187 | (match sexp | 240 | (match sexp |
| 188 | (('manifest ('version 0) | 241 | (('manifest ('version 0) |
| 189 | ('packages ((name version output path) ...))) | 242 | ('packages ((name version output path) ...))) |
| @@ -193,7 +246,8 @@ omitted or #f, use the first output of PACKAGE." | |||
| 193 | (name name) | 246 | (name name) |
| 194 | (version version) | 247 | (version version) |
| 195 | (output output) | 248 | (output output) |
| 196 | (item path))) | 249 | (item path) |
| 250 | (search-paths (infer-search-paths name version)))) | ||
| 197 | name version output path))) | 251 | name version output path))) |
| 198 | 252 | ||
| 199 | ;; Version 1 adds a list of propagated inputs to the | 253 | ;; Version 1 adds a list of propagated inputs to the |
| @@ -215,11 +269,31 @@ omitted or #f, use the first output of PACKAGE." | |||
| 215 | (version version) | 269 | (version version) |
| 216 | (output output) | 270 | (output output) |
| 217 | (item path) | 271 | (item path) |
| 218 | (dependencies deps)))) | 272 | (dependencies deps) |
| 273 | (search-paths (infer-search-paths name version))))) | ||
| 219 | name version output path deps))) | 274 | name version output path deps))) |
| 220 | 275 | ||
| 276 | ;; Version 2 adds search paths and is slightly more verbose. | ||
| 277 | (('manifest ('version 2 minor-version ...) | ||
| 278 | ('packages ((name version output path | ||
| 279 | ('propagated-inputs deps) | ||
| 280 | ('search-paths search-paths) | ||
| 281 | extra-stuff ...) | ||
| 282 | ...))) | ||
| 283 | (manifest | ||
| 284 | (map (lambda (name version output path deps search-paths) | ||
| 285 | (manifest-entry | ||
| 286 | (name name) | ||
| 287 | (version version) | ||
| 288 | (output output) | ||
| 289 | (item path) | ||
| 290 | (dependencies deps) | ||
| 291 | (search-paths (map sexp->search-path-specification | ||
| 292 | search-paths)))) | ||
| 293 | name version output path deps search-paths))) | ||
| 221 | (_ | 294 | (_ |
| 222 | (error "unsupported manifest format" manifest)))) | 295 | (raise (condition |
| 296 | (&message (message "unsupported manifest format"))))))) | ||
| 223 | 297 | ||
| 224 | (define (read-manifest port) | 298 | (define (read-manifest port) |
| 225 | "Return the packages listed in MANIFEST." | 299 | "Return the packages listed in MANIFEST." |
| @@ -409,7 +483,7 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." | |||
| 409 | (module-ref (resolve-interface '(gnu packages haskell)) 'ghc)) | 483 | (module-ref (resolve-interface '(gnu packages haskell)) 'ghc)) |
| 410 | 484 | ||
| 411 | (define build | 485 | (define build |
| 412 | #~(begin | 486 | #~(begin |
| 413 | (use-modules (guix build utils) | 487 | (use-modules (guix build utils) |
| 414 | (srfi srfi-1) (srfi srfi-26) | 488 | (srfi srfi-1) (srfi srfi-26) |
| 415 | (ice-9 ftw)) | 489 | (ice-9 ftw)) |
| @@ -418,20 +492,20 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." | |||
| 418 | (let* ((base (basename #+ghc))) | 492 | (let* ((base (basename #+ghc))) |
| 419 | (string-drop base | 493 | (string-drop base |
| 420 | (+ 1 (string-index base #\-))))) | 494 | (+ 1 (string-index base #\-))))) |
| 421 | 495 | ||
| 422 | (define db-subdir | 496 | (define db-subdir |
| 423 | (string-append "lib/" ghc-name-version "/package.conf.d")) | 497 | (string-append "lib/" ghc-name-version "/package.conf.d")) |
| 424 | 498 | ||
| 425 | (define db-dir | 499 | (define db-dir |
| 426 | (string-append #$output "/" db-subdir)) | 500 | (string-append #$output "/" db-subdir)) |
| 427 | 501 | ||
| 428 | (define (conf-files top) | 502 | (define (conf-files top) |
| 429 | (find-files (string-append top "/" db-subdir) "\\.conf$")) | 503 | (find-files (string-append top "/" db-subdir) "\\.conf$")) |
| 430 | 504 | ||
| 431 | (define (copy-conf-file conf) | 505 | (define (copy-conf-file conf) |
| 432 | (let ((base (basename conf))) | 506 | (let ((base (basename conf))) |
| 433 | (copy-file conf (string-append db-dir "/" base)))) | 507 | (copy-file conf (string-append db-dir "/" base)))) |
| 434 | 508 | ||
| 435 | (system* (string-append #+ghc "/bin/ghc-pkg") "init" db-dir) | 509 | (system* (string-append #+ghc "/bin/ghc-pkg") "init" db-dir) |
| 436 | (for-each copy-conf-file | 510 | (for-each copy-conf-file |
| 437 | (append-map conf-files | 511 | (append-map conf-files |
| @@ -443,12 +517,14 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." | |||
| 443 | (for-each delete-file (find-files db-dir "\\.conf$")) | 517 | (for-each delete-file (find-files db-dir "\\.conf$")) |
| 444 | success))) | 518 | success))) |
| 445 | 519 | ||
| 446 | ;; Don't depend on GHC when there's nothing to do. | 520 | (with-monad %store-monad |
| 447 | (and (any (cut string-prefix? "ghc" <>) | 521 | ;; Don't depend on GHC when there's nothing to do. |
| 448 | (map manifest-entry-name (manifest-entries manifest))) | 522 | (if (any (cut string-prefix? "ghc" <>) |
| 449 | (gexp->derivation "ghc-package-cache" build | 523 | (map manifest-entry-name (manifest-entries manifest))) |
| 450 | #:modules '((guix build utils)) | 524 | (gexp->derivation "ghc-package-cache" build |
| 451 | #:local-build? #t))) | 525 | #:modules '((guix build utils)) |
| 526 | #:local-build? #t) | ||
| 527 | (return #f)))) | ||
| 452 | 528 | ||
| 453 | (define (ca-certificate-bundle manifest) | 529 | (define (ca-certificate-bundle manifest) |
| 454 | "Return a derivation that builds a single-file bundle containing the CA | 530 | "Return a derivation that builds a single-file bundle containing the CA |
| @@ -513,12 +589,92 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx." | |||
| 513 | #:modules '((guix build utils)) | 589 | #:modules '((guix build utils)) |
| 514 | #:local-build? #t)) | 590 | #:local-build? #t)) |
| 515 | 591 | ||
| 592 | (define (gtk-icon-themes manifest) | ||
| 593 | "Return a derivation that unions all icon themes from manifest entries and | ||
| 594 | creates the GTK+ 'icon-theme.cache' file for each theme." | ||
| 595 | ;; Return as a monadic value the GTK+ package or store path referenced by the | ||
| 596 | ;; manifest ENTRY, or #f if not referenced. | ||
| 597 | (define (entry-lookup-gtk+ entry) | ||
| 598 | (define (find-among-inputs inputs) | ||
| 599 | (find (lambda (input) | ||
| 600 | (and (package? input) | ||
| 601 | (string=? "gtk+" (package-name input)))) | ||
| 602 | inputs)) | ||
| 603 | |||
| 604 | (define (find-among-store-items items) | ||
| 605 | (find (lambda (item) | ||
| 606 | (equal? "gtk+" | ||
| 607 | (package-name->name+version | ||
| 608 | (store-path-package-name item)))) | ||
| 609 | items)) | ||
| 610 | |||
| 611 | ;; TODO: Factorize. | ||
| 612 | (define references* | ||
| 613 | (store-lift references)) | ||
| 614 | |||
| 615 | (with-monad %store-monad | ||
| 616 | (match (manifest-entry-item entry) | ||
| 617 | ((? package? package) | ||
| 618 | (match (package-transitive-inputs package) | ||
| 619 | (((labels inputs . _) ...) | ||
| 620 | (return (find-among-inputs inputs))))) | ||
| 621 | ((? string? item) | ||
| 622 | (mlet %store-monad ((refs (references* item))) | ||
| 623 | (return (find-among-store-items refs))))))) | ||
| 624 | |||
| 625 | (define (manifest-lookup-gtk+ manifest) | ||
| 626 | (anym %store-monad | ||
| 627 | entry-lookup-gtk+ (manifest-entries manifest))) | ||
| 628 | |||
| 629 | (mlet %store-monad ((gtk+ (manifest-lookup-gtk+ manifest))) | ||
| 630 | (define build | ||
| 631 | #~(begin | ||
| 632 | (use-modules (guix build utils) | ||
| 633 | (guix build union) | ||
| 634 | (guix build profiles) | ||
| 635 | (srfi srfi-26) | ||
| 636 | (ice-9 ftw)) | ||
| 637 | |||
| 638 | (let* ((destdir (string-append #$output "/share/icons")) | ||
| 639 | (icondirs (filter file-exists? | ||
| 640 | (map (cut string-append <> "/share/icons") | ||
| 641 | '#$(manifest-inputs manifest)))) | ||
| 642 | (update-icon-cache (string-append | ||
| 643 | #+gtk+ "/bin/gtk-update-icon-cache"))) | ||
| 644 | |||
| 645 | ;; Union all the icons. | ||
| 646 | (mkdir-p (string-append #$output "/share")) | ||
| 647 | (union-build destdir icondirs) | ||
| 648 | |||
| 649 | ;; Update the 'icon-theme.cache' file for each icon theme. | ||
| 650 | (for-each | ||
| 651 | (lambda (theme) | ||
| 652 | (let ((dir (string-append destdir "/" theme))) | ||
| 653 | ;; Occasionally DESTDIR contains plain files, such as | ||
| 654 | ;; "abiword_48.png". Ignore these. | ||
| 655 | (when (file-is-directory? dir) | ||
| 656 | (ensure-writable-directory dir) | ||
| 657 | (system* update-icon-cache "-t" dir)))) | ||
| 658 | (scandir destdir (negate (cut member <> '("." "..")))))))) | ||
| 659 | |||
| 660 | ;; Don't run the hook when there's nothing to do. | ||
| 661 | (if gtk+ | ||
| 662 | (gexp->derivation "gtk-icon-themes" build | ||
| 663 | #:modules '((guix build utils) | ||
| 664 | (guix build union) | ||
| 665 | (guix build profiles) | ||
| 666 | (guix search-paths) | ||
| 667 | (guix records)) | ||
| 668 | #:local-build? #t) | ||
| 669 | (return #f)))) | ||
| 670 | |||
| 516 | (define %default-profile-hooks | 671 | (define %default-profile-hooks |
| 517 | ;; This is the list of derivation-returning procedures that are called by | 672 | ;; This is the list of derivation-returning procedures that are called by |
| 518 | ;; default when making a non-empty profile. | 673 | ;; default when making a non-empty profile. |
| 519 | (list info-dir-file | 674 | (list info-dir-file |
| 520 | ghc-package-cache-file | 675 | ghc-package-cache-file |
| 521 | ca-certificate-bundle)) | 676 | ca-certificate-bundle |
| 677 | gtk-icon-themes)) | ||
| 522 | 678 | ||
| 523 | (define* (profile-derivation manifest | 679 | (define* (profile-derivation manifest |
| 524 | #:key | 680 | #:key |
| @@ -529,29 +685,42 @@ the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc." | |||
| 529 | (mlet %store-monad ((extras (if (null? (manifest-entries manifest)) | 685 | (mlet %store-monad ((extras (if (null? (manifest-entries manifest)) |
| 530 | (return '()) | 686 | (return '()) |
| 531 | (sequence %store-monad | 687 | (sequence %store-monad |
| 532 | (filter-map (lambda (hook) | 688 | (map (lambda (hook) |
| 533 | (hook manifest)) | 689 | (hook manifest)) |
| 534 | hooks))))) | 690 | hooks))))) |
| 535 | (define inputs | 691 | (define inputs |
| 536 | (append (map gexp-input extras) | 692 | (append (filter-map (lambda (drv) |
| 693 | (and (derivation? drv) | ||
| 694 | (gexp-input drv))) | ||
| 695 | extras) | ||
| 537 | (manifest-inputs manifest))) | 696 | (manifest-inputs manifest))) |
| 538 | 697 | ||
| 539 | (define builder | 698 | (define builder |
| 540 | #~(begin | 699 | #~(begin |
| 541 | (use-modules (ice-9 pretty-print) | 700 | (use-modules (guix build profiles) |
| 542 | (guix build union)) | 701 | (guix search-paths)) |
| 543 | 702 | ||
| 544 | (setvbuf (current-output-port) _IOLBF) | 703 | (setvbuf (current-output-port) _IOLBF) |
| 545 | (setvbuf (current-error-port) _IOLBF) | 704 | (setvbuf (current-error-port) _IOLBF) |
| 546 | 705 | ||
| 547 | (union-build #$output '#$inputs | 706 | (define search-paths |
| 548 | #:log-port (%make-void-port "w")) | 707 | ;; Search paths of MANIFEST's packages, converted back to their |
| 549 | (call-with-output-file (string-append #$output "/manifest") | 708 | ;; record form. |
| 550 | (lambda (p) | 709 | (map sexp->search-path-specification |
| 551 | (pretty-print '#$(manifest->gexp manifest) p))))) | 710 | '#$(map search-path-specification->sexp |
| 711 | (append-map manifest-entry-search-paths | ||
| 712 | (manifest-entries manifest))))) | ||
| 713 | |||
| 714 | (build-profile #$output '#$inputs | ||
| 715 | #:manifest '#$(manifest->gexp manifest) | ||
| 716 | #:search-paths search-paths))) | ||
| 552 | 717 | ||
| 553 | (gexp->derivation "profile" builder | 718 | (gexp->derivation "profile" builder |
| 554 | #:modules '((guix build union)) | 719 | #:modules '((guix build profiles) |
| 720 | (guix build union) | ||
| 721 | (guix build utils) | ||
| 722 | (guix search-paths) | ||
| 723 | (guix records)) | ||
| 555 | #:local-build? #t))) | 724 | #:local-build? #t))) |
| 556 | 725 | ||
| 557 | (define (profile-regexp profile) | 726 | (define (profile-regexp profile) |
diff --git a/guix/records.scm b/guix/records.scm index fd17e135e11..db59a990526 100644 --- a/guix/records.scm +++ b/guix/records.scm | |||
| @@ -42,102 +42,106 @@ | |||
| 42 | (format #f fmt args ...) | 42 | (format #f fmt args ...) |
| 43 | form)))) | 43 | form)))) |
| 44 | 44 | ||
| 45 | (define* (make-syntactic-constructor type name ctor fields | 45 | (eval-when (expand load eval) |
| 46 | #:key (thunked '()) (defaults '()) | 46 | ;; This procedure is a syntactic helper used by 'define-record-type*', hence |
| 47 | (delayed '())) | 47 | ;; 'eval-when'. |
| 48 | "Make the syntactic constructor NAME for TYPE, that calls CTOR, and expects | 48 | |
| 49 | (define* (make-syntactic-constructor type name ctor fields | ||
| 50 | #:key (thunked '()) (defaults '()) | ||
| 51 | (delayed '())) | ||
| 52 | "Make the syntactic constructor NAME for TYPE, that calls CTOR, and expects | ||
| 49 | all of FIELDS to be initialized. DEFAULTS is the list of FIELD/DEFAULT-VALUE | 53 | all of FIELDS to be initialized. DEFAULTS is the list of FIELD/DEFAULT-VALUE |
| 50 | tuples, THUNKED is the list of identifiers of thunked fields, and DELAYED is | 54 | tuples, THUNKED is the list of identifiers of thunked fields, and DELAYED is |
| 51 | the list of identifiers of delayed fields." | 55 | the list of identifiers of delayed fields." |
| 52 | (with-syntax ((type type) | 56 | (with-syntax ((type type) |
| 53 | (name name) | 57 | (name name) |
| 54 | (ctor ctor) | 58 | (ctor ctor) |
| 55 | (expected fields) | 59 | (expected fields) |
| 56 | (defaults defaults)) | 60 | (defaults defaults)) |
| 57 | #`(define-syntax name | 61 | #`(define-syntax name |
| 58 | (lambda (s) | 62 | (lambda (s) |
| 59 | (define (record-inheritance orig-record field+value) | 63 | (define (record-inheritance orig-record field+value) |
| 60 | ;; Produce code that returns a record identical to ORIG-RECORD, | 64 | ;; Produce code that returns a record identical to ORIG-RECORD, |
| 61 | ;; except that values for the FIELD+VALUE alist prevail. | 65 | ;; except that values for the FIELD+VALUE alist prevail. |
| 62 | (define (field-inherited-value f) | 66 | (define (field-inherited-value f) |
| 63 | (and=> (find (lambda (x) | 67 | (and=> (find (lambda (x) |
| 64 | (eq? f (car (syntax->datum x)))) | 68 | (eq? f (car (syntax->datum x)))) |
| 65 | field+value) | 69 | field+value) |
| 66 | car)) | 70 | car)) |
| 67 | 71 | ||
| 68 | ;; Make sure there are no unknown field names. | 72 | ;; Make sure there are no unknown field names. |
| 69 | (let* ((fields (map (compose car syntax->datum) field+value)) | 73 | (let* ((fields (map (compose car syntax->datum) field+value)) |
| 70 | (unexpected (lset-difference eq? fields 'expected))) | 74 | (unexpected (lset-difference eq? fields 'expected))) |
| 71 | (when (pair? unexpected) | 75 | (when (pair? unexpected) |
| 72 | (record-error 'name s "extraneous field initializers ~a" | 76 | (record-error 'name s "extraneous field initializers ~a" |
| 73 | unexpected))) | 77 | unexpected))) |
| 74 | 78 | ||
| 75 | #`(make-struct type 0 | 79 | #`(make-struct type 0 |
| 76 | #,@(map (lambda (field index) | 80 | #,@(map (lambda (field index) |
| 77 | (or (field-inherited-value field) | 81 | (or (field-inherited-value field) |
| 78 | #`(struct-ref #,orig-record | 82 | #`(struct-ref #,orig-record |
| 79 | #,index))) | 83 | #,index))) |
| 80 | 'expected | 84 | 'expected |
| 81 | (iota (length 'expected))))) | 85 | (iota (length 'expected))))) |
| 82 | 86 | ||
| 83 | (define (thunked-field? f) | 87 | (define (thunked-field? f) |
| 84 | (memq (syntax->datum f) '#,thunked)) | 88 | (memq (syntax->datum f) '#,thunked)) |
| 85 | 89 | ||
| 86 | (define (delayed-field? f) | 90 | (define (delayed-field? f) |
| 87 | (memq (syntax->datum f) '#,delayed)) | 91 | (memq (syntax->datum f) '#,delayed)) |
| 88 | 92 | ||
| 89 | (define (wrap-field-value f value) | 93 | (define (wrap-field-value f value) |
| 90 | (cond ((thunked-field? f) | 94 | (cond ((thunked-field? f) |
| 91 | #`(lambda () #,value)) | 95 | #`(lambda () #,value)) |
| 92 | ((delayed-field? f) | 96 | ((delayed-field? f) |
| 93 | #`(delay #,value)) | 97 | #`(delay #,value)) |
| 94 | (else value))) | 98 | (else value))) |
| 95 | 99 | ||
| 96 | (define (field-bindings field+value) | 100 | (define (field-bindings field+value) |
| 97 | ;; Return field to value bindings, for use in 'let*' below. | 101 | ;; Return field to value bindings, for use in 'let*' below. |
| 98 | (map (lambda (field+value) | 102 | (map (lambda (field+value) |
| 99 | (syntax-case field+value () | 103 | (syntax-case field+value () |
| 100 | ((field value) | 104 | ((field value) |
| 101 | #`(field | 105 | #`(field |
| 102 | #,(wrap-field-value #'field #'value))))) | 106 | #,(wrap-field-value #'field #'value))))) |
| 103 | field+value)) | 107 | field+value)) |
| 104 | 108 | ||
| 105 | (syntax-case s (inherit #,@fields) | 109 | (syntax-case s (inherit #,@fields) |
| 106 | ((_ (inherit orig-record) (field value) (... ...)) | 110 | ((_ (inherit orig-record) (field value) (... ...)) |
| 107 | #`(let* #,(field-bindings #'((field value) (... ...))) | 111 | #`(let* #,(field-bindings #'((field value) (... ...))) |
| 108 | #,(record-inheritance #'orig-record | 112 | #,(record-inheritance #'orig-record |
| 109 | #'((field value) (... ...))))) | 113 | #'((field value) (... ...))))) |
| 110 | ((_ (field value) (... ...)) | 114 | ((_ (field value) (... ...)) |
| 111 | (let ((fields (map syntax->datum #'(field (... ...)))) | 115 | (let ((fields (map syntax->datum #'(field (... ...)))) |
| 112 | (dflt (map (match-lambda | 116 | (dflt (map (match-lambda |
| 113 | ((f v) | 117 | ((f v) |
| 114 | (list (syntax->datum f) v))) | 118 | (list (syntax->datum f) v))) |
| 115 | #'defaults))) | 119 | #'defaults))) |
| 116 | 120 | ||
| 117 | (define (field-value f) | 121 | (define (field-value f) |
| 118 | (or (and=> (find (lambda (x) | 122 | (or (and=> (find (lambda (x) |
| 119 | (eq? f (car (syntax->datum x)))) | 123 | (eq? f (car (syntax->datum x)))) |
| 120 | #'((field value) (... ...))) | 124 | #'((field value) (... ...))) |
| 121 | car) | 125 | car) |
| 122 | (let ((value | 126 | (let ((value |
| 123 | (car (assoc-ref dflt (syntax->datum f))))) | 127 | (car (assoc-ref dflt (syntax->datum f))))) |
| 124 | (wrap-field-value f value)))) | 128 | (wrap-field-value f value)))) |
| 125 | 129 | ||
| 126 | (let ((fields (append fields (map car dflt)))) | 130 | (let ((fields (append fields (map car dflt)))) |
| 127 | (cond ((lset= eq? fields 'expected) | 131 | (cond ((lset= eq? fields 'expected) |
| 128 | #`(let* #,(field-bindings | 132 | #`(let* #,(field-bindings |
| 129 | #'((field value) (... ...))) | 133 | #'((field value) (... ...))) |
| 130 | (ctor #,@(map field-value 'expected)))) | 134 | (ctor #,@(map field-value 'expected)))) |
| 131 | ((pair? (lset-difference eq? fields 'expected)) | 135 | ((pair? (lset-difference eq? fields 'expected)) |
| 132 | (record-error 'name s | 136 | (record-error 'name s |
| 133 | "extraneous field initializers ~a" | 137 | "extraneous field initializers ~a" |
| 134 | (lset-difference eq? fields | 138 | (lset-difference eq? fields |
| 135 | 'expected))) | 139 | 'expected))) |
| 136 | (else | 140 | (else |
| 137 | (record-error 'name s | 141 | (record-error 'name s |
| 138 | "missing field initializers ~a" | 142 | "missing field initializers ~a" |
| 139 | (lset-difference eq? 'expected | 143 | (lset-difference eq? 'expected |
| 140 | fields)))))))))))) | 144 | fields))))))))))))) |
| 141 | 145 | ||
| 142 | (define-syntax define-record-type* | 146 | (define-syntax define-record-type* |
| 143 | (lambda (s) | 147 | (lambda (s) |
diff --git a/guix/scripts/authenticate.scm b/guix/scripts/authenticate.scm index e9900689faa..eedebb4baca 100644 --- a/guix/scripts/authenticate.scm +++ b/guix/scripts/authenticate.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -82,12 +82,6 @@ to stdout upon success." | |||
| 82 | (leave (_ "error: corrupt signature data: ~a~%") | 82 | (leave (_ "error: corrupt signature data: ~a~%") |
| 83 | (canonical-sexp->string signature))))) | 83 | (canonical-sexp->string signature))))) |
| 84 | 84 | ||
| 85 | (define %default-port-conversion-strategy | ||
| 86 | ;; This fluid is in Guile > 2.0.5. | ||
| 87 | (if (defined? '%default-port-conversion-strategy) | ||
| 88 | (@ (guile) %default-port-conversion-strategy) | ||
| 89 | (make-fluid #f))) | ||
| 90 | |||
| 91 | 85 | ||
| 92 | ;;; | 86 | ;;; |
| 93 | ;;; Entry point with 'openssl'-compatible interface. We support this | 87 | ;;; Entry point with 'openssl'-compatible interface. We support this |
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 370c2a37ff9..2307f76b426 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #:autoload (guix download) (download-to-store) | 37 | #:autoload (guix download) (download-to-store) |
| 38 | #:export (%standard-build-options | 38 | #:export (%standard-build-options |
| 39 | set-build-options-from-command-line | 39 | set-build-options-from-command-line |
| 40 | set-build-options-from-command-line* | ||
| 40 | show-build-options-help | 41 | show-build-options-help |
| 41 | 42 | ||
| 42 | guix-build)) | 43 | guix-build)) |
| @@ -139,6 +140,9 @@ options handled by 'set-build-options-from-command-line', and listed in | |||
| 139 | #:print-build-trace (assoc-ref opts 'print-build-trace?) | 140 | #:print-build-trace (assoc-ref opts 'print-build-trace?) |
| 140 | #:verbosity (assoc-ref opts 'verbosity))) | 141 | #:verbosity (assoc-ref opts 'verbosity))) |
| 141 | 142 | ||
| 143 | (define set-build-options-from-command-line* | ||
| 144 | (store-lift set-build-options-from-command-line)) | ||
| 145 | |||
| 142 | (define %standard-build-options | 146 | (define %standard-build-options |
| 143 | ;; List of standard command-line options for tools that build something. | 147 | ;; List of standard command-line options for tools that build something. |
| 144 | (list (option '(#\L "load-path") #t #f | 148 | (list (option '(#\L "load-path") #t #f |
| @@ -228,6 +232,9 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n")) | |||
| 228 | (display (_ " | 232 | (display (_ " |
| 229 | -S, --source build the packages' source derivations")) | 233 | -S, --source build the packages' source derivations")) |
| 230 | (display (_ " | 234 | (display (_ " |
| 235 | --sources[=TYPE] build source derivations; TYPE may optionally be one | ||
| 236 | of \"package\", \"all\" (default), or \"transitive\"")) | ||
| 237 | (display (_ " | ||
| 231 | -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"")) | 238 | -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"")) |
| 232 | (display (_ " | 239 | (display (_ " |
| 233 | --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\"")) | 240 | --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\"")) |
| @@ -262,10 +269,22 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n")) | |||
| 262 | (option '(#\V "version") #f #f | 269 | (option '(#\V "version") #f #f |
| 263 | (lambda args | 270 | (lambda args |
| 264 | (show-version-and-exit "guix build"))) | 271 | (show-version-and-exit "guix build"))) |
| 265 | |||
| 266 | (option '(#\S "source") #f #f | 272 | (option '(#\S "source") #f #f |
| 267 | (lambda (opt name arg result) | 273 | (lambda (opt name arg result) |
| 268 | (alist-cons 'source? #t result))) | 274 | (alist-cons 'source #t result))) |
| 275 | (option '("sources") #f #t | ||
| 276 | (lambda (opt name arg result) | ||
| 277 | (match arg | ||
| 278 | ("package" | ||
| 279 | (alist-cons 'source #t result)) | ||
| 280 | ((or "all" #f) | ||
| 281 | (alist-cons 'source package-direct-sources result)) | ||
| 282 | ("transitive" | ||
| 283 | (alist-cons 'source package-transitive-sources result)) | ||
| 284 | (else | ||
| 285 | (leave (_ "invalid argument: '~a' option argument: ~a, ~ | ||
| 286 | must be one of 'package', 'all', or 'transitive'~%") | ||
| 287 | name arg))))) | ||
| 269 | (option '(#\s "system") #t #f | 288 | (option '(#\s "system") #t #f |
| 270 | (lambda (opt name arg result) | 289 | (lambda (opt name arg result) |
| 271 | (alist-cons 'system arg | 290 | (alist-cons 'system arg |
| @@ -308,28 +327,34 @@ build." | |||
| 308 | (triplet | 327 | (triplet |
| 309 | (cut package-cross-derivation <> <> triplet <>)))) | 328 | (cut package-cross-derivation <> <> triplet <>)))) |
| 310 | 329 | ||
| 311 | (define src? (assoc-ref opts 'source?)) | 330 | (define src (assoc-ref opts 'source)) |
| 312 | (define sys (assoc-ref opts 'system)) | 331 | (define sys (assoc-ref opts 'system)) |
| 313 | (define graft? (assoc-ref opts 'graft?)) | 332 | (define graft? (assoc-ref opts 'graft?)) |
| 314 | 333 | ||
| 315 | (parameterize ((%graft? graft?)) | 334 | (parameterize ((%graft? graft?)) |
| 316 | (let ((opts (options/with-source store | 335 | (let ((opts (options/with-source store |
| 317 | (options/resolve-packages store opts)))) | 336 | (options/resolve-packages store opts)))) |
| 318 | (filter-map (match-lambda | 337 | (concatenate |
| 319 | (('argument . (? package? p)) | 338 | (filter-map (match-lambda |
| 320 | (if src? | 339 | (('argument . (? package? p)) |
| 340 | (match src | ||
| 341 | (#f | ||
| 342 | (list (package->derivation store p sys))) | ||
| 343 | (#t | ||
| 321 | (let ((s (package-source p))) | 344 | (let ((s (package-source p))) |
| 322 | (package-source-derivation store s)) | 345 | (list (package-source-derivation store s)))) |
| 323 | (package->derivation store p sys))) | 346 | (proc |
| 324 | (('argument . (? derivation? drv)) | 347 | (map (cut package-source-derivation store <>) |
| 325 | drv) | 348 | (proc p))))) |
| 326 | (('argument . (? derivation-path? drv)) | 349 | (('argument . (? derivation? drv)) |
| 327 | (call-with-input-file drv read-derivation)) | 350 | (list drv)) |
| 328 | (('argument . (? store-path?)) | 351 | (('argument . (? derivation-path? drv)) |
| 329 | ;; Nothing to do; maybe for --log-file. | 352 | (list (call-with-input-file drv read-derivation))) |
| 330 | #f) | 353 | (('argument . (? store-path?)) |
| 331 | (_ #f)) | 354 | ;; Nothing to do; maybe for --log-file. |
| 332 | opts)))) | 355 | #f) |
| 356 | (_ #f)) | ||
| 357 | opts))))) | ||
| 333 | 358 | ||
| 334 | (define (options/resolve-packages store opts) | 359 | (define (options/resolve-packages store opts) |
| 335 | "Return OPTS with package specification strings replaced by actual | 360 | "Return OPTS with package specification strings replaced by actual |
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 80ae924410d..42178091e66 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014 David Thompson <davet@gnu.org> | 2 | ;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org> |
| 3 | ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -22,9 +23,9 @@ | |||
| 22 | #:use-module (guix derivations) | 23 | #:use-module (guix derivations) |
| 23 | #:use-module (guix packages) | 24 | #:use-module (guix packages) |
| 24 | #:use-module (guix profiles) | 25 | #:use-module (guix profiles) |
| 26 | #:use-module (guix search-paths) | ||
| 25 | #:use-module (guix utils) | 27 | #:use-module (guix utils) |
| 26 | #:use-module (guix monads) | 28 | #:use-module (guix monads) |
| 27 | #:use-module (guix build utils) | ||
| 28 | #:use-module (guix scripts build) | 29 | #:use-module (guix scripts build) |
| 29 | #:use-module (gnu packages) | 30 | #:use-module (gnu packages) |
| 30 | #:use-module (ice-9 format) | 31 | #:use-module (ice-9 format) |
| @@ -35,32 +36,20 @@ | |||
| 35 | #:use-module (srfi srfi-98) | 36 | #:use-module (srfi srfi-98) |
| 36 | #:export (guix-environment)) | 37 | #:export (guix-environment)) |
| 37 | 38 | ||
| 38 | (define (for-each-search-path proc inputs derivations pure?) | 39 | (define (evaluate-input-search-paths inputs derivations) |
| 39 | "Apply PROC for each native search path in INPUTS in addition to 'PATH'. | 40 | "Evaluate the native search paths of INPUTS, a list of packages, of the |
| 40 | Use the output paths of DERIVATIONS to build each search path. When PURE? is | 41 | outputs of DERIVATIONS, and return a list of search-path/value pairs." |
| 41 | #t, the existing search path value is ignored. Otherwise, the existing search | 42 | (let ((directories (append-map (lambda (drv) |
| 42 | path value is appended." | 43 | (map (match-lambda |
| 43 | (let ((paths (append-map (lambda (drv) | 44 | ((_ . output) |
| 44 | (map (match-lambda | 45 | (derivation-output-path output))) |
| 45 | ((_ . output) | 46 | (derivation-outputs drv))) |
| 46 | (derivation-output-path output))) | 47 | derivations)) |
| 47 | (derivation-outputs drv))) | 48 | (paths (cons $PATH |
| 48 | derivations))) | 49 | (delete-duplicates |
| 49 | (for-each (match-lambda | 50 | (append-map package-native-search-paths |
| 50 | (($ <search-path-specification> | 51 | inputs))))) |
| 51 | variable directories separator) | 52 | (evaluate-search-paths paths directories))) |
| 52 | (let* ((current (getenv variable)) | ||
| 53 | (path (search-path-as-list directories paths)) | ||
| 54 | (value (list->search-path-as-string path separator))) | ||
| 55 | (proc variable | ||
| 56 | (if (and current (not pure?)) | ||
| 57 | (string-append value separator current) | ||
| 58 | value))))) | ||
| 59 | (cons* (search-path-specification | ||
| 60 | (variable "PATH") | ||
| 61 | (files '("bin" "sbin"))) | ||
| 62 | (delete-duplicates | ||
| 63 | (append-map package-native-search-paths inputs)))))) | ||
| 64 | 53 | ||
| 65 | ;; Protect some env vars from purification. Borrowed from nix-shell. | 54 | ;; Protect some env vars from purification. Borrowed from nix-shell. |
| 66 | (define %precious-variables | 55 | (define %precious-variables |
| @@ -80,15 +69,26 @@ as 'HOME' and 'USER' are left untouched." | |||
| 80 | PURE? is #t, unset the variables in the current environment. Otherwise, | 69 | PURE? is #t, unset the variables in the current environment. Otherwise, |
| 81 | augment existing enviroment variables with additional search paths." | 70 | augment existing enviroment variables with additional search paths." |
| 82 | (when pure? (purify-environment)) | 71 | (when pure? (purify-environment)) |
| 83 | (for-each-search-path setenv inputs derivations pure?)) | 72 | (for-each (match-lambda |
| 73 | ((($ <search-path-specification> variable _ separator) . value) | ||
| 74 | (let ((current (getenv variable))) | ||
| 75 | (setenv variable | ||
| 76 | (if (and current (not pure?)) | ||
| 77 | (string-append value separator current) | ||
| 78 | value))))) | ||
| 79 | (evaluate-input-search-paths inputs derivations))) | ||
| 84 | 80 | ||
| 85 | (define (show-search-paths inputs derivations pure?) | 81 | (define (show-search-paths inputs derivations pure?) |
| 86 | "Display the needed search paths to build an environment that contains the | 82 | "Display the needed search paths to build an environment that contains the |
| 87 | packages within INPUTS. When PURE? is #t, do not augment existing environment | 83 | packages within INPUTS. When PURE? is #t, do not augment existing environment |
| 88 | variables with additional search paths." | 84 | variables with additional search paths." |
| 89 | (for-each-search-path (lambda (variable value) | 85 | (for-each (match-lambda |
| 90 | (format #t "export ~a=\"~a\"~%" variable value)) | 86 | ((search-path . value) |
| 91 | inputs derivations pure?)) | 87 | (display |
| 88 | (search-path-definition search-path value | ||
| 89 | #:kind (if pure? 'exact 'prefix))) | ||
| 90 | (newline))) | ||
| 91 | (evaluate-input-search-paths inputs derivations))) | ||
| 92 | 92 | ||
| 93 | (define (show-help) | 93 | (define (show-help) |
| 94 | (display (_ "Usage: guix environment [OPTION]... PACKAGE... | 94 | (display (_ "Usage: guix environment [OPTION]... PACKAGE... |
| @@ -103,6 +103,9 @@ shell command in that environment.\n")) | |||
| 103 | (display (_ " | 103 | (display (_ " |
| 104 | -E, --exec=COMMAND execute COMMAND in new environment")) | 104 | -E, --exec=COMMAND execute COMMAND in new environment")) |
| 105 | (display (_ " | 105 | (display (_ " |
| 106 | --ad-hoc include all specified packages in the environment instead | ||
| 107 | of only their inputs")) | ||
| 108 | (display (_ " | ||
| 106 | --pure unset existing environment variables")) | 109 | --pure unset existing environment variables")) |
| 107 | (display (_ " | 110 | (display (_ " |
| 108 | --search-paths display needed environment variable definitions")) | 111 | --search-paths display needed environment variable definitions")) |
| @@ -147,6 +150,9 @@ shell command in that environment.\n")) | |||
| 147 | (option '(#\e "expression") #t #f | 150 | (option '(#\e "expression") #t #f |
| 148 | (lambda (opt name arg result) | 151 | (lambda (opt name arg result) |
| 149 | (alist-cons 'expression arg result))) | 152 | (alist-cons 'expression arg result))) |
| 153 | (option '("ad-hoc") #f #f | ||
| 154 | (lambda (opt name arg result) | ||
| 155 | (alist-cons 'ad-hoc? #t result))) | ||
| 150 | (option '(#\n "dry-run") #f #f | 156 | (option '(#\n "dry-run") #f #f |
| 151 | (lambda (opt name arg result) | 157 | (lambda (opt name arg result) |
| 152 | (alist-cons 'dry-run? #t result))) | 158 | (alist-cons 'dry-run? #t result))) |
| @@ -191,12 +197,17 @@ packages." | |||
| 191 | (delete-duplicates | 197 | (delete-duplicates |
| 192 | (append-map transitive-inputs packages))) | 198 | (append-map transitive-inputs packages))) |
| 193 | 199 | ||
| 194 | ;; TODO: Deduplicate these. | 200 | (define (packages+propagated-inputs packages) |
| 195 | (define show-what-to-build* | 201 | "Return a list containing PACKAGES plus all of their propagated inputs." |
| 196 | (store-lift show-what-to-build)) | 202 | (delete-duplicates |
| 197 | 203 | (append packages | |
| 198 | (define set-build-options-from-command-line* | 204 | (map (match-lambda |
| 199 | (store-lift set-build-options-from-command-line)) | 205 | ((or (_ (? package? package)) |
| 206 | (_ (? package? package) _)) | ||
| 207 | package) | ||
| 208 | (_ #f)) | ||
| 209 | (append-map package-transitive-propagated-inputs | ||
| 210 | packages))))) | ||
| 200 | 211 | ||
| 201 | (define (build-inputs inputs opts) | 212 | (define (build-inputs inputs opts) |
| 202 | "Build the packages in INPUTS using the build options in OPTS." | 213 | "Build the packages in INPUTS using the build options in OPTS." |
| @@ -225,9 +236,12 @@ packages." | |||
| 225 | (let* ((opts (parse-command-line args %options (list %default-options) | 236 | (let* ((opts (parse-command-line args %options (list %default-options) |
| 226 | #:argument-handler handle-argument)) | 237 | #:argument-handler handle-argument)) |
| 227 | (pure? (assoc-ref opts 'pure)) | 238 | (pure? (assoc-ref opts 'pure)) |
| 239 | (ad-hoc? (assoc-ref opts 'ad-hoc?)) | ||
| 228 | (command (assoc-ref opts 'exec)) | 240 | (command (assoc-ref opts 'exec)) |
| 229 | (inputs (packages->transitive-inputs | 241 | (packages (pick-all (options/resolve-packages opts) 'package)) |
| 230 | (pick-all (options/resolve-packages opts) 'package))) | 242 | (inputs (if ad-hoc? |
| 243 | (packages+propagated-inputs packages) | ||
| 244 | (packages->transitive-inputs packages))) | ||
| 231 | (drvs (run-with-store store | 245 | (drvs (run-with-store store |
| 232 | (mbegin %store-monad | 246 | (mbegin %store-monad |
| 233 | (set-guile-for-build (default-guile)) | 247 | (set-guile-for-build (default-guile)) |
diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index ed16cab8f99..64038936877 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -44,6 +44,8 @@ Invoke the garbage collector.\n")) | |||
| 44 | (display (_ " | 44 | (display (_ " |
| 45 | -d, --delete attempt to delete PATHS")) | 45 | -d, --delete attempt to delete PATHS")) |
| 46 | (display (_ " | 46 | (display (_ " |
| 47 | --optimize optimize the store by deduplicating identical files")) | ||
| 48 | (display (_ " | ||
| 47 | --list-dead list dead paths")) | 49 | --list-dead list dead paths")) |
| 48 | (display (_ " | 50 | (display (_ " |
| 49 | --list-live list live paths")) | 51 | --list-live list live paths")) |
| @@ -56,6 +58,11 @@ Invoke the garbage collector.\n")) | |||
| 56 | --referrers list the referrers of PATHS")) | 58 | --referrers list the referrers of PATHS")) |
| 57 | (newline) | 59 | (newline) |
| 58 | (display (_ " | 60 | (display (_ " |
| 61 | --verify[=OPTS] verify the integrity of the store; OPTS is a | ||
| 62 | comma-separated combination of 'repair' and | ||
| 63 | 'contents'")) | ||
| 64 | (newline) | ||
| 65 | (display (_ " | ||
| 59 | -h, --help display this help and exit")) | 66 | -h, --help display this help and exit")) |
| 60 | (display (_ " | 67 | (display (_ " |
| 61 | -V, --version display version information and exit")) | 68 | -V, --version display version information and exit")) |
| @@ -88,6 +95,21 @@ Invoke the garbage collector.\n")) | |||
| 88 | (lambda (opt name arg result) | 95 | (lambda (opt name arg result) |
| 89 | (alist-cons 'action 'delete | 96 | (alist-cons 'action 'delete |
| 90 | (alist-delete 'action result)))) | 97 | (alist-delete 'action result)))) |
| 98 | (option '("optimize") #f #f | ||
| 99 | (lambda (opt name arg result) | ||
| 100 | (alist-cons 'action 'optimize | ||
| 101 | (alist-delete 'action result)))) | ||
| 102 | (option '("verify") #f #t | ||
| 103 | (let ((not-comma (char-set-complement (char-set #\,)))) | ||
| 104 | (lambda (opt name arg result) | ||
| 105 | (let ((options (if arg | ||
| 106 | (map string->symbol | ||
| 107 | (string-tokenize arg not-comma)) | ||
| 108 | '()))) | ||
| 109 | (alist-cons 'action 'verify | ||
| 110 | (alist-cons 'verify-options options | ||
| 111 | (alist-delete 'action | ||
| 112 | result))))))) | ||
| 91 | (option '("list-dead") #f #f | 113 | (option '("list-dead") #f #f |
| 92 | (lambda (opt name arg result) | 114 | (lambda (opt name arg result) |
| 93 | (alist-cons 'action 'list-dead | 115 | (alist-cons 'action 'list-dead |
| @@ -162,13 +184,21 @@ Invoke the garbage collector.\n")) | |||
| 162 | (collect-garbage store min-freed) | 184 | (collect-garbage store min-freed) |
| 163 | (collect-garbage store)))) | 185 | (collect-garbage store)))) |
| 164 | ((delete) | 186 | ((delete) |
| 165 | (delete-paths store paths)) | 187 | (delete-paths store (map direct-store-path paths))) |
| 166 | ((list-references) | 188 | ((list-references) |
| 167 | (list-relatives references)) | 189 | (list-relatives references)) |
| 168 | ((list-requisites) | 190 | ((list-requisites) |
| 169 | (list-relatives requisites)) | 191 | (list-relatives requisites)) |
| 170 | ((list-referrers) | 192 | ((list-referrers) |
| 171 | (list-relatives referrers)) | 193 | (list-relatives referrers)) |
| 194 | ((optimize) | ||
| 195 | (optimize-store store)) | ||
| 196 | ((verify) | ||
| 197 | (let ((options (assoc-ref opts 'verify-options))) | ||
| 198 | (exit | ||
| 199 | (verify-store store | ||
| 200 | #:check-contents? (memq 'contents options) | ||
| 201 | #:repair? (memq 'repair options))))) | ||
| 172 | ((list-dead) | 202 | ((list-dead) |
| 173 | (for-each (cut simple-format #t "~a~%" <>) | 203 | (for-each (cut simple-format #t "~a~%" <>) |
| 174 | (dead-paths store))) | 204 | (dead-paths store))) |
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 06b4c17573d..45ce092f13a 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm | |||
| @@ -86,6 +86,7 @@ rather than \\n." | |||
| 86 | Run IMPORTER with ARGS.\n")) | 86 | Run IMPORTER with ARGS.\n")) |
| 87 | (newline) | 87 | (newline) |
| 88 | (display (_ "IMPORTER must be one of the importers listed below:\n")) | 88 | (display (_ "IMPORTER must be one of the importers listed below:\n")) |
| 89 | (newline) | ||
| 89 | (format #t "~{ ~a~%~}" importers) | 90 | (format #t "~{ ~a~%~}" importers) |
| 90 | (display (_ " | 91 | (display (_ " |
| 91 | -h, --help display this help and exit")) | 92 | -h, --help display this help and exit")) |
diff --git a/guix/scripts/import/hackage.scm b/guix/scripts/import/hackage.scm index f7c18cd3bf5..e5e9b0ed647 100644 --- a/guix/scripts/import/hackage.scm +++ b/guix/scripts/import/hackage.scm | |||
| @@ -34,7 +34,9 @@ | |||
| 34 | ;;; | 34 | ;;; |
| 35 | 35 | ||
| 36 | (define %default-options | 36 | (define %default-options |
| 37 | '((include-test-dependencies? . #t))) | 37 | '((include-test-dependencies? . #t) |
| 38 | (read-from-stdin? . #f) | ||
| 39 | ('cabal-environment . '()))) | ||
| 38 | 40 | ||
| 39 | (define (show-help) | 41 | (define (show-help) |
| 40 | (display (_ "Usage: guix import hackage PACKAGE-NAME | 42 | (display (_ "Usage: guix import hackage PACKAGE-NAME |
| @@ -45,8 +47,13 @@ package will be generated. If no version suffix is pecified, then the | |||
| 45 | generated package definition will correspond to the latest available | 47 | generated package definition will correspond to the latest available |
| 46 | version.\n")) | 48 | version.\n")) |
| 47 | (display (_ " | 49 | (display (_ " |
| 50 | -e ALIST, --cabal-environment=ALIST | ||
| 51 | specify environment for Cabal evaluation")) | ||
| 52 | (display (_ " | ||
| 48 | -h, --help display this help and exit")) | 53 | -h, --help display this help and exit")) |
| 49 | (display (_ " | 54 | (display (_ " |
| 55 | -s, --stdin read from standard input")) | ||
| 56 | (display (_ " | ||
| 50 | -t, --no-test-dependencies don't include test only dependencies")) | 57 | -t, --no-test-dependencies don't include test only dependencies")) |
| 51 | (display (_ " | 58 | (display (_ " |
| 52 | -V, --version display version information and exit")) | 59 | -V, --version display version information and exit")) |
| @@ -67,6 +74,16 @@ version.\n")) | |||
| 67 | (alist-cons 'include-test-dependencies? #f | 74 | (alist-cons 'include-test-dependencies? #f |
| 68 | (alist-delete 'include-test-dependencies? | 75 | (alist-delete 'include-test-dependencies? |
| 69 | result)))) | 76 | result)))) |
| 77 | (option '(#\s "stdin") #f #f | ||
| 78 | (lambda (opt name arg result) | ||
| 79 | (alist-cons 'read-from-stdin? #t | ||
| 80 | (alist-delete 'read-from-stdin? | ||
| 81 | result)))) | ||
| 82 | (option '(#\e "cabal-environment") #t #f | ||
| 83 | (lambda (opt name arg result) | ||
| 84 | (alist-cons 'cabal-environment (read/eval arg) | ||
| 85 | (alist-delete 'cabal-environment | ||
| 86 | result)))) | ||
| 70 | %standard-import-options)) | 87 | %standard-import-options)) |
| 71 | 88 | ||
| 72 | 89 | ||
| @@ -84,23 +101,42 @@ version.\n")) | |||
| 84 | (alist-cons 'argument arg result)) | 101 | (alist-cons 'argument arg result)) |
| 85 | %default-options)) | 102 | %default-options)) |
| 86 | 103 | ||
| 104 | (define (run-importer package-name opts error-fn) | ||
| 105 | (let ((sexp (hackage->guix-package | ||
| 106 | package-name | ||
| 107 | #:include-test-dependencies? | ||
| 108 | (assoc-ref opts 'include-test-dependencies?) | ||
| 109 | #:port (if (assoc-ref opts 'read-from-stdin?) | ||
| 110 | (current-input-port) | ||
| 111 | #f) | ||
| 112 | #:cabal-environment | ||
| 113 | (assoc-ref opts 'cabal-environment)))) | ||
| 114 | (unless sexp (error-fn)) | ||
| 115 | sexp)) | ||
| 116 | |||
| 87 | (let* ((opts (parse-options)) | 117 | (let* ((opts (parse-options)) |
| 88 | (args (filter-map (match-lambda | 118 | (args (filter-map (match-lambda |
| 89 | (('argument . value) | 119 | (('argument . value) |
| 90 | value) | 120 | value) |
| 91 | (_ #f)) | 121 | (_ #f)) |
| 92 | (reverse opts)))) | 122 | (reverse opts)))) |
| 93 | (match args | 123 | (if (assoc-ref opts 'read-from-stdin?) |
| 94 | ((package-name) | 124 | (match args |
| 95 | (let ((sexp (hackage->guix-package | 125 | (() |
| 96 | package-name | 126 | (run-importer "stdin" opts |
| 97 | #:include-test-dependencies? | 127 | (lambda () |
| 98 | (assoc-ref opts 'include-test-dependencies?)))) | 128 | (leave (_ "failed to import cabal file from '~a'~%")) |
| 99 | (unless sexp | 129 | package-name))) |
| 100 | (leave (_ "failed to download cabal file for package '~a'~%") | 130 | ((many ...) |
| 101 | package-name)) | 131 | (leave (_ "too many arguments~%")))) |
| 102 | sexp)) | 132 | (match args |
| 103 | (() | 133 | ((package-name) |
| 104 | (leave (_ "too few arguments~%"))) | 134 | (run-importer package-name opts |
| 105 | ((many ...) | 135 | (lambda () |
| 106 | (leave (_ "too many arguments~%")))))) | 136 | (leave |
| 137 | (_ "failed to download cabal file for package '~a'~%")) | ||
| 138 | package-name))) | ||
| 139 | (() | ||
| 140 | (leave (_ "too few arguments~%"))) | ||
| 141 | ((many ...) | ||
| 142 | (leave (_ "too many arguments~%"))))))) | ||
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index cced1bda664..3740b71d5e5 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #:use-module (guix ui) | 28 | #:use-module (guix ui) |
| 29 | #:use-module (guix utils) | 29 | #:use-module (guix utils) |
| 30 | #:use-module (guix gnu-maintenance) | 30 | #:use-module (guix gnu-maintenance) |
| 31 | #:use-module (guix monads) | ||
| 31 | #:use-module (gnu packages) | 32 | #:use-module (gnu packages) |
| 32 | #:use-module (ice-9 match) | 33 | #:use-module (ice-9 match) |
| 33 | #:use-module (ice-9 regex) | 34 | #:use-module (ice-9 regex) |
| @@ -41,6 +42,7 @@ | |||
| 41 | #:use-module (web request) | 42 | #:use-module (web request) |
| 42 | #:use-module (web response) | 43 | #:use-module (web response) |
| 43 | #:use-module (srfi srfi-1) | 44 | #:use-module (srfi srfi-1) |
| 45 | #:use-module (srfi srfi-6) ;Unicode string ports | ||
| 44 | #:use-module (srfi srfi-9) | 46 | #:use-module (srfi srfi-9) |
| 45 | #:use-module (srfi srfi-11) | 47 | #:use-module (srfi srfi-11) |
| 46 | #:use-module (srfi srfi-26) | 48 | #:use-module (srfi srfi-26) |
| @@ -71,6 +73,25 @@ | |||
| 71 | (package-full-name package) | 73 | (package-full-name package) |
| 72 | message))) | 74 | message))) |
| 73 | 75 | ||
| 76 | (define (call-with-accumulated-warnings thunk) | ||
| 77 | "Call THUNK, accumulating any warnings in the current state, using the state | ||
| 78 | monad." | ||
| 79 | (let ((port (open-output-string))) | ||
| 80 | (mlet %state-monad ((state (current-state)) | ||
| 81 | (result -> (parameterize ((guix-warning-port port)) | ||
| 82 | (thunk))) | ||
| 83 | (warning -> (get-output-string port))) | ||
| 84 | (mbegin %state-monad | ||
| 85 | (munless (string=? "" warning) | ||
| 86 | (set-current-state (cons warning state))) | ||
| 87 | (return result))))) | ||
| 88 | |||
| 89 | (define-syntax-rule (with-accumulated-warnings exp ...) | ||
| 90 | "Evaluate EXP and accumulate warnings in the state monad." | ||
| 91 | (call-with-accumulated-warnings | ||
| 92 | (lambda () | ||
| 93 | exp ...))) | ||
| 94 | |||
| 74 | 95 | ||
| 75 | ;;; | 96 | ;;; |
| 76 | ;;; Checkers | 97 | ;;; Checkers |
| @@ -287,20 +308,22 @@ response from URI, and additional details, such as the actual HTTP response." | |||
| 287 | (values 'unknown-protocol #f))))) | 308 | (values 'unknown-protocol #f))))) |
| 288 | 309 | ||
| 289 | (define (validate-uri uri package field) | 310 | (define (validate-uri uri package field) |
| 290 | "Return #t if the given URI can be reached, otherwise emit a | 311 | "Return #t if the given URI can be reached, otherwise return #f and emit a |
| 291 | warning for PACKAGE mentionning the FIELD." | 312 | warning for PACKAGE mentionning the FIELD." |
| 292 | (let-values (((status argument) | 313 | (let-values (((status argument) |
| 293 | (probe-uri uri))) | 314 | (probe-uri uri))) |
| 294 | (case status | 315 | (case status |
| 295 | ((http-response) | 316 | ((http-response) |
| 296 | (or (= 200 (response-code argument)) | 317 | (or (= 200 (response-code argument)) |
| 297 | (emit-warning package | 318 | (begin |
| 298 | (format #f | 319 | (emit-warning package |
| 299 | (_ "URI ~a not reachable: ~a (~s)") | 320 | (format #f |
| 300 | (uri->string uri) | 321 | (_ "URI ~a not reachable: ~a (~s)") |
| 301 | (response-code argument) | 322 | (uri->string uri) |
| 302 | (response-reason-phrase argument)) | 323 | (response-code argument) |
| 303 | field))) | 324 | (response-reason-phrase argument)) |
| 325 | field) | ||
| 326 | #f))) | ||
| 304 | ((ftp-response) | 327 | ((ftp-response) |
| 305 | (match argument | 328 | (match argument |
| 306 | (('ok) #t) | 329 | (('ok) #t) |
| @@ -309,7 +332,8 @@ warning for PACKAGE mentionning the FIELD." | |||
| 309 | (format #f | 332 | (format #f |
| 310 | (_ "URI ~a not reachable: ~a (~s)") | 333 | (_ "URI ~a not reachable: ~a (~s)") |
| 311 | (uri->string uri) | 334 | (uri->string uri) |
| 312 | code (string-trim-both message)))))) | 335 | code (string-trim-both message))) |
| 336 | #f))) | ||
| 313 | ((getaddrinfo-error) | 337 | ((getaddrinfo-error) |
| 314 | (emit-warning package | 338 | (emit-warning package |
| 315 | (format #f | 339 | (format #f |
| @@ -432,6 +456,16 @@ descriptions maintained upstream." | |||
| 432 | (define (check-source package) | 456 | (define (check-source package) |
| 433 | "Emit a warning if PACKAGE has an invalid 'source' field, or if that | 457 | "Emit a warning if PACKAGE has an invalid 'source' field, or if that |
| 434 | 'source' is not reachable." | 458 | 'source' is not reachable." |
| 459 | (define (try-uris uris) | ||
| 460 | (run-with-state | ||
| 461 | (anym %state-monad | ||
| 462 | (lambda (uri) | ||
| 463 | (with-accumulated-warnings | ||
| 464 | (validate-uri uri package 'source))) | ||
| 465 | (append-map (cut maybe-expand-mirrors <> %mirrors) | ||
| 466 | uris)) | ||
| 467 | '())) | ||
| 468 | |||
| 435 | (let ((origin (package-source package))) | 469 | (let ((origin (package-source package))) |
| 436 | (when (and origin | 470 | (when (and origin |
| 437 | (eqv? (origin-method origin) url-fetch)) | 471 | (eqv? (origin-method origin) url-fetch)) |
| @@ -439,10 +473,24 @@ descriptions maintained upstream." | |||
| 439 | (uris (if (list? strings) | 473 | (uris (if (list? strings) |
| 440 | (map string->uri strings) | 474 | (map string->uri strings) |
| 441 | (list (string->uri strings))))) | 475 | (list (string->uri strings))))) |
| 476 | |||
| 442 | ;; Just make sure that at least one of the URIs is valid. | 477 | ;; Just make sure that at least one of the URIs is valid. |
| 443 | (any (cut validate-uri <> package 'source) | 478 | (call-with-values |
| 444 | (append-map (cut maybe-expand-mirrors <> %mirrors) | 479 | (lambda () (try-uris uris)) |
| 445 | uris)))))) | 480 | (lambda (success? warnings) |
| 481 | ;; When everything fails, report all of WARNINGS, otherwise don't | ||
| 482 | ;; report anything. | ||
| 483 | ;; | ||
| 484 | ;; XXX: Ideally we'd still allow warnings to be raised if *some* | ||
| 485 | ;; URIs are unreachable, but distinguish that from the error case | ||
| 486 | ;; where *all* the URIs are unreachable. | ||
| 487 | (unless success? | ||
| 488 | (emit-warning package | ||
| 489 | (_ "all the source URIs are unreachable:") | ||
| 490 | 'source) | ||
| 491 | (for-each (lambda (warning) | ||
| 492 | (display warning (guix-warning-port))) | ||
| 493 | (reverse warnings))))))))) | ||
| 446 | 494 | ||
| 447 | (define (check-derivation package) | 495 | (define (check-derivation package) |
| 448 | "Emit a warning if we fail to compile PACKAGE to a derivation." | 496 | "Emit a warning if we fail to compile PACKAGE to a derivation." |
| @@ -527,7 +575,8 @@ descriptions maintained upstream." | |||
| 527 | 575 | ||
| 528 | (define (show-help) | 576 | (define (show-help) |
| 529 | (display (_ "Usage: guix lint [OPTION]... [PACKAGE]... | 577 | (display (_ "Usage: guix lint [OPTION]... [PACKAGE]... |
| 530 | Run a set of checkers on the specified package; if none is specified, run the checkers on all packages.\n")) | 578 | Run a set of checkers on the specified package; if none is specified, |
| 579 | run the checkers on all packages.\n")) | ||
| 531 | (display (_ " | 580 | (display (_ " |
| 532 | -c, --checkers=CHECKER1,CHECKER2... | 581 | -c, --checkers=CHECKER1,CHECKER2... |
| 533 | only run the specificed checkers")) | 582 | only run the specificed checkers")) |
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 1e724b4e191..d9f38fb8bcc 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #:use-module (guix derivations) | 25 | #:use-module (guix derivations) |
| 26 | #:use-module (guix packages) | 26 | #:use-module (guix packages) |
| 27 | #:use-module (guix profiles) | 27 | #:use-module (guix profiles) |
| 28 | #:use-module (guix search-paths) | ||
| 28 | #:use-module (guix monads) | 29 | #:use-module (guix monads) |
| 29 | #:use-module (guix utils) | 30 | #:use-module (guix utils) |
| 30 | #:use-module (guix config) | 31 | #:use-module (guix config) |
| @@ -52,6 +53,7 @@ | |||
| 52 | roll-back | 53 | roll-back |
| 53 | delete-generation | 54 | delete-generation |
| 54 | delete-generations | 55 | delete-generations |
| 56 | display-search-paths | ||
| 55 | guix-package)) | 57 | guix-package)) |
| 56 | 58 | ||
| 57 | (define %store | 59 | (define %store |
| @@ -89,6 +91,15 @@ return PROFILE unchanged. The goal is to treat '-p ~/.guix-profile' as if | |||
| 89 | %current-profile | 91 | %current-profile |
| 90 | profile)) | 92 | profile)) |
| 91 | 93 | ||
| 94 | (define (user-friendly-profile profile) | ||
| 95 | "Return either ~/.guix-profile if that's what PROFILE refers to, directly or | ||
| 96 | indirectly, or PROFILE." | ||
| 97 | (if (and %user-profile-directory | ||
| 98 | (false-if-exception | ||
| 99 | (string=? (readlink %user-profile-directory) profile))) | ||
| 100 | %user-profile-directory | ||
| 101 | profile)) | ||
| 102 | |||
| 92 | (define (link-to-empty-profile store generation) | 103 | (define (link-to-empty-profile store generation) |
| 93 | "Link GENERATION, a string, to the empty profile." | 104 | "Link GENERATION, a string, to the empty profile." |
| 94 | (let* ((drv (run-with-store store | 105 | (let* ((drv (run-with-store store |
| @@ -365,77 +376,35 @@ an output path different than CURRENT-PATH." | |||
| 365 | ;;; Search paths. | 376 | ;;; Search paths. |
| 366 | ;;; | 377 | ;;; |
| 367 | 378 | ||
| 368 | (define-syntax-rule (with-null-error-port exp) | ||
| 369 | "Evaluate EXP with the error port pointing to the bit bucket." | ||
| 370 | (with-error-to-port (%make-void-port "w") | ||
| 371 | (lambda () exp))) | ||
| 372 | |||
| 373 | (define* (search-path-environment-variables entries profile | 379 | (define* (search-path-environment-variables entries profile |
| 374 | #:optional (getenv getenv)) | 380 | #:optional (getenv getenv) |
| 381 | #:key (kind 'exact)) | ||
| 375 | "Return environment variable definitions that may be needed for the use of | 382 | "Return environment variable definitions that may be needed for the use of |
| 376 | ENTRIES, a list of manifest entries, in PROFILE. Use GETENV to determine the | 383 | ENTRIES, a list of manifest entries, in PROFILE. Use GETENV to determine the |
| 377 | current settings and report only settings not already effective." | 384 | current settings and report only settings not already effective. KIND |
| 378 | 385 | must be one of 'exact, 'prefix, or 'suffix, depending on the kind of search | |
| 379 | ;; Prefer ~/.guix-profile to the real profile directory name. | 386 | path definition to be returned." |
| 380 | (let ((profile (if (and %user-profile-directory | 387 | (let ((search-paths (delete-duplicates |
| 381 | (false-if-exception | 388 | (cons $PATH |
| 382 | (string=? (readlink %user-profile-directory) | 389 | (append-map manifest-entry-search-paths |
| 383 | profile))) | 390 | entries))))) |
| 384 | %user-profile-directory | 391 | (filter-map (match-lambda |
| 385 | profile))) | 392 | ((spec . value) |
| 386 | 393 | (let ((variable (search-path-specification-variable spec)) | |
| 387 | ;; The search path info is not stored in the manifest. Thus, we infer the | 394 | (sep (search-path-specification-separator spec))) |
| 388 | ;; search paths from same-named packages found in the distro. | 395 | (environment-variable-definition variable value |
| 389 | 396 | #:separator sep | |
| 390 | (define manifest-entry->package | 397 | #:kind kind)))) |
| 391 | (match-lambda | 398 | (evaluate-search-paths search-paths (list profile) |
| 392 | (($ <manifest-entry> name version) | 399 | getenv)))) |
| 393 | ;; Use 'find-best-packages-by-name' and not 'find-packages-by-name'; | 400 | |
| 394 | ;; the former traverses the module tree only once and then allows for | 401 | (define* (display-search-paths entries profile |
| 395 | ;; efficient access via a vhash. | 402 | #:key (kind 'exact)) |
| 396 | (match (find-best-packages-by-name name version) | ||
| 397 | ((p _ ...) p) | ||
| 398 | (_ | ||
| 399 | (match (find-best-packages-by-name name #f) | ||
| 400 | ((p _ ...) p) | ||
| 401 | (_ #f))))))) | ||
| 402 | |||
| 403 | (define search-path-definition | ||
| 404 | (match-lambda | ||
| 405 | (($ <search-path-specification> variable files separator | ||
| 406 | type pattern) | ||
| 407 | (let* ((values (or (and=> (getenv variable) | ||
| 408 | (cut string-tokenize* <> separator)) | ||
| 409 | '())) | ||
| 410 | ;; Add a trailing slash to force symlinks to be treated as | ||
| 411 | ;; directories when 'find-files' traverses them. | ||
| 412 | (files (if pattern | ||
| 413 | (map (cut string-append <> "/") files) | ||
| 414 | files)) | ||
| 415 | |||
| 416 | ;; XXX: Silence 'find-files' when it stumbles upon non-existent | ||
| 417 | ;; directories (see | ||
| 418 | ;; <http://lists.gnu.org/archive/html/guix-devel/2015-01/msg00269.html>.) | ||
| 419 | (path (with-null-error-port | ||
| 420 | (search-path-as-list files (list profile) | ||
| 421 | #:type type | ||
| 422 | #:pattern pattern)))) | ||
| 423 | (if (every (cut member <> values) path) | ||
| 424 | #f | ||
| 425 | (format #f "export ~a=\"~a\"" | ||
| 426 | variable | ||
| 427 | (string-join path separator))))))) | ||
| 428 | |||
| 429 | (let* ((packages (filter-map manifest-entry->package entries)) | ||
| 430 | (search-paths (delete-duplicates | ||
| 431 | (append-map package-native-search-paths | ||
| 432 | packages)))) | ||
| 433 | (filter-map search-path-definition search-paths)))) | ||
| 434 | |||
| 435 | (define (display-search-paths entries profile) | ||
| 436 | "Display the search path environment variables that may need to be set for | 403 | "Display the search path environment variables that may need to be set for |
| 437 | ENTRIES, a list of manifest entries, in the context of PROFILE." | 404 | ENTRIES, a list of manifest entries, in the context of PROFILE." |
| 438 | (let ((settings (search-path-environment-variables entries profile))) | 405 | (let* ((profile (user-friendly-profile profile)) |
| 406 | (settings (search-path-environment-variables entries profile | ||
| 407 | #:kind kind))) | ||
| 439 | (unless (null? settings) | 408 | (unless (null? settings) |
| 440 | (format #t (_ "The following environment variable definitions may be needed:~%")) | 409 | (format #t (_ "The following environment variable definitions may be needed:~%")) |
| 441 | (format #t "~{ ~a~%~}" settings)))) | 410 | (format #t "~{ ~a~%~}" settings)))) |
| @@ -453,23 +422,29 @@ ENTRIES, a list of manifest entries, in the context of PROFILE." | |||
| 453 | (substitutes? . #t))) | 422 | (substitutes? . #t))) |
| 454 | 423 | ||
| 455 | (define (show-help) | 424 | (define (show-help) |
| 456 | (display (_ "Usage: guix package [OPTION]... PACKAGES... | 425 | (display (_ "Usage: guix package [OPTION]... |
| 457 | Install, remove, or upgrade PACKAGES in a single transaction.\n")) | 426 | Install, remove, or upgrade packages in a single transaction.\n")) |
| 458 | (display (_ " | 427 | (display (_ " |
| 459 | -i, --install=PACKAGE install PACKAGE")) | 428 | -i, --install PACKAGE ... |
| 429 | install PACKAGEs")) | ||
| 460 | (display (_ " | 430 | (display (_ " |
| 461 | -e, --install-from-expression=EXP | 431 | -e, --install-from-expression=EXP |
| 462 | install the package EXP evaluates to")) | 432 | install the package EXP evaluates to")) |
| 463 | (display (_ " | 433 | (display (_ " |
| 464 | -r, --remove=PACKAGE remove PACKAGE")) | 434 | -r, --remove PACKAGE ... |
| 435 | remove PACKAGEs")) | ||
| 465 | (display (_ " | 436 | (display (_ " |
| 466 | -u, --upgrade[=REGEXP] upgrade all the installed packages matching REGEXP")) | 437 | -u, --upgrade[=REGEXP] upgrade all the installed packages matching REGEXP")) |
| 467 | (display (_ " | 438 | (display (_ " |
| 439 | -m, --manifest=FILE create a new profile generation with the manifest | ||
| 440 | from FILE")) | ||
| 441 | (display (_ " | ||
| 468 | --do-not-upgrade[=REGEXP] do not upgrade any packages matching REGEXP")) | 442 | --do-not-upgrade[=REGEXP] do not upgrade any packages matching REGEXP")) |
| 469 | (display (_ " | 443 | (display (_ " |
| 470 | --roll-back roll back to the previous generation")) | 444 | --roll-back roll back to the previous generation")) |
| 471 | (display (_ " | 445 | (display (_ " |
| 472 | --search-paths display needed environment variable definitions")) | 446 | --search-paths[=KIND] |
| 447 | display needed environment variable definitions")) | ||
| 473 | (display (_ " | 448 | (display (_ " |
| 474 | -l, --list-generations[=PATTERN] | 449 | -l, --list-generations[=PATTERN] |
| 475 | list generations matching PATTERN")) | 450 | list generations matching PATTERN")) |
| @@ -496,7 +471,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) | |||
| 496 | -A, --list-available[=REGEXP] | 471 | -A, --list-available[=REGEXP] |
| 497 | list available packages matching REGEXP")) | 472 | list available packages matching REGEXP")) |
| 498 | (display (_ " | 473 | (display (_ " |
| 499 | --show=PACKAGE show details about PACKAGE")) | 474 | --show=PACKAGE show details about PACKAGE")) |
| 500 | (newline) | 475 | (newline) |
| 501 | (show-build-options-help) | 476 | (show-build-options-help) |
| 502 | (newline) | 477 | (newline) |
| @@ -556,6 +531,10 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) | |||
| 556 | (lambda (opt name arg result arg-handler) | 531 | (lambda (opt name arg result arg-handler) |
| 557 | (values (alist-cons 'roll-back? #t result) | 532 | (values (alist-cons 'roll-back? #t result) |
| 558 | #f))) | 533 | #f))) |
| 534 | (option '(#\m "manifest") #t #f | ||
| 535 | (lambda (opt name arg result arg-handler) | ||
| 536 | (values (alist-cons 'manifest arg result) | ||
| 537 | arg-handler))) | ||
| 559 | (option '(#\l "list-generations") #f #t | 538 | (option '(#\l "list-generations") #f #t |
| 560 | (lambda (opt name arg result arg-handler) | 539 | (lambda (opt name arg result arg-handler) |
| 561 | (values (cons `(query list-generations ,(or arg "")) | 540 | (values (cons `(query list-generations ,(or arg "")) |
| @@ -570,10 +549,20 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) | |||
| 570 | (lambda (opt name arg result arg-handler) | 549 | (lambda (opt name arg result arg-handler) |
| 571 | (values (alist-cons 'switch-generation arg result) | 550 | (values (alist-cons 'switch-generation arg result) |
| 572 | #f))) | 551 | #f))) |
| 573 | (option '("search-paths") #f #f | 552 | (option '("search-paths") #f #t |
| 574 | (lambda (opt name arg result arg-handler) | 553 | (lambda (opt name arg result arg-handler) |
| 575 | (values (cons `(query search-paths) result) | 554 | (let ((kind (match arg |
| 576 | #f))) | 555 | ((or "exact" "prefix" "suffix") |
| 556 | (string->symbol arg)) | ||
| 557 | (#f | ||
| 558 | 'exact) | ||
| 559 | (x | ||
| 560 | (leave (_ "~a: unsupported \ | ||
| 561 | kind of search path~%") | ||
| 562 | x))))) | ||
| 563 | (values (cons `(query search-paths ,kind) | ||
| 564 | result) | ||
| 565 | #f)))) | ||
| 577 | (option '(#\p "profile") #t #f | 566 | (option '(#\p "profile") #t #f |
| 578 | (lambda (opt name arg result arg-handler) | 567 | (lambda (opt name arg result arg-handler) |
| 579 | (values (alist-cons 'profile (canonicalize-profile arg) | 568 | (values (alist-cons 'profile (canonicalize-profile arg) |
| @@ -822,6 +811,50 @@ more information.~%")) | |||
| 822 | (define dry-run? (assoc-ref opts 'dry-run?)) | 811 | (define dry-run? (assoc-ref opts 'dry-run?)) |
| 823 | (define profile (assoc-ref opts 'profile)) | 812 | (define profile (assoc-ref opts 'profile)) |
| 824 | 813 | ||
| 814 | (define (build-and-use-profile manifest) | ||
| 815 | (let* ((bootstrap? (assoc-ref opts 'bootstrap?))) | ||
| 816 | |||
| 817 | (when (equal? profile %current-profile) | ||
| 818 | (ensure-default-profile)) | ||
| 819 | |||
| 820 | (let* ((prof-drv (run-with-store (%store) | ||
| 821 | (profile-derivation | ||
| 822 | manifest | ||
| 823 | #:hooks (if bootstrap? | ||
| 824 | '() | ||
| 825 | %default-profile-hooks)))) | ||
| 826 | (prof (derivation->output-path prof-drv))) | ||
| 827 | (show-what-to-build (%store) (list prof-drv) | ||
| 828 | #:use-substitutes? | ||
| 829 | (assoc-ref opts 'substitutes?) | ||
| 830 | #:dry-run? dry-run?) | ||
| 831 | |||
| 832 | (cond | ||
| 833 | (dry-run? #t) | ||
| 834 | ((and (file-exists? profile) | ||
| 835 | (and=> (readlink* profile) (cut string=? prof <>))) | ||
| 836 | (format (current-error-port) (_ "nothing to be done~%"))) | ||
| 837 | (else | ||
| 838 | (let* ((number (generation-number profile)) | ||
| 839 | |||
| 840 | ;; Always use NUMBER + 1 for the new profile, | ||
| 841 | ;; possibly overwriting a "previous future | ||
| 842 | ;; generation". | ||
| 843 | (name (generation-file-name profile | ||
| 844 | (+ 1 number)))) | ||
| 845 | (and (build-derivations (%store) (list prof-drv)) | ||
| 846 | (let* ((entries (manifest-entries manifest)) | ||
| 847 | (count (length entries))) | ||
| 848 | (switch-symlinks name prof) | ||
| 849 | (switch-symlinks profile name) | ||
| 850 | (unless (string=? profile %current-profile) | ||
| 851 | (register-gc-root (%store) name)) | ||
| 852 | (format #t (N_ "~a package in profile~%" | ||
| 853 | "~a packages in profile~%" | ||
| 854 | count) | ||
| 855 | count) | ||
| 856 | (display-search-paths entries profile))))))))) | ||
| 857 | |||
| 825 | ;; First roll back if asked to. | 858 | ;; First roll back if asked to. |
| 826 | (cond ((and (assoc-ref opts 'roll-back?) | 859 | (cond ((and (assoc-ref opts 'roll-back?) |
| 827 | (not dry-run?)) | 860 | (not dry-run?)) |
| @@ -856,60 +889,30 @@ more information.~%")) | |||
| 856 | (alist-delete 'delete-generations opts))) | 889 | (alist-delete 'delete-generations opts))) |
| 857 | (_ #f)) | 890 | (_ #f)) |
| 858 | opts)) | 891 | opts)) |
| 892 | ((assoc-ref opts 'manifest) | ||
| 893 | (let* ((file-name (assoc-ref opts 'manifest)) | ||
| 894 | (user-module (make-user-module '((guix profiles) | ||
| 895 | (gnu)))) | ||
| 896 | (manifest (load* file-name user-module))) | ||
| 897 | (if (assoc-ref opts 'dry-run?) | ||
| 898 | (format #t (_ "would install new manifest from '~a' with ~d entries~%") | ||
| 899 | file-name (length (manifest-entries manifest))) | ||
| 900 | (format #t (_ "installing new manifest from '~a' with ~d entries~%") | ||
| 901 | file-name (length (manifest-entries manifest)))) | ||
| 902 | (build-and-use-profile manifest))) | ||
| 859 | (else | 903 | (else |
| 860 | (let* ((manifest (profile-manifest profile)) | 904 | (let* ((manifest (profile-manifest profile)) |
| 861 | (install (options->installable opts manifest)) | 905 | (install (options->installable opts manifest)) |
| 862 | (remove (options->removable opts manifest)) | 906 | (remove (options->removable opts manifest)) |
| 863 | (bootstrap? (assoc-ref opts 'bootstrap?)) | ||
| 864 | (transaction (manifest-transaction (install install) | 907 | (transaction (manifest-transaction (install install) |
| 865 | (remove remove))) | 908 | (remove remove))) |
| 866 | (new (manifest-perform-transaction | 909 | (new (manifest-perform-transaction |
| 867 | manifest transaction))) | 910 | manifest transaction))) |
| 868 | 911 | ||
| 869 | (when (equal? profile %current-profile) | ||
| 870 | (ensure-default-profile)) | ||
| 871 | |||
| 872 | (unless (and (null? install) (null? remove)) | 912 | (unless (and (null? install) (null? remove)) |
| 873 | (let* ((prof-drv (run-with-store (%store) | 913 | (show-manifest-transaction (%store) manifest transaction |
| 874 | (profile-derivation | 914 | #:dry-run? dry-run?) |
| 875 | new | 915 | (build-and-use-profile new)))))) |
| 876 | #:hooks (if bootstrap? | ||
| 877 | '() | ||
| 878 | %default-profile-hooks)))) | ||
| 879 | (prof (derivation->output-path prof-drv))) | ||
| 880 | (show-manifest-transaction (%store) manifest transaction | ||
| 881 | #:dry-run? dry-run?) | ||
| 882 | (show-what-to-build (%store) (list prof-drv) | ||
| 883 | #:use-substitutes? | ||
| 884 | (assoc-ref opts 'substitutes?) | ||
| 885 | #:dry-run? dry-run?) | ||
| 886 | |||
| 887 | (cond | ||
| 888 | (dry-run? #t) | ||
| 889 | ((and (file-exists? profile) | ||
| 890 | (and=> (readlink* profile) (cut string=? prof <>))) | ||
| 891 | (format (current-error-port) (_ "nothing to be done~%"))) | ||
| 892 | (else | ||
| 893 | (let* ((number (generation-number profile)) | ||
| 894 | |||
| 895 | ;; Always use NUMBER + 1 for the new profile, | ||
| 896 | ;; possibly overwriting a "previous future | ||
| 897 | ;; generation". | ||
| 898 | (name (generation-file-name profile | ||
| 899 | (+ 1 number)))) | ||
| 900 | (and (build-derivations (%store) (list prof-drv)) | ||
| 901 | (let* ((entries (manifest-entries new)) | ||
| 902 | (count (length entries))) | ||
| 903 | (switch-symlinks name prof) | ||
| 904 | (switch-symlinks profile name) | ||
| 905 | (unless (string=? profile %current-profile) | ||
| 906 | (register-gc-root (%store) name)) | ||
| 907 | (format #t (N_ "~a package in profile~%" | ||
| 908 | "~a packages in profile~%" | ||
| 909 | count) | ||
| 910 | count) | ||
| 911 | (display-search-paths entries | ||
| 912 | profile)))))))))))) | ||
| 913 | 916 | ||
| 914 | (define (process-query opts) | 917 | (define (process-query opts) |
| 915 | ;; Process any query specified by OPTS. Return #t when a query was | 918 | ;; Process any query specified by OPTS. Return #t when a query was |
| @@ -1014,11 +1017,13 @@ more information.~%")) | |||
| 1014 | (find-packages-by-name name version))) | 1017 | (find-packages-by-name name version))) |
| 1015 | #t)) | 1018 | #t)) |
| 1016 | 1019 | ||
| 1017 | (('search-paths) | 1020 | (('search-paths kind) |
| 1018 | (let* ((manifest (profile-manifest profile)) | 1021 | (let* ((manifest (profile-manifest profile)) |
| 1019 | (entries (manifest-entries manifest)) | 1022 | (entries (manifest-entries manifest)) |
| 1023 | (profile (user-friendly-profile profile)) | ||
| 1020 | (settings (search-path-environment-variables entries profile | 1024 | (settings (search-path-environment-variables entries profile |
| 1021 | (const #f)))) | 1025 | (const #f) |
| 1026 | #:kind kind))) | ||
| 1022 | (format #t "~{~a~%~}" settings) | 1027 | (format #t "~{~a~%~}" settings) |
| 1023 | #t)) | 1028 | #t)) |
| 1024 | 1029 | ||
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm index c7c66fefbea..7bad2619b9f 100644 --- a/guix/scripts/publish.scm +++ b/guix/scripts/publish.scm | |||
| @@ -51,6 +51,10 @@ Publish ~a over HTTP.\n") %store-directory) | |||
| 51 | (display (_ " | 51 | (display (_ " |
| 52 | -p, --port=PORT listen on PORT")) | 52 | -p, --port=PORT listen on PORT")) |
| 53 | (display (_ " | 53 | (display (_ " |
| 54 | --listen=HOST listen on the network interface for HOST")) | ||
| 55 | (display (_ " | ||
| 56 | -u, --user=USER change privileges to USER as soon as possible")) | ||
| 57 | (display (_ " | ||
| 54 | -r, --repl[=PORT] spawn REPL server on PORT")) | 58 | -r, --repl[=PORT] spawn REPL server on PORT")) |
| 55 | (newline) | 59 | (newline) |
| 56 | (display (_ " | 60 | (display (_ " |
| @@ -60,6 +64,15 @@ Publish ~a over HTTP.\n") %store-directory) | |||
| 60 | (newline) | 64 | (newline) |
| 61 | (show-bug-report-information)) | 65 | (show-bug-report-information)) |
| 62 | 66 | ||
| 67 | (define (getaddrinfo* host) | ||
| 68 | "Like 'getaddrinfo', but properly report errors." | ||
| 69 | (catch 'getaddrinfo-error | ||
| 70 | (lambda () | ||
| 71 | (getaddrinfo host)) | ||
| 72 | (lambda (key error) | ||
| 73 | (leave (_ "lookup of host '~a' failed: ~a~%") | ||
| 74 | host (gai-strerror error))))) | ||
| 75 | |||
| 63 | (define %options | 76 | (define %options |
| 64 | (list (option '(#\h "help") #f #f | 77 | (list (option '(#\h "help") #f #f |
| 65 | (lambda _ | 78 | (lambda _ |
| @@ -68,9 +81,21 @@ Publish ~a over HTTP.\n") %store-directory) | |||
| 68 | (option '(#\V "version") #f #f | 81 | (option '(#\V "version") #f #f |
| 69 | (lambda _ | 82 | (lambda _ |
| 70 | (show-version-and-exit "guix publish"))) | 83 | (show-version-and-exit "guix publish"))) |
| 84 | (option '(#\u "user") #t #f | ||
| 85 | (lambda (opt name arg result) | ||
| 86 | (alist-cons 'user arg result))) | ||
| 71 | (option '(#\p "port") #t #f | 87 | (option '(#\p "port") #t #f |
| 72 | (lambda (opt name arg result) | 88 | (lambda (opt name arg result) |
| 73 | (alist-cons 'port (string->number* arg) result))) | 89 | (alist-cons 'port (string->number* arg) result))) |
| 90 | (option '("listen") #t #f | ||
| 91 | (lambda (opt name arg result) | ||
| 92 | (match (getaddrinfo* arg) | ||
| 93 | ((info _ ...) | ||
| 94 | (alist-cons 'address (addrinfo:addr info) | ||
| 95 | result)) | ||
| 96 | (() | ||
| 97 | (leave (_ "lookup of host '~a' returned nothing") | ||
| 98 | name))))) | ||
| 74 | (option '(#\r "repl") #f #t | 99 | (option '(#\r "repl") #f #t |
| 75 | (lambda (opt name arg result) | 100 | (lambda (opt name arg result) |
| 76 | ;; If port unspecified, use default Guile REPL port. | 101 | ;; If port unspecified, use default Guile REPL port. |
| @@ -78,7 +103,8 @@ Publish ~a over HTTP.\n") %store-directory) | |||
| 78 | (alist-cons 'repl (or port 37146) result)))))) | 103 | (alist-cons 'repl (or port 37146) result)))))) |
| 79 | 104 | ||
| 80 | (define %default-options | 105 | (define %default-options |
| 81 | '((port . 8080) | 106 | `((port . 8080) |
| 107 | (address . ,(make-socket-address AF_INET INADDR_ANY 0)) | ||
| 82 | (repl . #f))) | 108 | (repl . #f))) |
| 83 | 109 | ||
| 84 | (define (lazy-read-file-sexp file) | 110 | (define (lazy-read-file-sexp file) |
| @@ -220,24 +246,69 @@ example: \"/foo/bar\" yields '(\"foo\" \"bar\")." | |||
| 220 | (_ (not-found request))) | 246 | (_ (not-found request))) |
| 221 | (not-found request)))) | 247 | (not-found request)))) |
| 222 | 248 | ||
| 223 | (define (run-publish-server port store) | 249 | (define (run-publish-server socket store) |
| 224 | (run-server (make-request-handler store) | 250 | (run-server (make-request-handler store) |
| 225 | 'http | 251 | 'http |
| 226 | `(#:addr ,INADDR_ANY | 252 | `(#:socket ,socket))) |
| 227 | #:port ,port))) | 253 | |
| 254 | (define (open-server-socket address) | ||
| 255 | "Return a TCP socket bound to ADDRESS, a socket address." | ||
| 256 | (let ((sock (socket (sockaddr:fam address) SOCK_STREAM 0))) | ||
| 257 | (setsockopt sock SOL_SOCKET SO_REUSEADDR 1) | ||
| 258 | (bind sock address) | ||
| 259 | sock)) | ||
| 260 | |||
| 261 | (define (gather-user-privileges user) | ||
| 262 | "Switch to the identity of USER, a user name." | ||
| 263 | (catch 'misc-error | ||
| 264 | (lambda () | ||
| 265 | (let ((user (getpw user))) | ||
| 266 | (setgroups #()) | ||
| 267 | (setgid (passwd:gid user)) | ||
| 268 | (setuid (passwd:uid user)))) | ||
| 269 | (lambda (key proc message args . rest) | ||
| 270 | (leave (_ "user '~a' not found: ~a~%") | ||
| 271 | user (apply format #f message args))))) | ||
| 272 | |||
| 273 | |||
| 274 | ;;; | ||
| 275 | ;;; Entry point. | ||
| 276 | ;;; | ||
| 228 | 277 | ||
| 229 | (define (guix-publish . args) | 278 | (define (guix-publish . args) |
| 230 | (with-error-handling | 279 | (with-error-handling |
| 231 | (let* ((opts (args-fold* args %options | 280 | (let* ((opts (args-fold* args %options |
| 232 | (lambda (opt name arg result) | 281 | (lambda (opt name arg result) |
| 233 | (leave (_ "~A: unrecognized option~%") name)) | 282 | (leave (_ "~A: unrecognized option~%") name)) |
| 234 | (lambda (arg result) | 283 | (lambda (arg result) |
| 235 | (leave (_ "~A: extraneuous argument~%") arg)) | 284 | (leave (_ "~A: extraneuous argument~%") arg)) |
| 236 | %default-options)) | 285 | %default-options)) |
| 237 | (port (assoc-ref opts 'port)) | 286 | (user (assoc-ref opts 'user)) |
| 287 | (port (assoc-ref opts 'port)) | ||
| 288 | (address (let ((addr (assoc-ref opts 'address))) | ||
| 289 | (make-socket-address (sockaddr:fam addr) | ||
| 290 | (sockaddr:addr addr) | ||
| 291 | port))) | ||
| 292 | (socket (open-server-socket address)) | ||
| 238 | (repl-port (assoc-ref opts 'repl))) | 293 | (repl-port (assoc-ref opts 'repl))) |
| 239 | (format #t (_ "publishing ~a on port ~d~%") %store-directory port) | 294 | ;; Read the key right away so that (1) we fail early on if we can't |
| 295 | ;; access them, and (2) we can then drop privileges. | ||
| 296 | (force %private-key) | ||
| 297 | (force %public-key) | ||
| 298 | |||
| 299 | (when user | ||
| 300 | ;; Now that we've read the key material and opened the socket, we can | ||
| 301 | ;; drop privileges. | ||
| 302 | (gather-user-privileges user)) | ||
| 303 | |||
| 304 | (when (zero? (getuid)) | ||
| 305 | (warning (_ "server running as root; \ | ||
| 306 | consider using the '--user' option!~%"))) | ||
| 307 | (format #t (_ "publishing ~a on ~a, port ~d~%") | ||
| 308 | %store-directory | ||
| 309 | (inet-ntop (sockaddr:fam address) (sockaddr:addr address)) | ||
| 310 | (sockaddr:port address)) | ||
| 240 | (when repl-port | 311 | (when repl-port |
| 241 | (repl:spawn-server (repl:make-tcp-server-socket #:port repl-port))) | 312 | (repl:spawn-server (repl:make-tcp-server-socket #:port repl-port))) |
| 242 | (with-store store | 313 | (with-store store |
| 243 | (run-publish-server (assoc-ref opts 'port) store))))) | 314 | (run-publish-server socket store))))) |
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index b9983c5b9c5..8b4fa36d2a4 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm | |||
| @@ -84,8 +84,10 @@ disabled!~%")) | |||
| 84 | 84 | ||
| 85 | (define %narinfo-ttl | 85 | (define %narinfo-ttl |
| 86 | ;; Number of seconds during which cached narinfo lookups are considered | 86 | ;; Number of seconds during which cached narinfo lookups are considered |
| 87 | ;; valid. | 87 | ;; valid. This is a reasonable default value (corresponds to the TTL for |
| 88 | (* 24 3600)) | 88 | ;; nginx's .nar cache on hydra.gnu.org) but we'd rather want publishers to |
| 89 | ;; state what their TTL is in /nix-cache-info. (XXX) | ||
| 90 | (* 36 3600)) | ||
| 89 | 91 | ||
| 90 | (define %narinfo-negative-ttl | 92 | (define %narinfo-negative-ttl |
| 91 | ;; Likewise, but for negative lookups---i.e., cached lookup failures. | 93 | ;; Likewise, but for negative lookups---i.e., cached lookup failures. |
| @@ -155,15 +157,12 @@ to the caller without emitting an error message." | |||
| 155 | (leave (_ "download from '~a' failed: ~a, ~s~%") | 157 | (leave (_ "download from '~a' failed: ~a, ~s~%") |
| 156 | (uri->string (http-get-error-uri c)) | 158 | (uri->string (http-get-error-uri c)) |
| 157 | code (http-get-error-reason c)))))) | 159 | code (http-get-error-reason c)))))) |
| 158 | ;; On Guile 2.0.5, `http-fetch' fetches the whole thing at once. So | ||
| 159 | ;; honor TIMEOUT? to disable the timeout when fetching a nar. | ||
| 160 | ;; | ||
| 161 | ;; Test this with: | 160 | ;; Test this with: |
| 162 | ;; sudo tc qdisc add dev eth0 root netem delay 1500ms | 161 | ;; sudo tc qdisc add dev eth0 root netem delay 1500ms |
| 163 | ;; and then cancel with: | 162 | ;; and then cancel with: |
| 164 | ;; sudo tc qdisc del dev eth0 root | 163 | ;; sudo tc qdisc del dev eth0 root |
| 165 | (let ((port #f)) | 164 | (let ((port #f)) |
| 166 | (with-timeout (if (or timeout? (guile-version>? "2.0.5")) | 165 | (with-timeout (if timeout? |
| 167 | %fetch-timeout | 166 | %fetch-timeout |
| 168 | 0) | 167 | 0) |
| 169 | (begin | 168 | (begin |
| @@ -180,7 +179,9 @@ to the caller without emitting an error message." | |||
| 180 | (close-port port)))) | 179 | (close-port port)))) |
| 181 | (begin | 180 | (begin |
| 182 | (when (or (not port) (port-closed? port)) | 181 | (when (or (not port) (port-closed? port)) |
| 183 | (set! port (open-socket-for-uri uri #:buffered? buffered?))) | 182 | (set! port (open-socket-for-uri uri)) |
| 183 | (unless buffered? | ||
| 184 | (setvbuf port _IONBF))) | ||
| 184 | (http-fetch uri #:text? #f #:port port)))))))) | 185 | (http-fetch uri #:text? #f #:port port)))))))) |
| 185 | 186 | ||
| 186 | (define-record-type <cache> | 187 | (define-record-type <cache> |
| @@ -645,17 +646,9 @@ PORT. REPORT-PROGRESS is a two-argument procedure such as that returned by | |||
| 645 | ;; XXX: We're not in control, so we always return anyway. | 646 | ;; XXX: We're not in control, so we always return anyway. |
| 646 | n)) | 647 | n)) |
| 647 | 648 | ||
| 648 | ;; Since `http-fetch' in Guile 2.0.5 returns all the data once it's done, | 649 | (make-custom-binary-input-port "progress-port-proc" |
| 649 | ;; don't pretend to report any progress in that case. | 650 | read! #f #f |
| 650 | (if (guile-version>? "2.0.5") | 651 | (cut close-port port))) |
| 651 | (make-custom-binary-input-port "progress-port-proc" | ||
| 652 | read! #f #f | ||
| 653 | (cut close-port port)) | ||
| 654 | (begin | ||
| 655 | (format (current-error-port) (_ "Downloading, please wait...~%")) | ||
| 656 | (format (current-error-port) | ||
| 657 | (_ "(Please consider upgrading Guile to get proper progress report.)~%")) | ||
| 658 | port))) | ||
| 659 | 652 | ||
| 660 | (define-syntax with-networking | 653 | (define-syntax with-networking |
| 661 | (syntax-rules () | 654 | (syntax-rules () |
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 1838e894521..aa9b3f838ae 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm | |||
| @@ -48,28 +48,14 @@ | |||
| 48 | 48 | ||
| 49 | (define %user-module | 49 | (define %user-module |
| 50 | ;; Module in which the machine description file is loaded. | 50 | ;; Module in which the machine description file is loaded. |
| 51 | (let ((module (make-fresh-user-module))) | 51 | (make-user-module '((gnu system) |
| 52 | (for-each (lambda (iface) | 52 | (gnu services) |
| 53 | (module-use! module (resolve-interface iface))) | 53 | (gnu system shadow)))) |
| 54 | '((gnu system) | ||
| 55 | (gnu services) | ||
| 56 | (gnu system shadow))) | ||
| 57 | module)) | ||
| 58 | 54 | ||
| 59 | (define (read-operating-system file) | 55 | (define (read-operating-system file) |
| 60 | "Read the operating-system declaration from FILE and return it." | 56 | "Read the operating-system declaration from FILE and return it." |
| 61 | ;; TODO: Factorize. | 57 | (load* file %user-module)) |
| 62 | (catch #t | ||
| 63 | (lambda () | ||
| 64 | ;; Avoid ABI incompatibility with the <operating-system> record. | ||
| 65 | (set! %fresh-auto-compile #t) | ||
| 66 | 58 | ||
| 67 | (save-module-excursion | ||
| 68 | (lambda () | ||
| 69 | (set-current-module %user-module) | ||
| 70 | (primitive-load file)))) | ||
| 71 | (lambda args | ||
| 72 | (report-load-error file args)))) | ||
| 73 | 59 | ||
| 74 | 60 | ||
| 75 | ;;; | 61 | ;;; |
| @@ -81,8 +67,6 @@ | |||
| 81 | (store-lift references)) | 67 | (store-lift references)) |
| 82 | (define topologically-sorted* | 68 | (define topologically-sorted* |
| 83 | (store-lift topologically-sorted)) | 69 | (store-lift topologically-sorted)) |
| 84 | (define show-what-to-build* | ||
| 85 | (store-lift show-what-to-build)) | ||
| 86 | 70 | ||
| 87 | 71 | ||
| 88 | (define* (copy-item item target | 72 | (define* (copy-item item target |
| @@ -92,6 +76,13 @@ | |||
| 92 | (let ((dest (string-append target item)) | 76 | (let ((dest (string-append target item)) |
| 93 | (state (string-append target "/var/guix"))) | 77 | (state (string-append target "/var/guix"))) |
| 94 | (format log-port "copying '~a'...~%" item) | 78 | (format log-port "copying '~a'...~%" item) |
| 79 | |||
| 80 | ;; Remove DEST if it exists to make sure that (1) we do not fail badly | ||
| 81 | ;; while trying to overwrite it (see <http://bugs.gnu.org/20722>), and | ||
| 82 | ;; (2) we end up with the right contents. | ||
| 83 | (when (file-exists? dest) | ||
| 84 | (delete-file-recursively dest)) | ||
| 85 | |||
| 95 | (copy-recursively item dest | 86 | (copy-recursively item dest |
| 96 | #:log (%make-void-port "w")) | 87 | #:log (%make-void-port "w")) |
| 97 | 88 | ||
| @@ -144,8 +135,9 @@ TARGET, and register them." | |||
| 144 | (define* (install os-drv target | 135 | (define* (install os-drv target |
| 145 | #:key (log-port (current-output-port)) | 136 | #:key (log-port (current-output-port)) |
| 146 | grub? grub.cfg device) | 137 | grub? grub.cfg device) |
| 147 | "Copy the output of OS-DRV and its dependencies to directory TARGET. TARGET | 138 | "Copy the closure of GRUB.CFG, which includes the output of OS-DRV, to |
| 148 | must be an absolute directory name since that's what 'guix-register' expects. | 139 | directory TARGET. TARGET must be an absolute directory name since that's what |
| 140 | 'guix-register' expects. | ||
| 149 | 141 | ||
| 150 | When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG." | 142 | When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG." |
| 151 | (define (maybe-copy to-copy) | 143 | (define (maybe-copy to-copy) |
| @@ -161,12 +153,24 @@ When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG." | |||
| 161 | ;; Copy items to the new store. | 153 | ;; Copy items to the new store. |
| 162 | (copy-closure to-copy target #:log-port log-port))))) | 154 | (copy-closure to-copy target #:log-port log-port))))) |
| 163 | 155 | ||
| 156 | ;; Make sure TARGET is root-owned when running as root, but still allow | ||
| 157 | ;; non-root uses (useful for testing.) See | ||
| 158 | ;; <http://lists.gnu.org/archive/html/guix-devel/2015-05/msg00452.html>. | ||
| 159 | (if (zero? (geteuid)) | ||
| 160 | (chown target 0 0) | ||
| 161 | (warning (_ "not running as 'root', so \ | ||
| 162 | the ownership of '~a' may be incorrect!~%") | ||
| 163 | target)) | ||
| 164 | |||
| 165 | (chmod target #o755) | ||
| 164 | (let ((os-dir (derivation->output-path os-drv)) | 166 | (let ((os-dir (derivation->output-path os-drv)) |
| 165 | (format (lift format %store-monad)) | 167 | (format (lift format %store-monad)) |
| 166 | (populate (lift2 populate-root-file-system %store-monad))) | 168 | (populate (lift2 populate-root-file-system %store-monad))) |
| 167 | 169 | ||
| 168 | (mbegin %store-monad | 170 | (mbegin %store-monad |
| 169 | (maybe-copy os-dir) | 171 | ;; Copy the closure of GRUB.CFG, which includes OS-DIR, GRUB's |
| 172 | ;; background image and so on. | ||
| 173 | (maybe-copy grub.cfg) | ||
| 170 | 174 | ||
| 171 | ;; Create a bunch of additional files. | 175 | ;; Create a bunch of additional files. |
| 172 | (format log-port "populating '~a'...~%" target) | 176 | (format log-port "populating '~a'...~%" target) |
| @@ -290,10 +294,6 @@ it atomically, and then run OS's activation script." | |||
| 290 | ((disk-image) | 294 | ((disk-image) |
| 291 | (system-disk-image os #:disk-image-size image-size)))) | 295 | (system-disk-image os #:disk-image-size image-size)))) |
| 292 | 296 | ||
| 293 | (define (grub.cfg os) | ||
| 294 | "Return the GRUB configuration file for OS." | ||
| 295 | (operating-system-grub.cfg os (previous-grub-entries))) | ||
| 296 | |||
| 297 | (define* (maybe-build drvs | 297 | (define* (maybe-build drvs |
| 298 | #:key dry-run? use-substitutes?) | 298 | #:key dry-run? use-substitutes?) |
| 299 | "Show what will/would be built, and actually build DRVS, unless DRY-RUN? is | 299 | "Show what will/would be built, and actually build DRVS, unless DRY-RUN? is |
| @@ -323,7 +323,10 @@ boot directly to the kernel or to the bootloader." | |||
| 323 | #:full-boot? full-boot? | 323 | #:full-boot? full-boot? |
| 324 | #:mappings mappings)) | 324 | #:mappings mappings)) |
| 325 | (grub (package->derivation grub)) | 325 | (grub (package->derivation grub)) |
| 326 | (grub.cfg (grub.cfg os)) | 326 | (grub.cfg (operating-system-grub.cfg os |
| 327 | (if (eq? 'init action) | ||
| 328 | '() | ||
| 329 | (previous-grub-entries)))) | ||
| 327 | (drvs -> (if (and grub? (memq action '(init reconfigure))) | 330 | (drvs -> (if (and grub? (memq action '(init reconfigure))) |
| 328 | (list sys grub grub.cfg) | 331 | (list sys grub grub.cfg) |
| 329 | (list sys))) | 332 | (list sys))) |
| @@ -372,21 +375,25 @@ boot directly to the kernel or to the bootloader." | |||
| 372 | Build the operating system declared in FILE according to ACTION.\n")) | 375 | Build the operating system declared in FILE according to ACTION.\n")) |
| 373 | (newline) | 376 | (newline) |
| 374 | (display (_ "The valid values for ACTION are:\n")) | 377 | (display (_ "The valid values for ACTION are:\n")) |
| 378 | (newline) | ||
| 375 | (display (_ "\ | 379 | (display (_ "\ |
| 376 | - 'reconfigure', switch to a new operating system configuration\n")) | 380 | reconfigure switch to a new operating system configuration\n")) |
| 377 | (display (_ "\ | 381 | (display (_ "\ |
| 378 | - 'build', build the operating system without installing anything\n")) | 382 | build build the operating system without installing anything\n")) |
| 379 | (display (_ "\ | 383 | (display (_ "\ |
| 380 | - 'vm', build a virtual machine image that shares the host's store\n")) | 384 | vm build a virtual machine image that shares the host's store\n")) |
| 381 | (display (_ "\ | 385 | (display (_ "\ |
| 382 | - 'vm-image', build a freestanding virtual machine image\n")) | 386 | vm-image build a freestanding virtual machine image\n")) |
| 383 | (display (_ "\ | 387 | (display (_ "\ |
| 384 | - 'disk-image', build a disk image, suitable for a USB stick\n")) | 388 | disk-image build a disk image, suitable for a USB stick\n")) |
| 385 | (display (_ "\ | 389 | (display (_ "\ |
| 386 | - 'init', initialize a root file system to run GNU.\n")) | 390 | init initialize a root file system to run GNU.\n")) |
| 387 | 391 | ||
| 388 | (show-build-options-help) | 392 | (show-build-options-help) |
| 389 | (display (_ " | 393 | (display (_ " |
| 394 | --on-error=STRATEGY | ||
| 395 | apply STRATEGY when an error occurs while reading FILE")) | ||
| 396 | (display (_ " | ||
| 390 | --image-size=SIZE for 'vm-image', produce an image of SIZE")) | 397 | --image-size=SIZE for 'vm-image', produce an image of SIZE")) |
| 391 | (display (_ " | 398 | (display (_ " |
| 392 | --no-grub for 'init', do not install GRUB")) | 399 | --no-grub for 'init', do not install GRUB")) |
| @@ -426,6 +433,10 @@ Build the operating system declared in FILE according to ACTION.\n")) | |||
| 426 | (option '(#\V "version") #f #f | 433 | (option '(#\V "version") #f #f |
| 427 | (lambda args | 434 | (lambda args |
| 428 | (show-version-and-exit "guix system"))) | 435 | (show-version-and-exit "guix system"))) |
| 436 | (option '("on-error") #t #f | ||
| 437 | (lambda (opt name arg result) | ||
| 438 | (alist-cons 'on-error (string->symbol arg) | ||
| 439 | result))) | ||
| 429 | (option '("image-size") #t #f | 440 | (option '("image-size") #t #f |
| 430 | (lambda (opt name arg result) | 441 | (lambda (opt name arg result) |
| 431 | (alist-cons 'image-size (size->number arg) | 442 | (alist-cons 'image-size (size->number arg) |
| @@ -518,7 +529,8 @@ Build the operating system declared in FILE according to ACTION.\n")) | |||
| 518 | (action (assoc-ref opts 'action)) | 529 | (action (assoc-ref opts 'action)) |
| 519 | (system (assoc-ref opts 'system)) | 530 | (system (assoc-ref opts 'system)) |
| 520 | (os (if file | 531 | (os (if file |
| 521 | (read-operating-system file) | 532 | (load* file %user-module |
| 533 | #:on-error (assoc-ref opts 'on-error)) | ||
| 522 | (leave (_ "no configuration file specified~%")))) | 534 | (leave (_ "no configuration file specified~%")))) |
| 523 | 535 | ||
| 524 | (dry? (assoc-ref opts 'dry-run?)) | 536 | (dry? (assoc-ref opts 'dry-run?)) |
diff --git a/guix/search-paths.scm b/guix/search-paths.scm new file mode 100644 index 00000000000..7fd15d440c3 --- /dev/null +++ b/guix/search-paths.scm | |||
| @@ -0,0 +1,193 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (guix search-paths) | ||
| 20 | #:use-module (guix records) | ||
| 21 | #:use-module (guix build utils) | ||
| 22 | #:use-module (srfi srfi-1) | ||
| 23 | #:use-module (srfi srfi-26) | ||
| 24 | #:use-module (ice-9 match) | ||
| 25 | #:export (<search-path-specification> | ||
| 26 | search-path-specification | ||
| 27 | search-path-specification? | ||
| 28 | search-path-specification-variable | ||
| 29 | search-path-specification-files | ||
| 30 | search-path-specification-separator | ||
| 31 | search-path-specification-file-type | ||
| 32 | search-path-specification-file-pattern | ||
| 33 | |||
| 34 | $PATH | ||
| 35 | |||
| 36 | search-path-specification->sexp | ||
| 37 | sexp->search-path-specification | ||
| 38 | string-tokenize* | ||
| 39 | evaluate-search-paths | ||
| 40 | environment-variable-definition | ||
| 41 | search-path-definition)) | ||
| 42 | |||
| 43 | ;;; Commentary: | ||
| 44 | ;;; | ||
| 45 | ;;; This module defines "search path specifications", which allow packages to | ||
| 46 | ;;; declare environment variables that they use to define search paths. For | ||
| 47 | ;;; instance, GCC has the 'CPATH' variable, Guile has the 'GUILE_LOAD_PATH' | ||
| 48 | ;;; variable, etc. | ||
| 49 | ;;; | ||
| 50 | ;;; Code: | ||
| 51 | |||
| 52 | ;; The specification of a search path. | ||
| 53 | (define-record-type* <search-path-specification> | ||
| 54 | search-path-specification make-search-path-specification | ||
| 55 | search-path-specification? | ||
| 56 | (variable search-path-specification-variable) ;string | ||
| 57 | (files search-path-specification-files) ;list of strings | ||
| 58 | (separator search-path-specification-separator ;string | ||
| 59 | (default ":")) | ||
| 60 | (file-type search-path-specification-file-type ;symbol | ||
| 61 | (default 'directory)) | ||
| 62 | (file-pattern search-path-specification-file-pattern ;#f | string | ||
| 63 | (default #f))) | ||
| 64 | |||
| 65 | (define $PATH | ||
| 66 | ;; The 'PATH' variable. This variable is a bit special: it is not attached | ||
| 67 | ;; to any package in particular. | ||
| 68 | (search-path-specification | ||
| 69 | (variable "PATH") | ||
| 70 | (files '("bin" "sbin")))) | ||
| 71 | |||
| 72 | (define (search-path-specification->sexp spec) | ||
| 73 | "Return an sexp representing SPEC, a <search-path-specification>. The sexp | ||
| 74 | corresponds to the arguments expected by `set-path-environment-variable'." | ||
| 75 | ;; Note that this sexp format is used both by build systems and in | ||
| 76 | ;; (guix profiles), so think twice before you change it. | ||
| 77 | (match spec | ||
| 78 | (($ <search-path-specification> variable files separator type pattern) | ||
| 79 | `(,variable ,files ,separator ,type ,pattern)))) | ||
| 80 | |||
| 81 | (define (sexp->search-path-specification sexp) | ||
| 82 | "Convert SEXP, which is as returned by 'search-path-specification->sexp', to | ||
| 83 | a <search-path-specification> object." | ||
| 84 | (match sexp | ||
| 85 | ((variable files separator type pattern) | ||
| 86 | (search-path-specification | ||
| 87 | (variable variable) | ||
| 88 | (files files) | ||
| 89 | (separator separator) | ||
| 90 | (file-type type) | ||
| 91 | (file-pattern pattern))))) | ||
| 92 | |||
| 93 | (define-syntax-rule (with-null-error-port exp) | ||
| 94 | "Evaluate EXP with the error port pointing to the bit bucket." | ||
| 95 | (with-error-to-port (%make-void-port "w") | ||
| 96 | (lambda () exp))) | ||
| 97 | |||
| 98 | ;; XXX: This procedure used to be in (guix utils) but since we want to be able | ||
| 99 | ;; to use (guix search-paths) on the build side, we want to avoid the | ||
| 100 | ;; dependency on (guix utils), and so this procedure is back here for now. | ||
| 101 | (define (string-tokenize* string separator) | ||
| 102 | "Return the list of substrings of STRING separated by SEPARATOR. This is | ||
| 103 | like `string-tokenize', but SEPARATOR is a string." | ||
| 104 | (define (index string what) | ||
| 105 | (let loop ((string string) | ||
| 106 | (offset 0)) | ||
| 107 | (cond ((string-null? string) | ||
| 108 | #f) | ||
| 109 | ((string-prefix? what string) | ||
| 110 | offset) | ||
| 111 | (else | ||
| 112 | (loop (string-drop string 1) (+ 1 offset)))))) | ||
| 113 | |||
| 114 | (define len | ||
| 115 | (string-length separator)) | ||
| 116 | |||
| 117 | (let loop ((string string) | ||
| 118 | (result '())) | ||
| 119 | (cond ((index string separator) | ||
| 120 | => | ||
| 121 | (lambda (offset) | ||
| 122 | (loop (string-drop string (+ offset len)) | ||
| 123 | (cons (substring string 0 offset) | ||
| 124 | result)))) | ||
| 125 | (else | ||
| 126 | (reverse (cons string result)))))) | ||
| 127 | |||
| 128 | (define* (evaluate-search-paths search-paths directories | ||
| 129 | #:optional (getenv (const #f))) | ||
| 130 | "Evaluate SEARCH-PATHS, a list of search-path specifications, for | ||
| 131 | DIRECTORIES, a list of directory names, and return a list of | ||
| 132 | specification/value pairs. Use GETENV to determine the current settings and | ||
| 133 | report only settings not already effective." | ||
| 134 | (define search-path-definition | ||
| 135 | (match-lambda | ||
| 136 | ((and spec | ||
| 137 | ($ <search-path-specification> variable files separator | ||
| 138 | type pattern)) | ||
| 139 | (let* ((values (or (and=> (getenv variable) | ||
| 140 | (cut string-tokenize* <> separator)) | ||
| 141 | '())) | ||
| 142 | ;; Add a trailing slash to force symlinks to be treated as | ||
| 143 | ;; directories when 'find-files' traverses them. | ||
| 144 | (files (if pattern | ||
| 145 | (map (cut string-append <> "/") files) | ||
| 146 | files)) | ||
| 147 | |||
| 148 | ;; XXX: Silence 'find-files' when it stumbles upon non-existent | ||
| 149 | ;; directories (see | ||
| 150 | ;; <http://lists.gnu.org/archive/html/guix-devel/2015-01/msg00269.html>.) | ||
| 151 | (path (with-null-error-port | ||
| 152 | (search-path-as-list files directories | ||
| 153 | #:type type | ||
| 154 | #:pattern pattern)))) | ||
| 155 | (if (every (cut member <> values) path) | ||
| 156 | #f ;VARIABLE is already set appropriately | ||
| 157 | (cons spec (string-join path separator))))))) | ||
| 158 | |||
| 159 | (filter-map search-path-definition search-paths)) | ||
| 160 | |||
| 161 | (define* (environment-variable-definition variable value | ||
| 162 | #:key | ||
| 163 | (kind 'exact) | ||
| 164 | (separator ":")) | ||
| 165 | "Return a the definition of VARIABLE to VALUE in Bash syntax. | ||
| 166 | |||
| 167 | KIND can be either 'exact (return the definition of VARIABLE=VALUE), | ||
| 168 | 'prefix (return the definition where VALUE is added as a prefix to VARIABLE's | ||
| 169 | current value), or 'suffix (return the definition where VALUE is added as a | ||
| 170 | suffix to VARIABLE's current value.) In the case of 'prefix and 'suffix, | ||
| 171 | SEPARATOR is used as the separator between VARIABLE's current value and its | ||
| 172 | prefix/suffix." | ||
| 173 | (match kind | ||
| 174 | ('exact | ||
| 175 | (format #f "export ~a=\"~a\"" variable value)) | ||
| 176 | ('prefix | ||
| 177 | (format #f "export ~a=\"~a${~a:+~a}$~a\"" | ||
| 178 | variable value variable separator variable)) | ||
| 179 | ('suffix | ||
| 180 | (format #f "export ~a=\"$~a${~a:+~a}~a\"" | ||
| 181 | variable variable variable separator value)))) | ||
| 182 | |||
| 183 | (define* (search-path-definition search-path value | ||
| 184 | #:key (kind 'exact)) | ||
| 185 | "Similar to 'environment-variable-definition', but applied to a | ||
| 186 | <search-path-specification>." | ||
| 187 | (match search-path | ||
| 188 | (($ <search-path-specification> variable _ separator) | ||
| 189 | (environment-variable-definition variable value | ||
| 190 | #:kind kind | ||
| 191 | #:separator separator)))) | ||
| 192 | |||
| 193 | ;;; search-paths.scm ends here | ||
diff --git a/guix/serialization.scm b/guix/serialization.scm index 51d7ef76c68..7a3defc03d9 100644 --- a/guix/serialization.scm +++ b/guix/serialization.scm | |||
| @@ -279,17 +279,11 @@ sub-directories of FILE as needed." | |||
| 279 | (write-string "type" p) | 279 | (write-string "type" p) |
| 280 | (write-string "directory" p) | 280 | (write-string "directory" p) |
| 281 | (let ((entries | 281 | (let ((entries |
| 282 | ;; NOTE: Guile 2.0.5's 'scandir' returns all subdirectories | 282 | ;; 'scandir' defaults to 'string-locale<?' to sort files, but |
| 283 | ;; unconditionally, including "." and "..", regardless of the | 283 | ;; this happens to be case-insensitive (at least in 'en_US' |
| 284 | ;; 'select?' predicate passed to it, so we have to filter | 284 | ;; locale on libc 2.18.) Conversely, we want files to be |
| 285 | ;; those out externally. | 285 | ;; sorted in a case-sensitive fashion. |
| 286 | (filter (negate (cut member <> '("." ".."))) | 286 | (scandir f (negate (cut member <> '("." ".."))) string<?))) |
| 287 | ;; 'scandir' defaults to 'string-locale<?' to sort | ||
| 288 | ;; files, but this happens to be case-insensitive (at | ||
| 289 | ;; least in 'en_US' locale on libc 2.18.) Conversely, | ||
| 290 | ;; we want files to be sorted in a case-sensitive | ||
| 291 | ;; fashion. | ||
| 292 | (scandir f (const #t) string<?)))) | ||
| 293 | (for-each (lambda (e) | 287 | (for-each (lambda (e) |
| 294 | (let ((f (string-append f "/" e))) | 288 | (let ((f (string-append f "/" e))) |
| 295 | (write-string "entry" p) | 289 | (write-string "entry" p) |
diff --git a/guix/store.scm b/guix/store.scm index 10b9062db20..933708defc8 100644 --- a/guix/store.scm +++ b/guix/store.scm | |||
| @@ -90,6 +90,8 @@ | |||
| 90 | references | 90 | references |
| 91 | requisites | 91 | requisites |
| 92 | referrers | 92 | referrers |
| 93 | optimize-store | ||
| 94 | verify-store | ||
| 93 | topologically-sorted | 95 | topologically-sorted |
| 94 | valid-derivers | 96 | valid-derivers |
| 95 | query-derivation-outputs | 97 | query-derivation-outputs |
| @@ -120,6 +122,7 @@ | |||
| 120 | derivation-path? | 122 | derivation-path? |
| 121 | store-path-package-name | 123 | store-path-package-name |
| 122 | store-path-hash-part | 124 | store-path-hash-part |
| 125 | direct-store-path | ||
| 123 | log-file)) | 126 | log-file)) |
| 124 | 127 | ||
| 125 | (define %protocol-version #x10c) | 128 | (define %protocol-version #x10c) |
| @@ -171,7 +174,9 @@ | |||
| 171 | (query-substitutable-path-infos 30) | 174 | (query-substitutable-path-infos 30) |
| 172 | (query-valid-paths 31) | 175 | (query-valid-paths 31) |
| 173 | (query-substitutable-paths 32) | 176 | (query-substitutable-paths 32) |
| 174 | (query-valid-derivers 33)) | 177 | (query-valid-derivers 33) |
| 178 | (optimize-store 34) | ||
| 179 | (verify-store 35)) | ||
| 175 | 180 | ||
| 176 | (define-enumerate-type hash-algo | 181 | (define-enumerate-type hash-algo |
| 177 | ;; hash.hh | 182 | ;; hash.hh |
| @@ -494,8 +499,8 @@ encoding conversion errors." | |||
| 494 | 499 | ||
| 495 | ;; Client-provided substitute URLs. For | 500 | ;; Client-provided substitute URLs. For |
| 496 | ;; unprivileged clients, these are considered | 501 | ;; unprivileged clients, these are considered |
| 497 | ;; "untrusted"; for root, they override the | 502 | ;; "untrusted"; for "trusted" users, they override |
| 498 | ;; daemon's settings. | 503 | ;; the daemon's settings. |
| 499 | (substitute-urls %default-substitute-urls)) | 504 | (substitute-urls %default-substitute-urls)) |
| 500 | ;; Must be called after `open-connection'. | 505 | ;; Must be called after `open-connection'. |
| 501 | 506 | ||
| @@ -760,6 +765,25 @@ substitutable. For each substitutable path, a `substitutable?' object is | |||
| 760 | returned." | 765 | returned." |
| 761 | substitutable-path-list)) | 766 | substitutable-path-list)) |
| 762 | 767 | ||
| 768 | (define-operation (optimize-store) | ||
| 769 | "Optimize the store by hard-linking identical files (\"deduplication\".) | ||
| 770 | Return #t on success." | ||
| 771 | ;; Note: the daemon in Guix <= 0.8.2 does not implement this RPC. | ||
| 772 | boolean) | ||
| 773 | |||
| 774 | (define verify-store | ||
| 775 | (let ((verify (operation (verify-store (boolean check-contents?) | ||
| 776 | (boolean repair?)) | ||
| 777 | "Verify the store." | ||
| 778 | boolean))) | ||
| 779 | (lambda* (store #:key check-contents? repair?) | ||
| 780 | "Verify the integrity of the store and return false if errors remain, | ||
| 781 | and true otherwise. When REPAIR? is true, repair any missing or altered store | ||
| 782 | items by substituting them (this typically requires root privileges because it | ||
| 783 | is not an atomic operation.) When CHECK-CONTENTS? is true, check the contents | ||
| 784 | of store items; this can take a lot of time." | ||
| 785 | (not (verify store check-contents? repair?))))) | ||
| 786 | |||
| 763 | (define (run-gc server action to-delete min-freed) | 787 | (define (run-gc server action to-delete min-freed) |
| 764 | "Perform the garbage-collector operation ACTION, one of the | 788 | "Perform the garbage-collector operation ACTION, one of the |
| 765 | `gc-action' values. When ACTION is `delete-specific', the TO-DELETE is | 789 | `gc-action' values. When ACTION is `delete-specific', the TO-DELETE is |
| @@ -1004,6 +1028,15 @@ valid inputs." | |||
| 1004 | (let ((len (+ 1 (string-length (%store-prefix))))) | 1028 | (let ((len (+ 1 (string-length (%store-prefix))))) |
| 1005 | (not (string-index (substring path len) #\/))))) | 1029 | (not (string-index (substring path len) #\/))))) |
| 1006 | 1030 | ||
| 1031 | (define (direct-store-path path) | ||
| 1032 | "Return the direct store path part of PATH, stripping components after | ||
| 1033 | '/gnu/store/xxxx-foo'." | ||
| 1034 | (let ((prefix-length (+ (string-length (%store-prefix)) 35))) | ||
| 1035 | (if (> (string-length path) prefix-length) | ||
| 1036 | (let ((slash (string-index path #\/ prefix-length))) | ||
| 1037 | (if slash (string-take path slash) path)) | ||
| 1038 | path))) | ||
| 1039 | |||
| 1007 | (define (derivation-path? path) | 1040 | (define (derivation-path? path) |
| 1008 | "Return #t if PATH is a derivation path." | 1041 | "Return #t if PATH is a derivation path." |
| 1009 | (and (store-path? path) (string-suffix? ".drv" path))) | 1042 | (and (store-path? path) (string-suffix? ".drv" path))) |
diff --git a/guix/tests.scm b/guix/tests.scm index 080ee9cc74c..87e6cc28309 100644 --- a/guix/tests.scm +++ b/guix/tests.scm | |||
| @@ -37,7 +37,8 @@ | |||
| 37 | %substitute-directory | 37 | %substitute-directory |
| 38 | with-derivation-narinfo | 38 | with-derivation-narinfo |
| 39 | with-derivation-substitute | 39 | with-derivation-substitute |
| 40 | dummy-package)) | 40 | dummy-package |
| 41 | dummy-origin)) | ||
| 41 | 42 | ||
| 42 | ;;; Commentary: | 43 | ;;; Commentary: |
| 43 | ;;; | 44 | ;;; |
| @@ -219,6 +220,13 @@ initialized with default values, and with EXTRA-FIELDS set as specified." | |||
| 219 | (synopsis #f) (description #f) | 220 | (synopsis #f) (description #f) |
| 220 | (home-page #f) (license #f))) | 221 | (home-page #f) (license #f))) |
| 221 | 222 | ||
| 223 | (define-syntax-rule (dummy-origin extra-fields ...) | ||
| 224 | "Return a \"dummy\" origin, with all its compulsory fields initialized with | ||
| 225 | default values, and with EXTRA-FIELDS set as specified." | ||
| 226 | (origin extra-fields ... | ||
| 227 | (method #f) (uri "http://www.example.com") | ||
| 228 | (sha256 (base32 (make-string 52 #\x))))) | ||
| 229 | |||
| 222 | ;; Local Variables: | 230 | ;; Local Variables: |
| 223 | ;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1) | 231 | ;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1) |
| 224 | ;; eval: (put 'call-with-derivation-substitute 'scheme-indent-function 2) | 232 | ;; eval: (put 'call-with-derivation-substitute 'scheme-indent-function 2) |
diff --git a/guix/ui.scm b/guix/ui.scm index e717ab713eb..11af646a6ee 100644 --- a/guix/ui.scm +++ b/guix/ui.scm | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #:use-module (srfi srfi-11) | 35 | #:use-module (srfi srfi-11) |
| 36 | #:use-module (srfi srfi-19) | 36 | #:use-module (srfi srfi-19) |
| 37 | #:use-module (srfi srfi-26) | 37 | #:use-module (srfi srfi-26) |
| 38 | #:use-module (srfi srfi-31) | ||
| 38 | #:use-module (srfi srfi-34) | 39 | #:use-module (srfi srfi-34) |
| 39 | #:use-module (srfi srfi-35) | 40 | #:use-module (srfi srfi-35) |
| 40 | #:use-module (srfi srfi-37) | 41 | #:use-module (srfi srfi-37) |
| @@ -42,19 +43,22 @@ | |||
| 42 | #:use-module (ice-9 match) | 43 | #:use-module (ice-9 match) |
| 43 | #:use-module (ice-9 format) | 44 | #:use-module (ice-9 format) |
| 44 | #:use-module (ice-9 regex) | 45 | #:use-module (ice-9 regex) |
| 45 | #:replace (symlink) | 46 | #:autoload (system repl repl) (start-repl) |
| 47 | #:autoload (system repl debug) (make-debug stack->vector) | ||
| 46 | #:export (_ | 48 | #:export (_ |
| 47 | N_ | 49 | N_ |
| 48 | P_ | 50 | P_ |
| 49 | report-error | 51 | report-error |
| 50 | leave | 52 | leave |
| 51 | report-load-error | 53 | make-user-module |
| 54 | load* | ||
| 52 | warn-about-load-error | 55 | warn-about-load-error |
| 53 | show-version-and-exit | 56 | show-version-and-exit |
| 54 | show-bug-report-information | 57 | show-bug-report-information |
| 55 | string->number* | 58 | string->number* |
| 56 | size->number | 59 | size->number |
| 57 | show-what-to-build | 60 | show-what-to-build |
| 61 | show-what-to-build* | ||
| 58 | show-manifest-transaction | 62 | show-manifest-transaction |
| 59 | call-with-error-handling | 63 | call-with-error-handling |
| 60 | with-error-handling | 64 | with-error-handling |
| @@ -133,22 +137,102 @@ messages." | |||
| 133 | (report-error args ...) | 137 | (report-error args ...) |
| 134 | (exit 1))) | 138 | (exit 1))) |
| 135 | 139 | ||
| 136 | (define (report-load-error file args) | 140 | (define (make-user-module modules) |
| 137 | "Report the failure to load FILE, a user-provided Scheme file, and exit. | 141 | "Return a new user module with the additional MODULES loaded." |
| 142 | ;; Module in which the machine description file is loaded. | ||
| 143 | (let ((module (make-fresh-user-module))) | ||
| 144 | (for-each (lambda (iface) | ||
| 145 | (module-use! module (resolve-interface iface))) | ||
| 146 | modules) | ||
| 147 | module)) | ||
| 148 | |||
| 149 | (define* (load* file user-module | ||
| 150 | #:key (on-error 'nothing-special)) | ||
| 151 | "Load the user provided Scheme source code FILE." | ||
| 152 | (define (frame-with-source frame) | ||
| 153 | ;; Walk from FRAME upwards until source location information is found. | ||
| 154 | (let loop ((frame frame) | ||
| 155 | (previous frame)) | ||
| 156 | (if (not frame) | ||
| 157 | previous | ||
| 158 | (if (frame-source frame) | ||
| 159 | frame | ||
| 160 | (loop (frame-previous frame) frame))))) | ||
| 161 | |||
| 162 | (define (error-string frame args) | ||
| 163 | (call-with-output-string | ||
| 164 | (lambda (port) | ||
| 165 | (apply display-error frame port (cdr args))))) | ||
| 166 | |||
| 167 | (define tag | ||
| 168 | (make-prompt-tag "user-code")) | ||
| 169 | |||
| 170 | (catch #t | ||
| 171 | (lambda () | ||
| 172 | ;; XXX: Force a recompilation to avoid ABI issues. | ||
| 173 | (set! %fresh-auto-compile #t) | ||
| 174 | (set! %load-should-auto-compile #t) | ||
| 175 | |||
| 176 | (save-module-excursion | ||
| 177 | (lambda () | ||
| 178 | (set-current-module user-module) | ||
| 179 | |||
| 180 | ;; Hide the "auto-compiling" messages. | ||
| 181 | (parameterize ((current-warning-port (%make-void-port "w"))) | ||
| 182 | (call-with-prompt tag | ||
| 183 | (lambda () | ||
| 184 | ;; Give 'load' an absolute file name so that it doesn't try to | ||
| 185 | ;; search for FILE in %LOAD-PATH. Note: use 'load', not | ||
| 186 | ;; 'primitive-load', so that FILE is compiled, which then allows us | ||
| 187 | ;; to provide better error reporting with source line numbers. | ||
| 188 | (load (canonicalize-path file))) | ||
| 189 | (const #f)))))) | ||
| 190 | (lambda _ | ||
| 191 | ;; XXX: Errors are reported from the pre-unwind handler below, but | ||
| 192 | ;; calling 'exit' from there has no effect, so we call it here. | ||
| 193 | (exit 1)) | ||
| 194 | (rec (handle-error . args) | ||
| 195 | ;; Capture the stack up to this procedure call, excluded, and pass | ||
| 196 | ;; the faulty stack frame to 'report-load-error'. | ||
| 197 | (let* ((stack (make-stack #t handle-error tag)) | ||
| 198 | (depth (stack-length stack)) | ||
| 199 | (last (and (> depth 0) (stack-ref stack 0))) | ||
| 200 | (frame (frame-with-source | ||
| 201 | (if (> depth 1) | ||
| 202 | (stack-ref stack 1) ;skip the 'throw' frame | ||
| 203 | last)))) | ||
| 204 | |||
| 205 | (report-load-error file args frame) | ||
| 206 | |||
| 207 | (case on-error | ||
| 208 | ((debug) | ||
| 209 | (newline) | ||
| 210 | (display (_ "entering debugger; type ',bt' for a backtrace\n")) | ||
| 211 | (start-repl #:debug (make-debug (stack->vector stack) 0 | ||
| 212 | (error-string frame args) | ||
| 213 | #f))) | ||
| 214 | ((backtrace) | ||
| 215 | (newline (current-error-port)) | ||
| 216 | (display-backtrace stack (current-error-port))) | ||
| 217 | (else | ||
| 218 | #t)))))) | ||
| 219 | |||
| 220 | (define* (report-load-error file args #:optional frame) | ||
| 221 | "Report the failure to load FILE, a user-provided Scheme file. | ||
| 138 | ARGS is the list of arguments received by the 'throw' handler." | 222 | ARGS is the list of arguments received by the 'throw' handler." |
| 139 | (match args | 223 | (match args |
| 140 | (('system-error . _) | 224 | (('system-error . _) |
| 141 | (let ((err (system-error-errno args))) | 225 | (let ((err (system-error-errno args))) |
| 142 | (leave (_ "failed to load '~a': ~a~%") file (strerror err)))) | 226 | (report-error (_ "failed to load '~a': ~a~%") file (strerror err)))) |
| 143 | (('syntax-error proc message properties form . rest) | 227 | (('syntax-error proc message properties form . rest) |
| 144 | (let ((loc (source-properties->location properties))) | 228 | (let ((loc (source-properties->location properties))) |
| 145 | (format (current-error-port) (_ "~a: error: ~a~%") | 229 | (format (current-error-port) (_ "~a: error: ~a~%") |
| 146 | (location->string loc) message) | 230 | (location->string loc) message))) |
| 147 | (exit 1))) | 231 | (('srfi-34 obj) |
| 232 | (report-error (_ "exception thrown: ~s~%") obj)) | ||
| 148 | ((error args ...) | 233 | ((error args ...) |
| 149 | (report-error (_ "failed to load '~a':~%") file) | 234 | (report-error (_ "failed to load '~a':~%") file) |
| 150 | (apply display-error #f (current-error-port) args) | 235 | (apply display-error frame (current-error-port) args)))) |
| 151 | (exit 1)))) | ||
| 152 | 236 | ||
| 153 | (define (warn-about-load-error file args) ;FIXME: factorize with ↑ | 237 | (define (warn-about-load-error file args) ;FIXME: factorize with ↑ |
| 154 | "Report the failure to load FILE, a user-provided Scheme file, without | 238 | "Report the failure to load FILE, a user-provided Scheme file, without |
| @@ -161,6 +245,9 @@ exiting. ARGS is the list of arguments received by the 'throw' handler." | |||
| 161 | (let ((loc (source-properties->location properties))) | 245 | (let ((loc (source-properties->location properties))) |
| 162 | (format (current-error-port) (_ "~a: warning: ~a~%") | 246 | (format (current-error-port) (_ "~a: warning: ~a~%") |
| 163 | (location->string loc) message))) | 247 | (location->string loc) message))) |
| 248 | (('srfi-34 obj) | ||
| 249 | (warning (_ "failed to load '~a': exception thrown: ~s~%") | ||
| 250 | file obj)) | ||
| 164 | ((error args ...) | 251 | ((error args ...) |
| 165 | (warning (_ "failed to load '~a':~%") file) | 252 | (warning (_ "failed to load '~a':~%") file) |
| 166 | (apply display-error #f (current-error-port) args)))) | 253 | (apply display-error #f (current-error-port) args)))) |
| @@ -206,7 +293,9 @@ Report bugs to: ~a.") %guix-bug-report-address) | |||
| 206 | General help using GNU software: <http://www.gnu.org/gethelp/>")) | 293 | General help using GNU software: <http://www.gnu.org/gethelp/>")) |
| 207 | (newline)) | 294 | (newline)) |
| 208 | 295 | ||
| 209 | (define symlink | 296 | (set! symlink |
| 297 | ;; We 'set!' the global binding because (gnu build ...) modules and similar | ||
| 298 | ;; typically don't use (guix ui). | ||
| 210 | (let ((real-symlink (@ (guile) symlink))) | 299 | (let ((real-symlink (@ (guile) symlink))) |
| 211 | (lambda (target link) | 300 | (lambda (target link) |
| 212 | "This is a 'symlink' replacement that provides proper error reporting." | 301 | "This is a 'symlink' replacement that provides proper error reporting." |
| @@ -218,8 +307,25 @@ General help using GNU software: <http://www.gnu.org/gethelp/>")) | |||
| 218 | ;; information is missing as of Guile 2.0.11, making the exception | 307 | ;; information is missing as of Guile 2.0.11, making the exception |
| 219 | ;; uninformative.) | 308 | ;; uninformative.) |
| 220 | (apply throw key proc "~A: ~S" | 309 | (apply throw key proc "~A: ~S" |
| 221 | (append args (list link)) | 310 | (list (strerror (car errno)) link) |
| 222 | errno)))))) | 311 | (list errno))))))) |
| 312 | |||
| 313 | (set! copy-file | ||
| 314 | ;; Note: here we use 'set!', not #:replace, because UIs typically use | ||
| 315 | ;; 'copy-recursively', which doesn't use (guix ui). | ||
| 316 | (let ((real-copy-file (@ (guile) copy-file))) | ||
| 317 | (lambda (source target) | ||
| 318 | "This is a 'copy-file' replacement that provides proper error reporting." | ||
| 319 | (catch 'system-error | ||
| 320 | (lambda () | ||
| 321 | (real-copy-file source target)) | ||
| 322 | (lambda (key proc fmt args errno) | ||
| 323 | ;; Augment the FMT and ARGS with information about TARGET (this | ||
| 324 | ;; information is missing as of Guile 2.0.11, making the exception | ||
| 325 | ;; uninformative.) | ||
| 326 | (apply throw key proc "~A: ~S" | ||
| 327 | (list (strerror (car errno)) target) | ||
| 328 | (list errno))))))) | ||
| 223 | 329 | ||
| 224 | (define (string->number* str) | 330 | (define (string->number* str) |
| 225 | "Like `string->number', but error out with an error message on failure." | 331 | "Like `string->number', but error out with an error message on failure." |
| @@ -346,8 +452,16 @@ interpreted." | |||
| 346 | (lambda () | 452 | (lambda () |
| 347 | (eval exp (force %guix-user-module))) | 453 | (eval exp (force %guix-user-module))) |
| 348 | (lambda args | 454 | (lambda args |
| 349 | (leave (_ "failed to evaluate expression `~a': ~s~%") | 455 | (report-error (_ "failed to evaluate expression '~a':~%") exp) |
| 350 | exp args))))) | 456 | (match args |
| 457 | (('syntax-error proc message properties form . rest) | ||
| 458 | (report-error (_ "syntax error: ~a~%") message)) | ||
| 459 | (('srfi-34 obj) | ||
| 460 | (report-error (_ "exception thrown: ~s~%") obj)) | ||
| 461 | ((error args ...) | ||
| 462 | (apply display-error #f (current-error-port) args)) | ||
| 463 | (what? #f)) | ||
| 464 | (exit 1))))) | ||
| 351 | 465 | ||
| 352 | (define (read/eval-package-expression str) | 466 | (define (read/eval-package-expression str) |
| 353 | "Read and evaluate STR and return the package it refers to, or exit an | 467 | "Read and evaluate STR and return the package it refers to, or exit an |
| @@ -429,6 +543,9 @@ available for download." | |||
| 429 | (null? download) download))) | 543 | (null? download) download))) |
| 430 | (pair? build))) | 544 | (pair? build))) |
| 431 | 545 | ||
| 546 | (define show-what-to-build* | ||
| 547 | (store-lift show-what-to-build)) | ||
| 548 | |||
| 432 | (define (right-arrow port) | 549 | (define (right-arrow port) |
| 433 | "Return either a string containing the 'RIGHT ARROW' character, or an ASCII | 550 | "Return either a string containing the 'RIGHT ARROW' character, or an ASCII |
| 434 | replacement if PORT is not Unicode-capable." | 551 | replacement if PORT is not Unicode-capable." |
| @@ -852,11 +969,8 @@ parameter of 'args-fold'." | |||
| 852 | (define dot-scm? | 969 | (define dot-scm? |
| 853 | (cut string-suffix? ".scm" <>)) | 970 | (cut string-suffix? ".scm" <>)) |
| 854 | 971 | ||
| 855 | ;; In Guile 2.0.5 `scandir' would return "." and ".." regardless even though | ||
| 856 | ;; they don't match `dot-scm?'. Work around it by doing additional | ||
| 857 | ;; filtering. | ||
| 858 | (if directory | 972 | (if directory |
| 859 | (filter dot-scm? (scandir directory dot-scm?)) | 973 | (scandir directory dot-scm?) |
| 860 | '())) | 974 | '())) |
| 861 | 975 | ||
| 862 | (define (commands) | 976 | (define (commands) |
diff --git a/guix/utils.scm b/guix/utils.scm index 3d38ba12235..a2ade2bf970 100644 --- a/guix/utils.scm +++ b/guix/utils.scm | |||
| @@ -72,7 +72,6 @@ | |||
| 72 | version-major+minor | 72 | version-major+minor |
| 73 | guile-version>? | 73 | guile-version>? |
| 74 | package-name->name+version | 74 | package-name->name+version |
| 75 | string-tokenize* | ||
| 76 | string-replace-substring | 75 | string-replace-substring |
| 77 | arguments-from-environment-variable | 76 | arguments-from-environment-variable |
| 78 | file-extension | 77 | file-extension |
| @@ -606,33 +605,6 @@ introduce the version part." | |||
| 606 | (substring file 0 dot) | 605 | (substring file 0 dot) |
| 607 | file))) | 606 | file))) |
| 608 | 607 | ||
| 609 | (define (string-tokenize* string separator) | ||
| 610 | "Return the list of substrings of STRING separated by SEPARATOR. This is | ||
| 611 | like `string-tokenize', but SEPARATOR is a string." | ||
| 612 | (define (index string what) | ||
| 613 | (let loop ((string string) | ||
| 614 | (offset 0)) | ||
| 615 | (cond ((string-null? string) | ||
| 616 | #f) | ||
| 617 | ((string-prefix? what string) | ||
| 618 | offset) | ||
| 619 | (else | ||
| 620 | (loop (string-drop string 1) (+ 1 offset)))))) | ||
| 621 | |||
| 622 | (define len | ||
| 623 | (string-length separator)) | ||
| 624 | |||
| 625 | (let loop ((string string) | ||
| 626 | (result '())) | ||
| 627 | (cond ((index string separator) | ||
| 628 | => | ||
| 629 | (lambda (offset) | ||
| 630 | (loop (string-drop string (+ offset len)) | ||
| 631 | (cons (substring string 0 offset) | ||
| 632 | result)))) | ||
| 633 | (else | ||
| 634 | (reverse (cons string result)))))) | ||
| 635 | |||
| 636 | (define* (string-replace-substring str substr replacement | 608 | (define* (string-replace-substring str substr replacement |
| 637 | #:optional | 609 | #:optional |
| 638 | (start 0) | 610 | (start 0) |
diff --git a/m4/guix.m4 b/m4/guix.m4 index 445ce857dd6..fa5a4023ba0 100644 --- a/m4/guix.m4 +++ b/m4/guix.m4 | |||
| @@ -218,3 +218,42 @@ AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [ | |||
| 218 | AC_MSG_ERROR([store directory '$storedir' would lead to overly long hash-bang lines]) | 218 | AC_MSG_ERROR([store directory '$storedir' would lead to overly long hash-bang lines]) |
| 219 | fi | 219 | fi |
| 220 | ]) | 220 | ]) |
| 221 | |||
| 222 | dnl GUIX_CHECK_CXX11 | ||
| 223 | dnl | ||
| 224 | dnl Check whether the C++ compiler can compile a typical C++11 program. | ||
| 225 | AC_DEFUN([GUIX_CHECK_CXX11], [ | ||
| 226 | AC_REQUIRE([AC_PROG_CXX]) | ||
| 227 | AC_CACHE_CHECK([whether $CXX supports C++11], | ||
| 228 | [ac_cv_guix_cxx11_support], | ||
| 229 | [save_CXXFLAGS="$CXXFLAGS" | ||
| 230 | CXXFLAGS="-std=c++11 $CXXFLAGS" | ||
| 231 | AC_COMPILE_IFELSE([ | ||
| 232 | AC_LANG_SOURCE([ | ||
| 233 | #include <functional> | ||
| 234 | |||
| 235 | std::function<int(int)> | ||
| 236 | return_plus_lambda (int x) | ||
| 237 | { | ||
| 238 | auto result = [[&]](int y) { | ||
| 239 | return x + y; | ||
| 240 | }; | ||
| 241 | |||
| 242 | return result; | ||
| 243 | } | ||
| 244 | ])], | ||
| 245 | [ac_cv_guix_cxx11_support=yes], | ||
| 246 | [ac_cv_guix_cxx11_support=no]) | ||
| 247 | CXXFLAGS="$save_CXXFLAGS" | ||
| 248 | ]) | ||
| 249 | ]) | ||
| 250 | |||
| 251 | dnl GUIX_ASSERT_CXX11 | ||
| 252 | dnl | ||
| 253 | dnl Error out if the C++ compiler cannot compile C++11 code. | ||
| 254 | AC_DEFUN([GUIX_ASSERT_CXX11], [ | ||
| 255 | GUIX_CHECK_CXX11 | ||
| 256 | if test "x$ac_cv_guix_cxx11_support" != "xyes"; then | ||
| 257 | AC_MSG_ERROR([C++ compiler '$CXX' does not support the C++11 standard]) | ||
| 258 | fi | ||
| 259 | ]) | ||
diff --git a/nix/guix-register/guix-register.cc b/nix/guix-register/guix-register.cc index f5c610fde03..16dae62b3d2 100644 --- a/nix/guix-register/guix-register.cc +++ b/nix/guix-register/guix-register.cc | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* GNU Guix --- Functional package management for GNU | 1 | /* GNU Guix --- Functional package management for GNU |
| 2 | Copyright (C) 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | Copyright (C) 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, | 3 | Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, |
| 4 | 2013 Eelco Dolstra <eelco.dolstra@logicblox.com> | 4 | 2013 Eelco Dolstra <eelco.dolstra@logicblox.com> |
| 5 | 5 | ||
| @@ -192,13 +192,21 @@ register_validity (LocalStore *store, std::istream &input, | |||
| 192 | store's '.links' directory, which means 'optimisePath' would try to link | 192 | store's '.links' directory, which means 'optimisePath' would try to link |
| 193 | to that instead of linking to the target store. Thus, disable | 193 | to that instead of linking to the target store. Thus, disable |
| 194 | deduplication in this case. */ | 194 | deduplication in this case. */ |
| 195 | if (optimize && prefix.empty ()) | 195 | if (optimize) |
| 196 | { | 196 | { |
| 197 | /* Make sure deduplication is enabled. */ | 197 | /* Make sure deduplication is enabled. */ |
| 198 | settings.autoOptimiseStore = true; | 198 | settings.autoOptimiseStore = true; |
| 199 | 199 | ||
| 200 | foreach (ValidPathInfos::const_iterator, i, infos) | 200 | std::string store_dir = settings.nixStore; |
| 201 | store->optimisePath (i->path); | 201 | |
| 202 | /* 'optimisePath' creates temporary links under 'settings.nixStore' and | ||
| 203 | this must be the real target store, under PREFIX, to avoid | ||
| 204 | cross-device links. Thus, temporarily switch the value of | ||
| 205 | 'settings.nixStore'. */ | ||
| 206 | settings.nixStore = prefix + store_dir; | ||
| 207 | for (auto&& i: infos) | ||
| 208 | store->optimisePath (prefix + i.path); | ||
| 209 | settings.nixStore = store_dir; | ||
| 202 | } | 210 | } |
| 203 | } | 211 | } |
| 204 | 212 | ||
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index f38cd299403..85a818ba94f 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc | |||
| @@ -38,6 +38,9 @@ | |||
| 38 | #if HAVE_SYS_MOUNT_H | 38 | #if HAVE_SYS_MOUNT_H |
| 39 | #include <sys/mount.h> | 39 | #include <sys/mount.h> |
| 40 | #endif | 40 | #endif |
| 41 | #if HAVE_SYS_SYSCALL_H | ||
| 42 | #include <sys/syscall.h> | ||
| 43 | #endif | ||
| 41 | #if HAVE_SCHED_H | 44 | #if HAVE_SCHED_H |
| 42 | #include <sched.h> | 45 | #include <sched.h> |
| 43 | #endif | 46 | #endif |
| @@ -48,7 +51,7 @@ | |||
| 48 | #include <linux/fs.h> | 51 | #include <linux/fs.h> |
| 49 | #endif | 52 | #endif |
| 50 | 53 | ||
| 51 | #define CHROOT_ENABLED HAVE_CHROOT && HAVE_UNSHARE && HAVE_SYS_MOUNT_H && defined(MS_BIND) && defined(MS_PRIVATE) && defined(CLONE_NEWNS) | 54 | #define CHROOT_ENABLED HAVE_CHROOT && HAVE_UNSHARE && HAVE_SYS_MOUNT_H && defined(MS_BIND) && defined(MS_PRIVATE) && defined(CLONE_NEWNS) && defined(SYS_pivot_root) |
| 52 | 55 | ||
| 53 | #if CHROOT_ENABLED | 56 | #if CHROOT_ENABLED |
| 54 | #include <sys/socket.h> | 57 | #include <sys/socket.h> |
| @@ -57,9 +60,8 @@ | |||
| 57 | #include <netinet/ip.h> | 60 | #include <netinet/ip.h> |
| 58 | #endif | 61 | #endif |
| 59 | 62 | ||
| 60 | #if HAVE_SYS_PERSONALITY_H | 63 | #if __linux__ |
| 61 | #include <sys/personality.h> | 64 | #include <sys/personality.h> |
| 62 | #define CAN_DO_LINUX32_BUILDS | ||
| 63 | #endif | 65 | #endif |
| 64 | 66 | ||
| 65 | #if HAVE_STATVFS | 67 | #if HAVE_STATVFS |
| @@ -85,8 +87,12 @@ class Goal; | |||
| 85 | typedef std::shared_ptr<Goal> GoalPtr; | 87 | typedef std::shared_ptr<Goal> GoalPtr; |
| 86 | typedef std::weak_ptr<Goal> WeakGoalPtr; | 88 | typedef std::weak_ptr<Goal> WeakGoalPtr; |
| 87 | 89 | ||
| 90 | struct CompareGoalPtrs { | ||
| 91 | bool operator() (const GoalPtr & a, const GoalPtr & b); | ||
| 92 | }; | ||
| 93 | |||
| 88 | /* Set of goals. */ | 94 | /* Set of goals. */ |
| 89 | typedef set<GoalPtr> Goals; | 95 | typedef set<GoalPtr, CompareGoalPtrs> Goals; |
| 90 | typedef list<WeakGoalPtr> WeakGoals; | 96 | typedef list<WeakGoalPtr> WeakGoals; |
| 91 | 97 | ||
| 92 | /* A map of paths to goals (and the other way around). */ | 98 | /* A map of paths to goals (and the other way around). */ |
| @@ -173,11 +179,20 @@ public: | |||
| 173 | (important!), etc. */ | 179 | (important!), etc. */ |
| 174 | virtual void cancel(bool timeout) = 0; | 180 | virtual void cancel(bool timeout) = 0; |
| 175 | 181 | ||
| 182 | virtual string key() = 0; | ||
| 183 | |||
| 176 | protected: | 184 | protected: |
| 177 | void amDone(ExitCode result); | 185 | void amDone(ExitCode result); |
| 178 | }; | 186 | }; |
| 179 | 187 | ||
| 180 | 188 | ||
| 189 | bool CompareGoalPtrs::operator() (const GoalPtr & a, const GoalPtr & b) { | ||
| 190 | string s1 = a->key(); | ||
| 191 | string s2 = b->key(); | ||
| 192 | return s1 < s2; | ||
| 193 | } | ||
| 194 | |||
| 195 | |||
| 181 | /* A mapping used to remember for each child process to what goal it | 196 | /* A mapping used to remember for each child process to what goal it |
| 182 | belongs, and file descriptors for receiving log data and output | 197 | belongs, and file descriptors for receiving log data and output |
| 183 | path creation commands. */ | 198 | path creation commands. */ |
| @@ -238,6 +253,9 @@ public: | |||
| 238 | failure). */ | 253 | failure). */ |
| 239 | bool permanentFailure; | 254 | bool permanentFailure; |
| 240 | 255 | ||
| 256 | /* Set if at least one derivation had a timeout. */ | ||
| 257 | bool timedOut; | ||
| 258 | |||
| 241 | LocalStore & store; | 259 | LocalStore & store; |
| 242 | 260 | ||
| 243 | std::shared_ptr<HookInstance> hook; | 261 | std::shared_ptr<HookInstance> hook; |
| @@ -301,6 +319,7 @@ public: | |||
| 301 | void addToWeakGoals(WeakGoals & goals, GoalPtr p) | 319 | void addToWeakGoals(WeakGoals & goals, GoalPtr p) |
| 302 | { | 320 | { |
| 303 | // FIXME: necessary? | 321 | // FIXME: necessary? |
| 322 | // FIXME: O(n) | ||
| 304 | foreach (WeakGoals::iterator, i, goals) | 323 | foreach (WeakGoals::iterator, i, goals) |
| 305 | if (i->lock() == p) return; | 324 | if (i->lock() == p) return; |
| 306 | goals.push_back(p); | 325 | goals.push_back(p); |
| @@ -374,8 +393,6 @@ void Goal::trace(const format & f) | |||
| 374 | /* Common initialisation performed in child processes. */ | 393 | /* Common initialisation performed in child processes. */ |
| 375 | static void commonChildInit(Pipe & logPipe) | 394 | static void commonChildInit(Pipe & logPipe) |
| 376 | { | 395 | { |
| 377 | restoreAffinity(); | ||
| 378 | |||
| 379 | /* Put the child in a separate session (and thus a separate | 396 | /* Put the child in a separate session (and thus a separate |
| 380 | process group) so that it has no controlling terminal (meaning | 397 | process group) so that it has no controlling terminal (meaning |
| 381 | that e.g. ssh cannot open /dev/tty) and it doesn't receive | 398 | that e.g. ssh cannot open /dev/tty) and it doesn't receive |
| @@ -400,19 +417,6 @@ static void commonChildInit(Pipe & logPipe) | |||
| 400 | close(fdDevNull); | 417 | close(fdDevNull); |
| 401 | } | 418 | } |
| 402 | 419 | ||
| 403 | |||
| 404 | /* Convert a string list to an array of char pointers. Careful: the | ||
| 405 | string list should outlive the array. */ | ||
| 406 | const char * * strings2CharPtrs(const Strings & ss) | ||
| 407 | { | ||
| 408 | const char * * arr = new const char * [ss.size() + 1]; | ||
| 409 | const char * * p = arr; | ||
| 410 | foreach (Strings::const_iterator, i, ss) *p++ = i->c_str(); | ||
| 411 | *p = 0; | ||
| 412 | return arr; | ||
| 413 | } | ||
| 414 | |||
| 415 | |||
| 416 | /* Restore default handling of SIGPIPE, otherwise some programs will | 420 | /* Restore default handling of SIGPIPE, otherwise some programs will |
| 417 | randomly say "Broken pipe". */ | 421 | randomly say "Broken pipe". */ |
| 418 | static void restoreSIGPIPE() | 422 | static void restoreSIGPIPE() |
| @@ -590,7 +594,9 @@ HookInstance::HookInstance() | |||
| 590 | { | 594 | { |
| 591 | debug("starting build hook"); | 595 | debug("starting build hook"); |
| 592 | 596 | ||
| 593 | Path buildHook = absPath(getEnv("NIX_BUILD_HOOK")); | 597 | Path buildHook = getEnv("NIX_BUILD_HOOK"); |
| 598 | if (string(buildHook, 0, 1) != "/") buildHook = settings.nixLibexecDir + "/nix/" + buildHook; | ||
| 599 | buildHook = canonPath(buildHook); | ||
| 594 | 600 | ||
| 595 | /* Create a pipe to get the output of the child. */ | 601 | /* Create a pipe to get the output of the child. */ |
| 596 | fromHook.create(); | 602 | fromHook.create(); |
| @@ -602,44 +608,30 @@ HookInstance::HookInstance() | |||
| 602 | builderOut.create(); | 608 | builderOut.create(); |
| 603 | 609 | ||
| 604 | /* Fork the hook. */ | 610 | /* Fork the hook. */ |
| 605 | pid = maybeVfork(); | 611 | pid = startProcess([&]() { |
| 606 | switch (pid) { | ||
| 607 | |||
| 608 | case -1: | ||
| 609 | throw SysError("unable to fork"); | ||
| 610 | 612 | ||
| 611 | case 0: | 613 | commonChildInit(fromHook); |
| 612 | try { /* child */ | ||
| 613 | 614 | ||
| 614 | commonChildInit(fromHook); | 615 | if (chdir("/") == -1) throw SysError("changing into `/"); |
| 615 | 616 | ||
| 616 | if (chdir("/") == -1) throw SysError("changing into `/"); | 617 | /* Dup the communication pipes. */ |
| 618 | if (dup2(toHook.readSide, STDIN_FILENO) == -1) | ||
| 619 | throw SysError("dupping to-hook read side"); | ||
| 617 | 620 | ||
| 618 | /* Dup the communication pipes. */ | 621 | /* Use fd 4 for the builder's stdout/stderr. */ |
| 619 | if (dup2(toHook.readSide, STDIN_FILENO) == -1) | 622 | if (dup2(builderOut.writeSide, 4) == -1) |
| 620 | throw SysError("dupping to-hook read side"); | 623 | throw SysError("dupping builder's stdout/stderr"); |
| 621 | 624 | ||
| 622 | /* Use fd 4 for the builder's stdout/stderr. */ | 625 | execl(buildHook.c_str(), buildHook.c_str(), settings.thisSystem.c_str(), |
| 623 | if (dup2(builderOut.writeSide, 4) == -1) | 626 | (format("%1%") % settings.maxSilentTime).str().c_str(), |
| 624 | throw SysError("dupping builder's stdout/stderr"); | 627 | (format("%1%") % settings.printBuildTrace).str().c_str(), |
| 628 | (format("%1%") % settings.buildTimeout).str().c_str(), | ||
| 629 | NULL); | ||
| 625 | 630 | ||
| 626 | execl(buildHook.c_str(), buildHook.c_str(), settings.thisSystem.c_str(), | 631 | throw SysError(format("executing `%1%'") % buildHook); |
| 627 | (format("%1%") % settings.maxSilentTime).str().c_str(), | 632 | }); |
| 628 | (format("%1%") % settings.printBuildTrace).str().c_str(), | ||
| 629 | (format("%1%") % settings.buildTimeout).str().c_str(), | ||
| 630 | NULL); | ||
| 631 | 633 | ||
| 632 | throw SysError(format("executing `%1%'") % buildHook); | ||
| 633 | |||
| 634 | } catch (std::exception & e) { | ||
| 635 | writeToStderr("build hook error: " + string(e.what()) + "\n"); | ||
| 636 | } | ||
| 637 | _exit(1); | ||
| 638 | } | ||
| 639 | |||
| 640 | /* parent */ | ||
| 641 | pid.setSeparatePG(true); | 634 | pid.setSeparatePG(true); |
| 642 | pid.setKillSignal(SIGTERM); | ||
| 643 | fromHook.writeSide.close(); | 635 | fromHook.writeSide.close(); |
| 644 | toHook.readSide.close(); | 636 | toHook.readSide.close(); |
| 645 | } | 637 | } |
| @@ -648,7 +640,8 @@ HookInstance::HookInstance() | |||
| 648 | HookInstance::~HookInstance() | 640 | HookInstance::~HookInstance() |
| 649 | { | 641 | { |
| 650 | try { | 642 | try { |
| 651 | pid.kill(); | 643 | toHook.writeSide.close(); |
| 644 | pid.kill(true); | ||
| 652 | } catch (...) { | 645 | } catch (...) { |
| 653 | ignoreException(); | 646 | ignoreException(); |
| 654 | } | 647 | } |
| @@ -761,7 +754,7 @@ private: | |||
| 761 | typedef void (DerivationGoal::*GoalState)(); | 754 | typedef void (DerivationGoal::*GoalState)(); |
| 762 | GoalState state; | 755 | GoalState state; |
| 763 | 756 | ||
| 764 | /* Stuff we need to pass to initChild(). */ | 757 | /* Stuff we need to pass to runChild(). */ |
| 765 | typedef map<Path, Path> DirsInChroot; // maps target path to source path | 758 | typedef map<Path, Path> DirsInChroot; // maps target path to source path |
| 766 | DirsInChroot dirsInChroot; | 759 | DirsInChroot dirsInChroot; |
| 767 | typedef map<string, string> Environment; | 760 | typedef map<string, string> Environment; |
| @@ -784,17 +777,21 @@ private: | |||
| 784 | outputs to allow hard links between outputs. */ | 777 | outputs to allow hard links between outputs. */ |
| 785 | InodesSeen inodesSeen; | 778 | InodesSeen inodesSeen; |
| 786 | 779 | ||
| 787 | /* Magic exit code denoting that setting up the child environment | ||
| 788 | failed. (It's possible that the child actually returns the | ||
| 789 | exit code, but ah well.) */ | ||
| 790 | const static int childSetupFailed = 189; | ||
| 791 | |||
| 792 | public: | 780 | public: |
| 793 | DerivationGoal(const Path & drvPath, const StringSet & wantedOutputs, Worker & worker, BuildMode buildMode = bmNormal); | 781 | DerivationGoal(const Path & drvPath, const StringSet & wantedOutputs, Worker & worker, BuildMode buildMode = bmNormal); |
| 794 | ~DerivationGoal(); | 782 | ~DerivationGoal(); |
| 795 | 783 | ||
| 796 | void cancel(bool timeout); | 784 | void cancel(bool timeout); |
| 797 | 785 | ||
| 786 | string key() | ||
| 787 | { | ||
| 788 | /* Ensure that derivations get built in order of their name, | ||
| 789 | i.e. a derivation named "aardvark" always comes before | ||
| 790 | "baboon". And substitution goals always happen before | ||
| 791 | derivation goals (due to "b$"). */ | ||
| 792 | return "b$" + storePathToName(drvPath) + "$" + drvPath; | ||
| 793 | } | ||
| 794 | |||
| 798 | void work(); | 795 | void work(); |
| 799 | 796 | ||
| 800 | Path getDrvPath() | 797 | Path getDrvPath() |
| @@ -821,8 +818,8 @@ private: | |||
| 821 | /* Start building a derivation. */ | 818 | /* Start building a derivation. */ |
| 822 | void startBuilder(); | 819 | void startBuilder(); |
| 823 | 820 | ||
| 824 | /* Initialise the builder's process. */ | 821 | /* Run the builder's process. */ |
| 825 | void initChild(); | 822 | void runChild(); |
| 826 | 823 | ||
| 827 | friend int childEntry(void *); | 824 | friend int childEntry(void *); |
| 828 | 825 | ||
| @@ -879,13 +876,9 @@ DerivationGoal::~DerivationGoal() | |||
| 879 | { | 876 | { |
| 880 | /* Careful: we should never ever throw an exception from a | 877 | /* Careful: we should never ever throw an exception from a |
| 881 | destructor. */ | 878 | destructor. */ |
| 882 | try { | 879 | try { killChild(); } catch (...) { ignoreException(); } |
| 883 | killChild(); | 880 | try { deleteTmpDir(false); } catch (...) { ignoreException(); } |
| 884 | deleteTmpDir(false); | 881 | try { closeLogFile(); } catch (...) { ignoreException(); } |
| 885 | closeLogFile(); | ||
| 886 | } catch (...) { | ||
| 887 | ignoreException(); | ||
| 888 | } | ||
| 889 | } | 882 | } |
| 890 | 883 | ||
| 891 | 884 | ||
| @@ -956,6 +949,11 @@ void DerivationGoal::init() | |||
| 956 | /* The first thing to do is to make sure that the derivation | 949 | /* The first thing to do is to make sure that the derivation |
| 957 | exists. If it doesn't, it may be created through a | 950 | exists. If it doesn't, it may be created through a |
| 958 | substitute. */ | 951 | substitute. */ |
| 952 | if (buildMode == bmNormal && worker.store.isValidPath(drvPath)) { | ||
| 953 | haveDerivation(); | ||
| 954 | return; | ||
| 955 | } | ||
| 956 | |||
| 959 | addWaitee(worker.makeSubstitutionGoal(drvPath)); | 957 | addWaitee(worker.makeSubstitutionGoal(drvPath)); |
| 960 | 958 | ||
| 961 | state = &DerivationGoal::haveDerivation; | 959 | state = &DerivationGoal::haveDerivation; |
| @@ -1209,7 +1207,7 @@ static string get(const StringPairs & map, const string & key) | |||
| 1209 | static bool canBuildLocally(const string & platform) | 1207 | static bool canBuildLocally(const string & platform) |
| 1210 | { | 1208 | { |
| 1211 | return platform == settings.thisSystem | 1209 | return platform == settings.thisSystem |
| 1212 | #ifdef CAN_DO_LINUX32_BUILDS | 1210 | #if __linux__ |
| 1213 | || (platform == "i686-linux" && settings.thisSystem == "x86_64-linux") | 1211 | || (platform == "i686-linux" && settings.thisSystem == "x86_64-linux") |
| 1214 | #endif | 1212 | #endif |
| 1215 | ; | 1213 | ; |
| @@ -1433,9 +1431,6 @@ void DerivationGoal::buildDone() | |||
| 1433 | if (pathExists(chrootRootDir + *i)) | 1431 | if (pathExists(chrootRootDir + *i)) |
| 1434 | rename((chrootRootDir + *i).c_str(), i->c_str()); | 1432 | rename((chrootRootDir + *i).c_str(), i->c_str()); |
| 1435 | 1433 | ||
| 1436 | if (WIFEXITED(status) && WEXITSTATUS(status) == childSetupFailed) | ||
| 1437 | throw Error(format("failed to set up the build environment for `%1%'") % drvPath); | ||
| 1438 | |||
| 1439 | if (diskFull) | 1434 | if (diskFull) |
| 1440 | printMsg(lvlError, "note: build failure may have been caused by lack of free disk space"); | 1435 | printMsg(lvlError, "note: build failure may have been caused by lack of free disk space"); |
| 1441 | 1436 | ||
| @@ -1469,37 +1464,41 @@ void DerivationGoal::buildDone() | |||
| 1469 | outputLocks.unlock(); | 1464 | outputLocks.unlock(); |
| 1470 | 1465 | ||
| 1471 | } catch (BuildError & e) { | 1466 | } catch (BuildError & e) { |
| 1472 | printMsg(lvlError, e.msg()); | 1467 | if (!hook) |
| 1468 | printMsg(lvlError, e.msg()); | ||
| 1473 | outputLocks.unlock(); | 1469 | outputLocks.unlock(); |
| 1474 | buildUser.release(); | 1470 | buildUser.release(); |
| 1475 | 1471 | ||
| 1476 | /* When using a build hook, the hook will return a remote | 1472 | if (hook && WIFEXITED(status) && WEXITSTATUS(status) == 101) { |
| 1477 | build failure using exit code 100. Anything else is a hook | 1473 | if (settings.printBuildTrace) |
| 1478 | problem. */ | 1474 | printMsg(lvlError, format("@ build-failed %1% - timeout") % drvPath); |
| 1479 | bool hookError = hook && | 1475 | worker.timedOut = true; |
| 1480 | (!WIFEXITED(status) || WEXITSTATUS(status) != 100); | 1476 | } |
| 1481 | 1477 | ||
| 1482 | if (settings.printBuildTrace) { | 1478 | else if (hook && (!WIFEXITED(status) || WEXITSTATUS(status) != 100)) { |
| 1483 | if (hook && hookError) | 1479 | if (settings.printBuildTrace) |
| 1484 | printMsg(lvlError, format("@ hook-failed %1% - %2% %3%") | 1480 | printMsg(lvlError, format("@ hook-failed %1% - %2% %3%") |
| 1485 | % drvPath % status % e.msg()); | 1481 | % drvPath % status % e.msg()); |
| 1486 | else | 1482 | } |
| 1483 | |||
| 1484 | else { | ||
| 1485 | if (settings.printBuildTrace) | ||
| 1487 | printMsg(lvlError, format("@ build-failed %1% - %2% %3%") | 1486 | printMsg(lvlError, format("@ build-failed %1% - %2% %3%") |
| 1488 | % drvPath % 1 % e.msg()); | 1487 | % drvPath % 1 % e.msg()); |
| 1488 | worker.permanentFailure = !fixedOutput && !diskFull; | ||
| 1489 | |||
| 1490 | /* Register the outputs of this build as "failed" so we | ||
| 1491 | won't try to build them again (negative caching). | ||
| 1492 | However, don't do this for fixed-output derivations, | ||
| 1493 | since they're likely to fail for transient reasons | ||
| 1494 | (e.g., fetchurl not being able to access the network). | ||
| 1495 | Hook errors (like communication problems with the | ||
| 1496 | remote machine) shouldn't be cached either. */ | ||
| 1497 | if (settings.cacheFailure && !fixedOutput && !diskFull) | ||
| 1498 | foreach (DerivationOutputs::iterator, i, drv.outputs) | ||
| 1499 | worker.store.registerFailedPath(i->second.path); | ||
| 1489 | } | 1500 | } |
| 1490 | 1501 | ||
| 1491 | /* Register the outputs of this build as "failed" so we won't | ||
| 1492 | try to build them again (negative caching). However, don't | ||
| 1493 | do this for fixed-output derivations, since they're likely | ||
| 1494 | to fail for transient reasons (e.g., fetchurl not being | ||
| 1495 | able to access the network). Hook errors (like | ||
| 1496 | communication problems with the remote machine) shouldn't | ||
| 1497 | be cached either. */ | ||
| 1498 | if (settings.cacheFailure && !hookError && !fixedOutput) | ||
| 1499 | foreach (DerivationOutputs::iterator, i, drv.outputs) | ||
| 1500 | worker.store.registerFailedPath(i->second.path); | ||
| 1501 | |||
| 1502 | worker.permanentFailure = !hookError && !fixedOutput && !diskFull; | ||
| 1503 | amDone(ecFailed); | 1502 | amDone(ecFailed); |
| 1504 | return; | 1503 | return; |
| 1505 | } | 1504 | } |
| @@ -1603,7 +1602,7 @@ void chmod_(const Path & path, mode_t mode) | |||
| 1603 | 1602 | ||
| 1604 | int childEntry(void * arg) | 1603 | int childEntry(void * arg) |
| 1605 | { | 1604 | { |
| 1606 | ((DerivationGoal *) arg)->initChild(); | 1605 | ((DerivationGoal *) arg)->runChild(); |
| 1607 | return 1; | 1606 | return 1; |
| 1608 | } | 1607 | } |
| 1609 | 1608 | ||
| @@ -1750,37 +1749,11 @@ void DerivationGoal::startBuilder() | |||
| 1750 | 1749 | ||
| 1751 | /* Change ownership of the temporary build directory. */ | 1750 | /* Change ownership of the temporary build directory. */ |
| 1752 | if (chown(tmpDir.c_str(), buildUser.getUID(), buildUser.getGID()) == -1) | 1751 | if (chown(tmpDir.c_str(), buildUser.getUID(), buildUser.getGID()) == -1) |
| 1753 | throw SysError(format("cannot change ownership of `%1%'") % tmpDir); | 1752 | throw SysError(format("cannot change ownership of '%1%'") % tmpDir); |
| 1753 | } | ||
| 1754 | 1754 | ||
| 1755 | /* Check that the Nix store has the appropriate permissions, | ||
| 1756 | i.e., owned by root and mode 1775 (sticky bit on so that | ||
| 1757 | the builder can create its output but not mess with the | ||
| 1758 | outputs of other processes). */ | ||
| 1759 | struct stat st; | ||
| 1760 | if (stat(settings.nixStore.c_str(), &st) == -1) | ||
| 1761 | throw SysError(format("cannot stat `%1%'") % settings.nixStore); | ||
| 1762 | if (!(st.st_mode & S_ISVTX) || | ||
| 1763 | ((st.st_mode & S_IRWXG) != S_IRWXG) || | ||
| 1764 | (st.st_gid != buildUser.getGID())) | ||
| 1765 | throw Error(format( | ||
| 1766 | "builder does not have write permission to `%2%'; " | ||
| 1767 | "try `chgrp %1% %2%; chmod 1775 %2%'") | ||
| 1768 | % buildUser.getGID() % settings.nixStore); | ||
| 1769 | } | ||
| 1770 | |||
| 1771 | |||
| 1772 | /* Are we doing a chroot build? Note that fixed-output | ||
| 1773 | derivations are never done in a chroot, mainly so that | ||
| 1774 | functions like fetchurl (which needs a proper /etc/resolv.conf) | ||
| 1775 | work properly. Purity checking for fixed-output derivations | ||
| 1776 | is somewhat pointless anyway. */ | ||
| 1777 | useChroot = settings.useChroot; | 1755 | useChroot = settings.useChroot; |
| 1778 | 1756 | ||
| 1779 | if (fixedOutput) useChroot = false; | ||
| 1780 | |||
| 1781 | /* Hack to allow derivations to disable chroot builds. */ | ||
| 1782 | if (get(drv.env, "__noChroot") == "1") useChroot = false; | ||
| 1783 | |||
| 1784 | if (useChroot) { | 1757 | if (useChroot) { |
| 1785 | #if CHROOT_ENABLED | 1758 | #if CHROOT_ENABLED |
| 1786 | /* Create a temporary directory in which we set up the chroot | 1759 | /* Create a temporary directory in which we set up the chroot |
| @@ -1795,6 +1768,12 @@ void DerivationGoal::startBuilder() | |||
| 1795 | 1768 | ||
| 1796 | printMsg(lvlChatty, format("setting up chroot environment in `%1%'") % chrootRootDir); | 1769 | printMsg(lvlChatty, format("setting up chroot environment in `%1%'") % chrootRootDir); |
| 1797 | 1770 | ||
| 1771 | if (mkdir(chrootRootDir.c_str(), 0750) == -1) | ||
| 1772 | throw SysError(format("cannot create ‘%1%’") % chrootRootDir); | ||
| 1773 | |||
| 1774 | if (chown(chrootRootDir.c_str(), 0, buildUser.getGID()) == -1) | ||
| 1775 | throw SysError(format("cannot change ownership of ‘%1%’") % chrootRootDir); | ||
| 1776 | |||
| 1798 | /* Create a writable /tmp in the chroot. Many builders need | 1777 | /* Create a writable /tmp in the chroot. Many builders need |
| 1799 | this. (Of course they should really respect $TMPDIR | 1778 | this. (Of course they should really respect $TMPDIR |
| 1800 | instead.) */ | 1779 | instead.) */ |
| @@ -1821,16 +1800,20 @@ void DerivationGoal::startBuilder() | |||
| 1821 | % (buildUser.enabled() ? buildUser.getGID() : getgid())).str()); | 1800 | % (buildUser.enabled() ? buildUser.getGID() : getgid())).str()); |
| 1822 | 1801 | ||
| 1823 | /* Create /etc/hosts with localhost entry. */ | 1802 | /* Create /etc/hosts with localhost entry. */ |
| 1824 | writeFile(chrootRootDir + "/etc/hosts", "127.0.0.1 localhost\n"); | 1803 | if (!fixedOutput) |
| 1804 | writeFile(chrootRootDir + "/etc/hosts", "127.0.0.1 localhost\n"); | ||
| 1825 | 1805 | ||
| 1826 | /* Bind-mount a user-configurable set of directories from the | 1806 | /* Bind-mount a user-configurable set of directories from the |
| 1827 | host file system. */ | 1807 | host file system. */ |
| 1828 | foreach (StringSet::iterator, i, settings.dirsInChroot) { | 1808 | PathSet dirs = tokenizeString<StringSet>(settings.get("build-chroot-dirs", string(DEFAULT_CHROOT_DIRS))); |
| 1829 | size_t p = i->find('='); | 1809 | PathSet dirs2 = tokenizeString<StringSet>(settings.get("build-extra-chroot-dirs", string(""))); |
| 1810 | dirs.insert(dirs2.begin(), dirs2.end()); | ||
| 1811 | for (auto & i : dirs) { | ||
| 1812 | size_t p = i.find('='); | ||
| 1830 | if (p == string::npos) | 1813 | if (p == string::npos) |
| 1831 | dirsInChroot[*i] = *i; | 1814 | dirsInChroot[i] = i; |
| 1832 | else | 1815 | else |
| 1833 | dirsInChroot[string(*i, 0, p)] = string(*i, p + 1); | 1816 | dirsInChroot[string(i, 0, p)] = string(i, p + 1); |
| 1834 | } | 1817 | } |
| 1835 | dirsInChroot[tmpDir] = tmpDir; | 1818 | dirsInChroot[tmpDir] = tmpDir; |
| 1836 | 1819 | ||
| @@ -1841,8 +1824,12 @@ void DerivationGoal::startBuilder() | |||
| 1841 | can be bind-mounted). !!! As an extra security | 1824 | can be bind-mounted). !!! As an extra security |
| 1842 | precaution, make the fake Nix store only writable by the | 1825 | precaution, make the fake Nix store only writable by the |
| 1843 | build user. */ | 1826 | build user. */ |
| 1844 | createDirs(chrootRootDir + settings.nixStore); | 1827 | Path chrootStoreDir = chrootRootDir + settings.nixStore; |
| 1845 | chmod_(chrootRootDir + settings.nixStore, 01777); | 1828 | createDirs(chrootStoreDir); |
| 1829 | chmod_(chrootStoreDir, 01775); | ||
| 1830 | |||
| 1831 | if (chown(chrootStoreDir.c_str(), 0, buildUser.getGID()) == -1) | ||
| 1832 | throw SysError(format("cannot change ownership of ‘%1%’") % chrootStoreDir); | ||
| 1846 | 1833 | ||
| 1847 | foreach (PathSet::iterator, i, inputPaths) { | 1834 | foreach (PathSet::iterator, i, inputPaths) { |
| 1848 | struct stat st; | 1835 | struct stat st; |
| @@ -1951,14 +1938,17 @@ void DerivationGoal::startBuilder() | |||
| 1951 | */ | 1938 | */ |
| 1952 | #if CHROOT_ENABLED | 1939 | #if CHROOT_ENABLED |
| 1953 | if (useChroot) { | 1940 | if (useChroot) { |
| 1954 | char stack[32 * 1024]; | 1941 | char stack[32 * 1024]; |
| 1955 | pid = clone(childEntry, stack + sizeof(stack) - 8, | 1942 | int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | CLONE_NEWUTS | SIGCHLD; |
| 1956 | CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWNET | CLONE_NEWIPC | CLONE_NEWUTS | SIGCHLD, this); | 1943 | if (!fixedOutput) flags |= CLONE_NEWNET; |
| 1944 | pid = clone(childEntry, stack + sizeof(stack) - 8, flags, this); | ||
| 1945 | if (pid == -1) | ||
| 1946 | throw SysError("cloning builder process"); | ||
| 1957 | } else | 1947 | } else |
| 1958 | #endif | 1948 | #endif |
| 1959 | { | 1949 | { |
| 1960 | pid = fork(); | 1950 | pid = fork(); |
| 1961 | if (pid == 0) initChild(); | 1951 | if (pid == 0) runChild(); |
| 1962 | } | 1952 | } |
| 1963 | 1953 | ||
| 1964 | if (pid == -1) throw SysError("unable to fork"); | 1954 | if (pid == -1) throw SysError("unable to fork"); |
| @@ -1969,22 +1959,31 @@ void DerivationGoal::startBuilder() | |||
| 1969 | worker.childStarted(shared_from_this(), pid, | 1959 | worker.childStarted(shared_from_this(), pid, |
| 1970 | singleton<set<int> >(builderOut.readSide), true, true); | 1960 | singleton<set<int> >(builderOut.readSide), true, true); |
| 1971 | 1961 | ||
| 1962 | /* Check if setting up the build environment failed. */ | ||
| 1963 | string msg = readLine(builderOut.readSide); | ||
| 1964 | if (!msg.empty()) throw Error(msg); | ||
| 1965 | |||
| 1972 | if (settings.printBuildTrace) { | 1966 | if (settings.printBuildTrace) { |
| 1973 | printMsg(lvlError, format("@ build-started %1% - %2% %3%") | 1967 | printMsg(lvlError, format("@ build-started %1% - %2% %3%") |
| 1974 | % drvPath % drv.platform % logFile); | 1968 | % drvPath % drv.platform % logFile); |
| 1975 | } | 1969 | } |
| 1970 | |||
| 1976 | } | 1971 | } |
| 1977 | 1972 | ||
| 1978 | 1973 | ||
| 1979 | void DerivationGoal::initChild() | 1974 | void DerivationGoal::runChild() |
| 1980 | { | 1975 | { |
| 1981 | /* Warning: in the child we should absolutely not make any SQLite | 1976 | /* Warning: in the child we should absolutely not make any SQLite |
| 1982 | calls! */ | 1977 | calls! */ |
| 1983 | 1978 | ||
| 1984 | bool inSetup = true; | ||
| 1985 | |||
| 1986 | try { /* child */ | 1979 | try { /* child */ |
| 1987 | 1980 | ||
| 1981 | _writeToStderr = 0; | ||
| 1982 | |||
| 1983 | restoreAffinity(); | ||
| 1984 | |||
| 1985 | commonChildInit(builderOut); | ||
| 1986 | |||
| 1988 | #if CHROOT_ENABLED | 1987 | #if CHROOT_ENABLED |
| 1989 | if (useChroot) { | 1988 | if (useChroot) { |
| 1990 | /* Initialise the loopback interface. */ | 1989 | /* Initialise the loopback interface. */ |
| @@ -2001,9 +2000,11 @@ void DerivationGoal::initChild() | |||
| 2001 | 2000 | ||
| 2002 | /* Set the hostname etc. to fixed values. */ | 2001 | /* Set the hostname etc. to fixed values. */ |
| 2003 | char hostname[] = "localhost"; | 2002 | char hostname[] = "localhost"; |
| 2004 | sethostname(hostname, sizeof(hostname)); | 2003 | if (sethostname(hostname, sizeof(hostname)) == -1) |
| 2004 | throw SysError("cannot set host name"); | ||
| 2005 | char domainname[] = "(none)"; // kernel default | 2005 | char domainname[] = "(none)"; // kernel default |
| 2006 | setdomainname(domainname, sizeof(domainname)); | 2006 | if (setdomainname(domainname, sizeof(domainname)) == -1) |
| 2007 | throw SysError("cannot set domain name"); | ||
| 2007 | 2008 | ||
| 2008 | /* Make all filesystems private. This is necessary | 2009 | /* Make all filesystems private. This is necessary |
| 2009 | because subtrees may have been mounted as "shared" | 2010 | because subtrees may have been mounted as "shared" |
| @@ -2021,12 +2022,17 @@ void DerivationGoal::initChild() | |||
| 2021 | throw SysError(format("unable to make filesystem `%1%' private") % fs); | 2022 | throw SysError(format("unable to make filesystem `%1%' private") % fs); |
| 2022 | } | 2023 | } |
| 2023 | 2024 | ||
| 2025 | /* Bind-mount chroot directory to itself, to treat it as a | ||
| 2026 | different filesystem from /, as needed for pivot_root. */ | ||
| 2027 | if (mount(chrootRootDir.c_str(), chrootRootDir.c_str(), 0, MS_BIND, 0) == -1) | ||
| 2028 | throw SysError(format("unable to bind mount ‘%1%’") % chrootRootDir); | ||
| 2029 | |||
| 2024 | /* Set up a nearly empty /dev, unless the user asked to | 2030 | /* Set up a nearly empty /dev, unless the user asked to |
| 2025 | bind-mount the host /dev. */ | 2031 | bind-mount the host /dev. */ |
| 2032 | Strings ss; | ||
| 2026 | if (dirsInChroot.find("/dev") == dirsInChroot.end()) { | 2033 | if (dirsInChroot.find("/dev") == dirsInChroot.end()) { |
| 2027 | createDirs(chrootRootDir + "/dev/shm"); | 2034 | createDirs(chrootRootDir + "/dev/shm"); |
| 2028 | createDirs(chrootRootDir + "/dev/pts"); | 2035 | createDirs(chrootRootDir + "/dev/pts"); |
| 2029 | Strings ss; | ||
| 2030 | ss.push_back("/dev/full"); | 2036 | ss.push_back("/dev/full"); |
| 2031 | #ifdef __linux__ | 2037 | #ifdef __linux__ |
| 2032 | if (pathExists("/dev/kvm")) | 2038 | if (pathExists("/dev/kvm")) |
| @@ -2037,13 +2043,24 @@ void DerivationGoal::initChild() | |||
| 2037 | ss.push_back("/dev/tty"); | 2043 | ss.push_back("/dev/tty"); |
| 2038 | ss.push_back("/dev/urandom"); | 2044 | ss.push_back("/dev/urandom"); |
| 2039 | ss.push_back("/dev/zero"); | 2045 | ss.push_back("/dev/zero"); |
| 2040 | foreach (Strings::iterator, i, ss) dirsInChroot[*i] = *i; | ||
| 2041 | createSymlink("/proc/self/fd", chrootRootDir + "/dev/fd"); | 2046 | createSymlink("/proc/self/fd", chrootRootDir + "/dev/fd"); |
| 2042 | createSymlink("/proc/self/fd/0", chrootRootDir + "/dev/stdin"); | 2047 | createSymlink("/proc/self/fd/0", chrootRootDir + "/dev/stdin"); |
| 2043 | createSymlink("/proc/self/fd/1", chrootRootDir + "/dev/stdout"); | 2048 | createSymlink("/proc/self/fd/1", chrootRootDir + "/dev/stdout"); |
| 2044 | createSymlink("/proc/self/fd/2", chrootRootDir + "/dev/stderr"); | 2049 | createSymlink("/proc/self/fd/2", chrootRootDir + "/dev/stderr"); |
| 2045 | } | 2050 | } |
| 2046 | 2051 | ||
| 2052 | /* Fixed-output derivations typically need to access the | ||
| 2053 | network, so give them access to /etc/resolv.conf and so | ||
| 2054 | on. */ | ||
| 2055 | if (fixedOutput) { | ||
| 2056 | ss.push_back("/etc/resolv.conf"); | ||
| 2057 | ss.push_back("/etc/nsswitch.conf"); | ||
| 2058 | ss.push_back("/etc/services"); | ||
| 2059 | ss.push_back("/etc/hosts"); | ||
| 2060 | } | ||
| 2061 | |||
| 2062 | for (auto & i : ss) dirsInChroot[i] = i; | ||
| 2063 | |||
| 2047 | /* Bind-mount all the directories from the "host" | 2064 | /* Bind-mount all the directories from the "host" |
| 2048 | filesystem that we want in the chroot | 2065 | filesystem that we want in the chroot |
| 2049 | environment. */ | 2066 | environment. */ |
| @@ -2088,30 +2105,41 @@ void DerivationGoal::initChild() | |||
| 2088 | throw SysError("mounting /dev/pts"); | 2105 | throw SysError("mounting /dev/pts"); |
| 2089 | createSymlink("/dev/pts/ptmx", chrootRootDir + "/dev/ptmx"); | 2106 | createSymlink("/dev/pts/ptmx", chrootRootDir + "/dev/ptmx"); |
| 2090 | 2107 | ||
| 2091 | /* Make sure /dev/pts/ptmx is world-writable. With some | 2108 | /* Make sure /dev/pts/ptmx is world-writable. With some |
| 2092 | Linux versions, it is created with permissions 0. */ | 2109 | Linux versions, it is created with permissions 0. */ |
| 2093 | chmod_(chrootRootDir + "/dev/pts/ptmx", 0666); | 2110 | chmod_(chrootRootDir + "/dev/pts/ptmx", 0666); |
| 2094 | } | 2111 | } |
| 2095 | 2112 | ||
| 2096 | /* Do the chroot(). Below we do a chdir() to the | 2113 | /* Do the chroot(). */ |
| 2097 | temporary build directory to make sure the current | 2114 | if (chdir(chrootRootDir.c_str()) == -1) |
| 2098 | directory is in the chroot. (Actually the order | 2115 | throw SysError(format("cannot change directory to '%1%'") % chrootRootDir); |
| 2099 | doesn't matter, since due to the bind mount tmpDir and | 2116 | |
| 2100 | tmpRootDit/tmpDir are the same directories.) */ | 2117 | if (mkdir("real-root", 0) == -1) |
| 2101 | if (chroot(chrootRootDir.c_str()) == -1) | 2118 | throw SysError("cannot create real-root directory"); |
| 2102 | throw SysError(format("cannot change root directory to `%1%'") % chrootRootDir); | 2119 | |
| 2120 | #define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, new_root, put_old)) | ||
| 2121 | if (pivot_root(".", "real-root") == -1) | ||
| 2122 | throw SysError(format("cannot pivot old root directory onto '%1%'") % (chrootRootDir + "/real-root")); | ||
| 2123 | #undef pivot_root | ||
| 2124 | |||
| 2125 | if (chroot(".") == -1) | ||
| 2126 | throw SysError(format("cannot change root directory to '%1%'") % chrootRootDir); | ||
| 2127 | |||
| 2128 | if (umount2("real-root", MNT_DETACH) == -1) | ||
| 2129 | throw SysError("cannot unmount real root filesystem"); | ||
| 2130 | |||
| 2131 | if (rmdir("real-root") == -1) | ||
| 2132 | throw SysError("cannot remove real-root directory"); | ||
| 2103 | } | 2133 | } |
| 2104 | #endif | 2134 | #endif |
| 2105 | 2135 | ||
| 2106 | commonChildInit(builderOut); | ||
| 2107 | |||
| 2108 | if (chdir(tmpDir.c_str()) == -1) | 2136 | if (chdir(tmpDir.c_str()) == -1) |
| 2109 | throw SysError(format("changing into `%1%'") % tmpDir); | 2137 | throw SysError(format("changing into `%1%'") % tmpDir); |
| 2110 | 2138 | ||
| 2111 | /* Close all other file descriptors. */ | 2139 | /* Close all other file descriptors. */ |
| 2112 | closeMostFDs(set<int>()); | 2140 | closeMostFDs(set<int>()); |
| 2113 | 2141 | ||
| 2114 | #ifdef CAN_DO_LINUX32_BUILDS | 2142 | #if __linux__ |
| 2115 | /* Change the personality to 32-bit if we're doing an | 2143 | /* Change the personality to 32-bit if we're doing an |
| 2116 | i686-linux build on an x86_64-linux machine. */ | 2144 | i686-linux build on an x86_64-linux machine. */ |
| 2117 | struct utsname utsbuf; | 2145 | struct utsname utsbuf; |
| @@ -2119,7 +2147,7 @@ void DerivationGoal::initChild() | |||
| 2119 | if (drv.platform == "i686-linux" && | 2147 | if (drv.platform == "i686-linux" && |
| 2120 | (settings.thisSystem == "x86_64-linux" || | 2148 | (settings.thisSystem == "x86_64-linux" || |
| 2121 | (!strcmp(utsbuf.sysname, "Linux") && !strcmp(utsbuf.machine, "x86_64")))) { | 2149 | (!strcmp(utsbuf.sysname, "Linux") && !strcmp(utsbuf.machine, "x86_64")))) { |
| 2122 | if (personality(0x0008 | 0x8000000 /* == PER_LINUX32_3GB */) == -1) | 2150 | if (personality(PER_LINUX32) == -1) |
| 2123 | throw SysError("cannot set i686-linux personality"); | 2151 | throw SysError("cannot set i686-linux personality"); |
| 2124 | } | 2152 | } |
| 2125 | 2153 | ||
| @@ -2129,17 +2157,18 @@ void DerivationGoal::initChild() | |||
| 2129 | int cur = personality(0xffffffff); | 2157 | int cur = personality(0xffffffff); |
| 2130 | if (cur != -1) personality(cur | 0x0020000 /* == UNAME26 */); | 2158 | if (cur != -1) personality(cur | 0x0020000 /* == UNAME26 */); |
| 2131 | } | 2159 | } |
| 2160 | |||
| 2161 | /* Disable address space randomization for improved | ||
| 2162 | determinism. */ | ||
| 2163 | int cur = personality(0xffffffff); | ||
| 2164 | if (cur != -1) personality(cur | ADDR_NO_RANDOMIZE); | ||
| 2132 | #endif | 2165 | #endif |
| 2133 | 2166 | ||
| 2134 | /* Fill in the environment. */ | 2167 | /* Fill in the environment. */ |
| 2135 | Strings envStrs; | 2168 | Strings envStrs; |
| 2136 | foreach (Environment::const_iterator, i, env) | 2169 | foreach (Environment::const_iterator, i, env) |
| 2137 | envStrs.push_back(rewriteHashes(i->first + "=" + i->second, rewritesToTmp)); | 2170 | envStrs.push_back(rewriteHashes(i->first + "=" + i->second, rewritesToTmp)); |
| 2138 | const char * * envArr = strings2CharPtrs(envStrs); | 2171 | auto envArr = stringsToCharPtrs(envStrs); |
| 2139 | |||
| 2140 | Path program = drv.builder.c_str(); | ||
| 2141 | std::vector<const char *> args; /* careful with c_str()! */ | ||
| 2142 | string user; /* must be here for its c_str()! */ | ||
| 2143 | 2172 | ||
| 2144 | /* If we are running in `build-users' mode, then switch to the | 2173 | /* If we are running in `build-users' mode, then switch to the |
| 2145 | user we allocated above. Make sure that we drop all root | 2174 | user we allocated above. Make sure that we drop all root |
| @@ -2165,23 +2194,26 @@ void DerivationGoal::initChild() | |||
| 2165 | } | 2194 | } |
| 2166 | 2195 | ||
| 2167 | /* Fill in the arguments. */ | 2196 | /* Fill in the arguments. */ |
| 2197 | Strings args; | ||
| 2168 | string builderBasename = baseNameOf(drv.builder); | 2198 | string builderBasename = baseNameOf(drv.builder); |
| 2169 | args.push_back(builderBasename.c_str()); | 2199 | args.push_back(builderBasename); |
| 2170 | foreach (Strings::iterator, i, drv.args) | 2200 | foreach (Strings::iterator, i, drv.args) |
| 2171 | args.push_back(rewriteHashes(*i, rewritesToTmp).c_str()); | 2201 | args.push_back(rewriteHashes(*i, rewritesToTmp)); |
| 2172 | args.push_back(0); | 2202 | auto argArr = stringsToCharPtrs(args); |
| 2173 | 2203 | ||
| 2174 | restoreSIGPIPE(); | 2204 | restoreSIGPIPE(); |
| 2175 | 2205 | ||
| 2206 | /* Indicate that we managed to set up the build environment. */ | ||
| 2207 | writeFull(STDERR_FILENO, "\n"); | ||
| 2208 | |||
| 2176 | /* Execute the program. This should not return. */ | 2209 | /* Execute the program. This should not return. */ |
| 2177 | inSetup = false; | 2210 | execve(drv.builder.c_str(), (char * *) &argArr[0], (char * *) &envArr[0]); |
| 2178 | execve(program.c_str(), (char * *) &args[0], (char * *) envArr); | ||
| 2179 | 2211 | ||
| 2180 | throw SysError(format("executing `%1%'") % drv.builder); | 2212 | throw SysError(format("executing `%1%'") % drv.builder); |
| 2181 | 2213 | ||
| 2182 | } catch (std::exception & e) { | 2214 | } catch (std::exception & e) { |
| 2183 | writeToStderr("build error: " + string(e.what()) + "\n"); | 2215 | writeFull(STDERR_FILENO, "while setting up the build environment: " + string(e.what()) + "\n"); |
| 2184 | _exit(inSetup ? childSetupFailed : 1); | 2216 | _exit(1); |
| 2185 | } | 2217 | } |
| 2186 | 2218 | ||
| 2187 | abort(); /* never reached */ | 2219 | abort(); /* never reached */ |
| @@ -2333,7 +2365,7 @@ void DerivationGoal::registerOutputs() | |||
| 2333 | if (buildMode == bmCheck) { | 2365 | if (buildMode == bmCheck) { |
| 2334 | ValidPathInfo info = worker.store.queryPathInfo(path); | 2366 | ValidPathInfo info = worker.store.queryPathInfo(path); |
| 2335 | if (hash.first != info.hash) | 2367 | if (hash.first != info.hash) |
| 2336 | throw Error(format("derivation `%2%' may not be deterministic: hash mismatch in output `%1%'") % drvPath % path); | 2368 | throw Error(format("derivation `%1%' may not be deterministic: hash mismatch in output `%2%'") % drvPath % path); |
| 2337 | continue; | 2369 | continue; |
| 2338 | } | 2370 | } |
| 2339 | 2371 | ||
| @@ -2347,16 +2379,36 @@ void DerivationGoal::registerOutputs() | |||
| 2347 | debug(format("referenced input: `%1%'") % *i); | 2379 | debug(format("referenced input: `%1%'") % *i); |
| 2348 | } | 2380 | } |
| 2349 | 2381 | ||
| 2350 | /* If the derivation specifies an `allowedReferences' | 2382 | /* Enforce `allowedReferences' and friends. */ |
| 2351 | attribute (containing a list of paths that the output may | 2383 | auto checkRefs = [&](const string & attrName, bool allowed, bool recursive) { |
| 2352 | refer to), check that all references are in that list. !!! | 2384 | if (drv.env.find(attrName) == drv.env.end()) return; |
| 2353 | allowedReferences should really be per-output. */ | 2385 | |
| 2354 | if (drv.env.find("allowedReferences") != drv.env.end()) { | 2386 | PathSet spec = parseReferenceSpecifiers(drv, get(drv.env, attrName)); |
| 2355 | PathSet allowed = parseReferenceSpecifiers(drv, get(drv.env, "allowedReferences")); | 2387 | |
| 2356 | foreach (PathSet::iterator, i, references) | 2388 | PathSet used; |
| 2357 | if (allowed.find(*i) == allowed.end()) | 2389 | if (recursive) { |
| 2358 | throw BuildError(format("output is not allowed to refer to path `%1%'") % *i); | 2390 | /* Our requisites are the union of the closures of our references. */ |
| 2359 | } | 2391 | for (auto & i : references) |
| 2392 | /* Don't call computeFSClosure on ourselves. */ | ||
| 2393 | if (actualPath != i) | ||
| 2394 | computeFSClosure(worker.store, i, used); | ||
| 2395 | } else | ||
| 2396 | used = references; | ||
| 2397 | |||
| 2398 | for (auto & i : used) | ||
| 2399 | if (allowed) { | ||
| 2400 | if (spec.find(i) == spec.end()) | ||
| 2401 | throw BuildError(format("output (`%1%') is not allowed to refer to path `%2%'") % actualPath % i); | ||
| 2402 | } else { | ||
| 2403 | if (spec.find(i) != spec.end()) | ||
| 2404 | throw BuildError(format("output (`%1%') is not allowed to refer to path `%2%'") % actualPath % i); | ||
| 2405 | } | ||
| 2406 | }; | ||
| 2407 | |||
| 2408 | checkRefs("allowedReferences", true, false); | ||
| 2409 | checkRefs("allowedRequisites", true, true); | ||
| 2410 | checkRefs("disallowedReferences", false, false); | ||
| 2411 | checkRefs("disallowedRequisites", false, true); | ||
| 2360 | 2412 | ||
| 2361 | worker.store.optimisePath(path); // FIXME: combine with scanForReferences() | 2413 | worker.store.optimisePath(path); // FIXME: combine with scanForReferences() |
| 2362 | 2414 | ||
| @@ -2475,7 +2527,7 @@ void DerivationGoal::handleChildOutput(int fd, const string & data) | |||
| 2475 | BZ2_bzWrite(&err, bzLogFile, (unsigned char *) data.data(), data.size()); | 2527 | BZ2_bzWrite(&err, bzLogFile, (unsigned char *) data.data(), data.size()); |
| 2476 | if (err != BZ_OK) throw Error(format("cannot write to compressed log file (BZip2 error = %1%)") % err); | 2528 | if (err != BZ_OK) throw Error(format("cannot write to compressed log file (BZip2 error = %1%)") % err); |
| 2477 | } else if (fdLogFile != -1) | 2529 | } else if (fdLogFile != -1) |
| 2478 | writeFull(fdLogFile, (unsigned char *) data.data(), data.size()); | 2530 | writeFull(fdLogFile, data); |
| 2479 | } | 2531 | } |
| 2480 | 2532 | ||
| 2481 | if (hook && fd == hook->fromHook.readSide) | 2533 | if (hook && fd == hook->fromHook.readSide) |
| @@ -2586,6 +2638,13 @@ public: | |||
| 2586 | 2638 | ||
| 2587 | void cancel(bool timeout); | 2639 | void cancel(bool timeout); |
| 2588 | 2640 | ||
| 2641 | string key() | ||
| 2642 | { | ||
| 2643 | /* "a$" ensures substitution goals happen before derivation | ||
| 2644 | goals. */ | ||
| 2645 | return "a$" + storePathToName(storePath) + "$" + storePath; | ||
| 2646 | } | ||
| 2647 | |||
| 2589 | void work(); | 2648 | void work(); |
| 2590 | 2649 | ||
| 2591 | /* The states. */ | 2650 | /* The states. */ |
| @@ -2778,35 +2837,21 @@ void SubstitutionGoal::tryToRun() | |||
| 2778 | args.push_back("--substitute"); | 2837 | args.push_back("--substitute"); |
| 2779 | args.push_back(storePath); | 2838 | args.push_back(storePath); |
| 2780 | args.push_back(destPath); | 2839 | args.push_back(destPath); |
| 2781 | const char * * argArr = strings2CharPtrs(args); | 2840 | auto argArr = stringsToCharPtrs(args); |
| 2782 | 2841 | ||
| 2783 | /* Fork the substitute program. */ | 2842 | /* Fork the substitute program. */ |
| 2784 | pid = maybeVfork(); | 2843 | pid = startProcess([&]() { |
| 2785 | |||
| 2786 | switch (pid) { | ||
| 2787 | 2844 | ||
| 2788 | case -1: | 2845 | commonChildInit(logPipe); |
| 2789 | throw SysError("unable to fork"); | ||
| 2790 | 2846 | ||
| 2791 | case 0: | 2847 | if (dup2(outPipe.writeSide, STDOUT_FILENO) == -1) |
| 2792 | try { /* child */ | 2848 | throw SysError("cannot dup output pipe into stdout"); |
| 2793 | 2849 | ||
| 2794 | commonChildInit(logPipe); | 2850 | execv(sub.c_str(), (char * *) &argArr[0]); |
| 2795 | 2851 | ||
| 2796 | if (dup2(outPipe.writeSide, STDOUT_FILENO) == -1) | 2852 | throw SysError(format("executing `%1%'") % sub); |
| 2797 | throw SysError("cannot dup output pipe into stdout"); | 2853 | }); |
| 2798 | 2854 | ||
| 2799 | execv(sub.c_str(), (char * *) argArr); | ||
| 2800 | |||
| 2801 | throw SysError(format("executing `%1%'") % sub); | ||
| 2802 | |||
| 2803 | } catch (std::exception & e) { | ||
| 2804 | writeToStderr("substitute error: " + string(e.what()) + "\n"); | ||
| 2805 | } | ||
| 2806 | _exit(1); | ||
| 2807 | } | ||
| 2808 | |||
| 2809 | /* parent */ | ||
| 2810 | pid.setSeparatePG(true); | 2855 | pid.setSeparatePG(true); |
| 2811 | pid.setKillSignal(SIGTERM); | 2856 | pid.setKillSignal(SIGTERM); |
| 2812 | outPipe.writeSide.close(); | 2857 | outPipe.writeSide.close(); |
| @@ -2944,6 +2989,7 @@ Worker::Worker(LocalStore & store) | |||
| 2944 | nrLocalBuilds = 0; | 2989 | nrLocalBuilds = 0; |
| 2945 | lastWokenUp = 0; | 2990 | lastWokenUp = 0; |
| 2946 | permanentFailure = false; | 2991 | permanentFailure = false; |
| 2992 | timedOut = false; | ||
| 2947 | } | 2993 | } |
| 2948 | 2994 | ||
| 2949 | 2995 | ||
| @@ -3109,15 +3155,19 @@ void Worker::run(const Goals & _topGoals) | |||
| 3109 | 3155 | ||
| 3110 | checkInterrupt(); | 3156 | checkInterrupt(); |
| 3111 | 3157 | ||
| 3112 | /* Call every wake goal. */ | 3158 | /* Call every wake goal (in the ordering established by |
| 3159 | CompareGoalPtrs). */ | ||
| 3113 | while (!awake.empty() && !topGoals.empty()) { | 3160 | while (!awake.empty() && !topGoals.empty()) { |
| 3114 | WeakGoals awake2(awake); | 3161 | Goals awake2; |
| 3162 | for (auto & i : awake) { | ||
| 3163 | GoalPtr goal = i.lock(); | ||
| 3164 | if (goal) awake2.insert(goal); | ||
| 3165 | } | ||
| 3115 | awake.clear(); | 3166 | awake.clear(); |
| 3116 | foreach (WeakGoals::iterator, i, awake2) { | 3167 | for (auto & goal : awake2) { |
| 3117 | checkInterrupt(); | 3168 | checkInterrupt(); |
| 3118 | GoalPtr goal = i->lock(); | 3169 | goal->work(); |
| 3119 | if (goal) goal->work(); | 3170 | if (topGoals.empty()) break; // stuff may have been cancelled |
| 3120 | if (topGoals.empty()) break; | ||
| 3121 | } | 3171 | } |
| 3122 | } | 3172 | } |
| 3123 | 3173 | ||
| @@ -3255,6 +3305,7 @@ void Worker::waitForInput() | |||
| 3255 | format("%1% timed out after %2% seconds of silence") | 3305 | format("%1% timed out after %2% seconds of silence") |
| 3256 | % goal->getName() % settings.maxSilentTime); | 3306 | % goal->getName() % settings.maxSilentTime); |
| 3257 | goal->cancel(true); | 3307 | goal->cancel(true); |
| 3308 | timedOut = true; | ||
| 3258 | } | 3309 | } |
| 3259 | 3310 | ||
| 3260 | else if (goal->getExitCode() == Goal::ecBusy && | 3311 | else if (goal->getExitCode() == Goal::ecBusy && |
| @@ -3266,6 +3317,7 @@ void Worker::waitForInput() | |||
| 3266 | format("%1% timed out after %2% seconds") | 3317 | format("%1% timed out after %2% seconds") |
| 3267 | % goal->getName() % settings.buildTimeout); | 3318 | % goal->getName() % settings.buildTimeout); |
| 3268 | goal->cancel(true); | 3319 | goal->cancel(true); |
| 3320 | timedOut = true; | ||
| 3269 | } | 3321 | } |
| 3270 | } | 3322 | } |
| 3271 | 3323 | ||
| @@ -3282,7 +3334,7 @@ void Worker::waitForInput() | |||
| 3282 | 3334 | ||
| 3283 | unsigned int Worker::exitStatus() | 3335 | unsigned int Worker::exitStatus() |
| 3284 | { | 3336 | { |
| 3285 | return permanentFailure ? 100 : 1; | 3337 | return timedOut ? 101 : (permanentFailure ? 100 : 1); |
| 3286 | } | 3338 | } |
| 3287 | 3339 | ||
| 3288 | 3340 | ||
diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc index f90edac1cda..34768324c26 100644 --- a/nix/libstore/gc.cc +++ b/nix/libstore/gc.cc | |||
| @@ -96,7 +96,7 @@ Path addPermRoot(StoreAPI & store, const Path & _storePath, | |||
| 96 | "(are you running nix-build inside the store?)") % gcRoot); | 96 | "(are you running nix-build inside the store?)") % gcRoot); |
| 97 | 97 | ||
| 98 | if (indirect) { | 98 | if (indirect) { |
| 99 | /* Don't clobber the the link if it already exists and doesn't | 99 | /* Don't clobber the link if it already exists and doesn't |
| 100 | point to the Nix store. */ | 100 | point to the Nix store. */ |
| 101 | if (pathExists(gcRoot) && (!isLink(gcRoot) || !isInStore(readLink(gcRoot)))) | 101 | if (pathExists(gcRoot) && (!isLink(gcRoot) || !isInStore(readLink(gcRoot)))) |
| 102 | throw Error(format("cannot create symlink `%1%'; already exists") % gcRoot); | 102 | throw Error(format("cannot create symlink `%1%'; already exists") % gcRoot); |
| @@ -115,7 +115,10 @@ Path addPermRoot(StoreAPI & store, const Path & _storePath, | |||
| 115 | % gcRoot % rootsDir); | 115 | % gcRoot % rootsDir); |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | makeSymlink(gcRoot, storePath); | 118 | if (baseNameOf(gcRoot) == baseNameOf(storePath)) |
| 119 | writeFile(gcRoot, ""); | ||
| 120 | else | ||
| 121 | makeSymlink(gcRoot, storePath); | ||
| 119 | } | 122 | } |
| 120 | 123 | ||
| 121 | /* Check that the root can be found by the garbage collector. | 124 | /* Check that the root can be found by the garbage collector. |
| @@ -142,11 +145,6 @@ Path addPermRoot(StoreAPI & store, const Path & _storePath, | |||
| 142 | } | 145 | } |
| 143 | 146 | ||
| 144 | 147 | ||
| 145 | /* The file to which we write our temporary roots. */ | ||
| 146 | static Path fnTempRoots; | ||
| 147 | static AutoCloseFD fdTempRoots; | ||
| 148 | |||
| 149 | |||
| 150 | void LocalStore::addTempRoot(const Path & path) | 148 | void LocalStore::addTempRoot(const Path & path) |
| 151 | { | 149 | { |
| 152 | /* Create the temporary roots file for this process. */ | 150 | /* Create the temporary roots file for this process. */ |
| @@ -193,7 +191,7 @@ void LocalStore::addTempRoot(const Path & path) | |||
| 193 | lockFile(fdTempRoots, ltWrite, true); | 191 | lockFile(fdTempRoots, ltWrite, true); |
| 194 | 192 | ||
| 195 | string s = path + '\0'; | 193 | string s = path + '\0'; |
| 196 | writeFull(fdTempRoots, (const unsigned char *) s.data(), s.size()); | 194 | writeFull(fdTempRoots, s); |
| 197 | 195 | ||
| 198 | /* Downgrade to a read lock. */ | 196 | /* Downgrade to a read lock. */ |
| 199 | debug(format("downgrading to read lock on `%1%'") % fnTempRoots); | 197 | debug(format("downgrading to read lock on `%1%'") % fnTempRoots); |
| @@ -201,27 +199,6 @@ void LocalStore::addTempRoot(const Path & path) | |||
| 201 | } | 199 | } |
| 202 | 200 | ||
| 203 | 201 | ||
| 204 | void removeTempRoots() | ||
| 205 | { | ||
| 206 | if (fdTempRoots != -1) { | ||
| 207 | fdTempRoots.close(); | ||
| 208 | unlink(fnTempRoots.c_str()); | ||
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 212 | |||
| 213 | /* Automatically clean up the temporary roots file when we exit. */ | ||
| 214 | struct RemoveTempRoots | ||
| 215 | { | ||
| 216 | ~RemoveTempRoots() | ||
| 217 | { | ||
| 218 | removeTempRoots(); | ||
| 219 | } | ||
| 220 | }; | ||
| 221 | |||
| 222 | static RemoveTempRoots autoRemoveTempRoots __attribute__((unused)); | ||
| 223 | |||
| 224 | |||
| 225 | typedef std::shared_ptr<AutoCloseFD> FDPtr; | 202 | typedef std::shared_ptr<AutoCloseFD> FDPtr; |
| 226 | typedef list<FDPtr> FDs; | 203 | typedef list<FDPtr> FDs; |
| 227 | 204 | ||
| @@ -230,11 +207,11 @@ static void readTempRoots(PathSet & tempRoots, FDs & fds) | |||
| 230 | { | 207 | { |
| 231 | /* Read the `temproots' directory for per-process temporary root | 208 | /* Read the `temproots' directory for per-process temporary root |
| 232 | files. */ | 209 | files. */ |
| 233 | Strings tempRootFiles = readDirectory( | 210 | DirEntries tempRootFiles = readDirectory( |
| 234 | (format("%1%/%2%") % settings.nixStateDir % tempRootsDir).str()); | 211 | (format("%1%/%2%") % settings.nixStateDir % tempRootsDir).str()); |
| 235 | 212 | ||
| 236 | foreach (Strings::iterator, i, tempRootFiles) { | 213 | for (auto & i : tempRootFiles) { |
| 237 | Path path = (format("%1%/%2%/%3%") % settings.nixStateDir % tempRootsDir % *i).str(); | 214 | Path path = (format("%1%/%2%/%3%") % settings.nixStateDir % tempRootsDir % i.name).str(); |
| 238 | 215 | ||
| 239 | debug(format("reading temporary root file `%1%'") % path); | 216 | debug(format("reading temporary root file `%1%'") % path); |
| 240 | FDPtr fd(new AutoCloseFD(open(path.c_str(), O_RDWR, 0666))); | 217 | FDPtr fd(new AutoCloseFD(open(path.c_str(), O_RDWR, 0666))); |
| @@ -254,7 +231,7 @@ static void readTempRoots(PathSet & tempRoots, FDs & fds) | |||
| 254 | if (lockFile(*fd, ltWrite, false)) { | 231 | if (lockFile(*fd, ltWrite, false)) { |
| 255 | printMsg(lvlError, format("removing stale temporary roots file `%1%'") % path); | 232 | printMsg(lvlError, format("removing stale temporary roots file `%1%'") % path); |
| 256 | unlink(path.c_str()); | 233 | unlink(path.c_str()); |
| 257 | writeFull(*fd, (const unsigned char *) "d", 1); | 234 | writeFull(*fd, "d"); |
| 258 | continue; | 235 | continue; |
| 259 | } | 236 | } |
| 260 | 237 | ||
| @@ -294,19 +271,19 @@ static void foundRoot(StoreAPI & store, | |||
| 294 | } | 271 | } |
| 295 | 272 | ||
| 296 | 273 | ||
| 297 | static void findRoots(StoreAPI & store, const Path & path, Roots & roots) | 274 | static void findRoots(StoreAPI & store, const Path & path, unsigned char type, Roots & roots) |
| 298 | { | 275 | { |
| 299 | try { | 276 | try { |
| 300 | 277 | ||
| 301 | struct stat st = lstat(path); | 278 | if (type == DT_UNKNOWN) |
| 279 | type = getFileType(path); | ||
| 302 | 280 | ||
| 303 | if (S_ISDIR(st.st_mode)) { | 281 | if (type == DT_DIR) { |
| 304 | Strings names = readDirectory(path); | 282 | for (auto & i : readDirectory(path)) |
| 305 | foreach (Strings::iterator, i, names) | 283 | findRoots(store, path + "/" + i.name, i.type, roots); |
| 306 | findRoots(store, path + "/" + *i, roots); | ||
| 307 | } | 284 | } |
| 308 | 285 | ||
| 309 | else if (S_ISLNK(st.st_mode)) { | 286 | else if (type == DT_LNK) { |
| 310 | Path target = readLink(path); | 287 | Path target = readLink(path); |
| 311 | if (isInStore(target)) | 288 | if (isInStore(target)) |
| 312 | foundRoot(store, path, target, roots); | 289 | foundRoot(store, path, target, roots); |
| @@ -328,6 +305,12 @@ static void findRoots(StoreAPI & store, const Path & path, Roots & roots) | |||
| 328 | } | 305 | } |
| 329 | } | 306 | } |
| 330 | 307 | ||
| 308 | else if (type == DT_REG) { | ||
| 309 | Path storePath = settings.nixStore + "/" + baseNameOf(path); | ||
| 310 | if (store.isValidPath(storePath)) | ||
| 311 | roots[path] = storePath; | ||
| 312 | } | ||
| 313 | |||
| 331 | } | 314 | } |
| 332 | 315 | ||
| 333 | catch (SysError & e) { | 316 | catch (SysError & e) { |
| @@ -345,9 +328,10 @@ Roots LocalStore::findRoots() | |||
| 345 | Roots roots; | 328 | Roots roots; |
| 346 | 329 | ||
| 347 | /* Process direct roots in {gcroots,manifests,profiles}. */ | 330 | /* Process direct roots in {gcroots,manifests,profiles}. */ |
| 348 | nix::findRoots(*this, settings.nixStateDir + "/" + gcRootsDir, roots); | 331 | nix::findRoots(*this, settings.nixStateDir + "/" + gcRootsDir, DT_UNKNOWN, roots); |
| 349 | nix::findRoots(*this, settings.nixStateDir + "/manifests", roots); | 332 | if (pathExists(settings.nixStateDir + "/manifests")) |
| 350 | nix::findRoots(*this, settings.nixStateDir + "/profiles", roots); | 333 | nix::findRoots(*this, settings.nixStateDir + "/manifests", DT_UNKNOWN, roots); |
| 334 | nix::findRoots(*this, settings.nixStateDir + "/profiles", DT_UNKNOWN, roots); | ||
| 351 | 335 | ||
| 352 | return roots; | 336 | return roots; |
| 353 | } | 337 | } |
| @@ -449,7 +433,6 @@ void LocalStore::deletePathRecursive(GCState & state, const Path & path) | |||
| 449 | // if the path was not valid, need to determine the actual | 433 | // if the path was not valid, need to determine the actual |
| 450 | // size. | 434 | // size. |
| 451 | state.bytesInvalidated += size; | 435 | state.bytesInvalidated += size; |
| 452 | // Mac OS X cannot rename directories if they are read-only. | ||
| 453 | if (chmod(path.c_str(), st.st_mode | S_IWUSR) == -1) | 436 | if (chmod(path.c_str(), st.st_mode | S_IWUSR) == -1) |
| 454 | throw SysError(format("making `%1%' writable") % path); | 437 | throw SysError(format("making `%1%' writable") % path); |
| 455 | Path tmp = state.trashDir + "/" + baseNameOf(path); | 438 | Path tmp = state.trashDir + "/" + baseNameOf(path); |
| @@ -649,7 +632,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) | |||
| 649 | 632 | ||
| 650 | /* After this point the set of roots or temporary roots cannot | 633 | /* After this point the set of roots or temporary roots cannot |
| 651 | increase, since we hold locks on everything. So everything | 634 | increase, since we hold locks on everything. So everything |
| 652 | that is not reachable from `roots'. */ | 635 | that is not reachable from `roots' is garbage. */ |
| 653 | 636 | ||
| 654 | if (state.shouldDelete) { | 637 | if (state.shouldDelete) { |
| 655 | if (pathExists(state.trashDir)) deleteGarbage(state, state.trashDir); | 638 | if (pathExists(state.trashDir)) deleteGarbage(state, state.trashDir); |
| @@ -741,7 +724,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) | |||
| 741 | } | 724 | } |
| 742 | 725 | ||
| 743 | /* While we're at it, vacuum the database. */ | 726 | /* While we're at it, vacuum the database. */ |
| 744 | if (options.action == GCOptions::gcDeleteDead) vacuumDB(); | 727 | //if (options.action == GCOptions::gcDeleteDead) vacuumDB(); |
| 745 | } | 728 | } |
| 746 | 729 | ||
| 747 | 730 | ||
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc index 86fa56739c5..bb08a7d0b08 100644 --- a/nix/libstore/globals.cc +++ b/nix/libstore/globals.cc | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | #include "globals.hh" | 3 | #include "globals.hh" |
| 4 | #include "util.hh" | 4 | #include "util.hh" |
| 5 | #include "archive.hh" | ||
| 5 | 6 | ||
| 6 | #include <map> | 7 | #include <map> |
| 7 | #include <algorithm> | 8 | #include <algorithm> |
| @@ -55,6 +56,7 @@ Settings::Settings() | |||
| 55 | envKeepDerivations = false; | 56 | envKeepDerivations = false; |
| 56 | lockCPU = getEnv("NIX_AFFINITY_HACK", "1") == "1"; | 57 | lockCPU = getEnv("NIX_AFFINITY_HACK", "1") == "1"; |
| 57 | showTrace = false; | 58 | showTrace = false; |
| 59 | enableImportNative = false; | ||
| 58 | } | 60 | } |
| 59 | 61 | ||
| 60 | 62 | ||
| @@ -112,35 +114,61 @@ void Settings::set(const string & name, const string & value) | |||
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | 116 | ||
| 117 | string Settings::get(const string & name, const string & def) | ||
| 118 | { | ||
| 119 | auto i = settings.find(name); | ||
| 120 | if (i == settings.end()) return def; | ||
| 121 | return i->second; | ||
| 122 | } | ||
| 123 | |||
| 124 | |||
| 125 | Strings Settings::get(const string & name, const Strings & def) | ||
| 126 | { | ||
| 127 | auto i = settings.find(name); | ||
| 128 | if (i == settings.end()) return def; | ||
| 129 | return tokenizeString<Strings>(i->second); | ||
| 130 | } | ||
| 131 | |||
| 132 | |||
| 133 | bool Settings::get(const string & name, bool def) | ||
| 134 | { | ||
| 135 | bool res = def; | ||
| 136 | _get(res, name); | ||
| 137 | return res; | ||
| 138 | } | ||
| 139 | |||
| 140 | |||
| 115 | void Settings::update() | 141 | void Settings::update() |
| 116 | { | 142 | { |
| 117 | get(tryFallback, "build-fallback"); | 143 | _get(tryFallback, "build-fallback"); |
| 118 | get(maxBuildJobs, "build-max-jobs"); | 144 | _get(maxBuildJobs, "build-max-jobs"); |
| 119 | get(buildCores, "build-cores"); | 145 | _get(buildCores, "build-cores"); |
| 120 | get(thisSystem, "system"); | 146 | _get(thisSystem, "system"); |
| 121 | get(maxSilentTime, "build-max-silent-time"); | 147 | _get(maxSilentTime, "build-max-silent-time"); |
| 122 | get(buildTimeout, "build-timeout"); | 148 | _get(buildTimeout, "build-timeout"); |
| 123 | get(reservedSize, "gc-reserved-space"); | 149 | _get(reservedSize, "gc-reserved-space"); |
| 124 | get(fsyncMetadata, "fsync-metadata"); | 150 | _get(fsyncMetadata, "fsync-metadata"); |
| 125 | get(useSQLiteWAL, "use-sqlite-wal"); | 151 | _get(useSQLiteWAL, "use-sqlite-wal"); |
| 126 | get(syncBeforeRegistering, "sync-before-registering"); | 152 | _get(syncBeforeRegistering, "sync-before-registering"); |
| 127 | get(useSubstitutes, "build-use-substitutes"); | 153 | _get(useSubstitutes, "build-use-substitutes"); |
| 128 | get(buildUsersGroup, "build-users-group"); | 154 | _get(buildUsersGroup, "build-users-group"); |
| 129 | get(useChroot, "build-use-chroot"); | 155 | _get(useChroot, "build-use-chroot"); |
| 130 | get(dirsInChroot, "build-chroot-dirs"); | 156 | _get(impersonateLinux26, "build-impersonate-linux-26"); |
| 131 | get(impersonateLinux26, "build-impersonate-linux-26"); | 157 | _get(keepLog, "build-keep-log"); |
| 132 | get(keepLog, "build-keep-log"); | 158 | _get(compressLog, "build-compress-log"); |
| 133 | get(compressLog, "build-compress-log"); | 159 | _get(maxLogSize, "build-max-log-size"); |
| 134 | get(maxLogSize, "build-max-log-size"); | 160 | _get(cacheFailure, "build-cache-failure"); |
| 135 | get(cacheFailure, "build-cache-failure"); | 161 | _get(pollInterval, "build-poll-interval"); |
| 136 | get(pollInterval, "build-poll-interval"); | 162 | _get(checkRootReachability, "gc-check-reachability"); |
| 137 | get(checkRootReachability, "gc-check-reachability"); | 163 | _get(gcKeepOutputs, "gc-keep-outputs"); |
| 138 | get(gcKeepOutputs, "gc-keep-outputs"); | 164 | _get(gcKeepDerivations, "gc-keep-derivations"); |
| 139 | get(gcKeepDerivations, "gc-keep-derivations"); | 165 | _get(autoOptimiseStore, "auto-optimise-store"); |
| 140 | get(autoOptimiseStore, "auto-optimise-store"); | 166 | _get(envKeepDerivations, "env-keep-derivations"); |
| 141 | get(envKeepDerivations, "env-keep-derivations"); | 167 | _get(sshSubstituterHosts, "ssh-substituter-hosts"); |
| 142 | get(sshSubstituterHosts, "ssh-substituter-hosts"); | 168 | _get(useSshSubstituter, "use-ssh-substituter"); |
| 143 | get(useSshSubstituter, "use-ssh-substituter"); | 169 | _get(logServers, "log-servers"); |
| 170 | _get(enableImportNative, "allow-unsafe-native-code-during-evaluation"); | ||
| 171 | _get(useCaseHack, "use-case-hack"); | ||
| 144 | 172 | ||
| 145 | string subs = getEnv("NIX_SUBSTITUTERS", "default"); | 173 | string subs = getEnv("NIX_SUBSTITUTERS", "default"); |
| 146 | if (subs == "default") { | 174 | if (subs == "default") { |
| @@ -158,7 +186,7 @@ void Settings::update() | |||
| 158 | } | 186 | } |
| 159 | 187 | ||
| 160 | 188 | ||
| 161 | void Settings::get(string & res, const string & name) | 189 | void Settings::_get(string & res, const string & name) |
| 162 | { | 190 | { |
| 163 | SettingsMap::iterator i = settings.find(name); | 191 | SettingsMap::iterator i = settings.find(name); |
| 164 | if (i == settings.end()) return; | 192 | if (i == settings.end()) return; |
| @@ -166,7 +194,7 @@ void Settings::get(string & res, const string & name) | |||
| 166 | } | 194 | } |
| 167 | 195 | ||
| 168 | 196 | ||
| 169 | void Settings::get(bool & res, const string & name) | 197 | void Settings::_get(bool & res, const string & name) |
| 170 | { | 198 | { |
| 171 | SettingsMap::iterator i = settings.find(name); | 199 | SettingsMap::iterator i = settings.find(name); |
| 172 | if (i == settings.end()) return; | 200 | if (i == settings.end()) return; |
| @@ -177,7 +205,7 @@ void Settings::get(bool & res, const string & name) | |||
| 177 | } | 205 | } |
| 178 | 206 | ||
| 179 | 207 | ||
| 180 | void Settings::get(StringSet & res, const string & name) | 208 | void Settings::_get(StringSet & res, const string & name) |
| 181 | { | 209 | { |
| 182 | SettingsMap::iterator i = settings.find(name); | 210 | SettingsMap::iterator i = settings.find(name); |
| 183 | if (i == settings.end()) return; | 211 | if (i == settings.end()) return; |
| @@ -186,7 +214,7 @@ void Settings::get(StringSet & res, const string & name) | |||
| 186 | res.insert(ss.begin(), ss.end()); | 214 | res.insert(ss.begin(), ss.end()); |
| 187 | } | 215 | } |
| 188 | 216 | ||
| 189 | void Settings::get(Strings & res, const string & name) | 217 | void Settings::_get(Strings & res, const string & name) |
| 190 | { | 218 | { |
| 191 | SettingsMap::iterator i = settings.find(name); | 219 | SettingsMap::iterator i = settings.find(name); |
| 192 | if (i == settings.end()) return; | 220 | if (i == settings.end()) return; |
| @@ -194,7 +222,7 @@ void Settings::get(Strings & res, const string & name) | |||
| 194 | } | 222 | } |
| 195 | 223 | ||
| 196 | 224 | ||
| 197 | template<class N> void Settings::get(N & res, const string & name) | 225 | template<class N> void Settings::_get(N & res, const string & name) |
| 198 | { | 226 | { |
| 199 | SettingsMap::iterator i = settings.find(name); | 227 | SettingsMap::iterator i = settings.find(name); |
| 200 | if (i == settings.end()) return; | 228 | if (i == settings.end()) return; |
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh index 711c3652947..c17e10d7c32 100644 --- a/nix/libstore/globals.hh +++ b/nix/libstore/globals.hh | |||
| @@ -21,6 +21,12 @@ struct Settings { | |||
| 21 | 21 | ||
| 22 | void set(const string & name, const string & value); | 22 | void set(const string & name, const string & value); |
| 23 | 23 | ||
| 24 | string get(const string & name, const string & def); | ||
| 25 | |||
| 26 | Strings get(const string & name, const Strings & def); | ||
| 27 | |||
| 28 | bool get(const string & name, bool def); | ||
| 29 | |||
| 24 | void update(); | 30 | void update(); |
| 25 | 31 | ||
| 26 | string pack(); | 32 | string pack(); |
| @@ -142,10 +148,6 @@ struct Settings { | |||
| 142 | /* Whether to build in chroot. */ | 148 | /* Whether to build in chroot. */ |
| 143 | bool useChroot; | 149 | bool useChroot; |
| 144 | 150 | ||
| 145 | /* The directories from the host filesystem to be included in the | ||
| 146 | chroot. */ | ||
| 147 | StringSet dirsInChroot; | ||
| 148 | |||
| 149 | /* Set of ssh connection strings for the ssh substituter */ | 151 | /* Set of ssh connection strings for the ssh substituter */ |
| 150 | Strings sshSubstituterHosts; | 152 | Strings sshSubstituterHosts; |
| 151 | 153 | ||
| @@ -197,14 +199,20 @@ struct Settings { | |||
| 197 | /* Whether to show a stack trace if Nix evaluation fails. */ | 199 | /* Whether to show a stack trace if Nix evaluation fails. */ |
| 198 | bool showTrace; | 200 | bool showTrace; |
| 199 | 201 | ||
| 202 | /* A list of URL prefixes that can return Nix build logs. */ | ||
| 203 | Strings logServers; | ||
| 204 | |||
| 205 | /* Whether the importNative primop should be enabled */ | ||
| 206 | bool enableImportNative; | ||
| 207 | |||
| 200 | private: | 208 | private: |
| 201 | SettingsMap settings, overrides; | 209 | SettingsMap settings, overrides; |
| 202 | 210 | ||
| 203 | void get(string & res, const string & name); | 211 | void _get(string & res, const string & name); |
| 204 | void get(bool & res, const string & name); | 212 | void _get(bool & res, const string & name); |
| 205 | void get(StringSet & res, const string & name); | 213 | void _get(StringSet & res, const string & name); |
| 206 | void get(Strings & res, const string & name); | 214 | void _get(Strings & res, const string & name); |
| 207 | template<class N> void get(N & res, const string & name); | 215 | template<class N> void _get(N & res, const string & name); |
| 208 | }; | 216 | }; |
| 209 | 217 | ||
| 210 | 218 | ||
diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc index 2c3d65215cb..630cb80c413 100644 --- a/nix/libstore/local-store.cc +++ b/nix/libstore/local-store.cc | |||
| @@ -254,22 +254,25 @@ LocalStore::LocalStore(bool reserveSpace) | |||
| 254 | Path perUserDir = profilesDir + "/per-user"; | 254 | Path perUserDir = profilesDir + "/per-user"; |
| 255 | createDirs(perUserDir); | 255 | createDirs(perUserDir); |
| 256 | if (chmod(perUserDir.c_str(), 01777) == -1) | 256 | if (chmod(perUserDir.c_str(), 01777) == -1) |
| 257 | throw SysError(format("could not set permissions on `%1%' to 1777") % perUserDir); | 257 | throw SysError(format("could not set permissions on '%1%' to 1777") % perUserDir); |
| 258 | |||
| 259 | mode_t perm = 01775; | ||
| 258 | 260 | ||
| 259 | struct group * gr = getgrnam(settings.buildUsersGroup.c_str()); | 261 | struct group * gr = getgrnam(settings.buildUsersGroup.c_str()); |
| 260 | if (!gr) | 262 | if (!gr) |
| 261 | throw Error(format("the group `%1%' specified in `build-users-group' does not exist") | 263 | throw Error(format("the group `%1%' specified in `build-users-group' does not exist") |
| 262 | % settings.buildUsersGroup); | 264 | % settings.buildUsersGroup); |
| 263 | 265 | else { | |
| 264 | struct stat st; | 266 | struct stat st; |
| 265 | if (stat(settings.nixStore.c_str(), &st)) | 267 | if (stat(settings.nixStore.c_str(), &st)) |
| 266 | throw SysError(format("getting attributes of path `%1%'") % settings.nixStore); | 268 | throw SysError(format("getting attributes of path '%1%'") % settings.nixStore); |
| 267 | 269 | ||
| 268 | if (st.st_uid != 0 || st.st_gid != gr->gr_gid || (st.st_mode & ~S_IFMT) != 01775) { | 270 | if (st.st_uid != 0 || st.st_gid != gr->gr_gid || (st.st_mode & ~S_IFMT) != perm) { |
| 269 | if (chown(settings.nixStore.c_str(), 0, gr->gr_gid) == -1) | 271 | if (chown(settings.nixStore.c_str(), 0, gr->gr_gid) == -1) |
| 270 | throw SysError(format("changing ownership of path `%1%'") % settings.nixStore); | 272 | throw SysError(format("changing ownership of path '%1%'") % settings.nixStore); |
| 271 | if (chmod(settings.nixStore.c_str(), 01775) == -1) | 273 | if (chmod(settings.nixStore.c_str(), perm) == -1) |
| 272 | throw SysError(format("changing permissions on path `%1%'") % settings.nixStore); | 274 | throw SysError(format("changing permissions on path '%1%'") % settings.nixStore); |
| 275 | } | ||
| 273 | } | 276 | } |
| 274 | } | 277 | } |
| 275 | 278 | ||
| @@ -358,7 +361,17 @@ LocalStore::~LocalStore() | |||
| 358 | i->second.to.close(); | 361 | i->second.to.close(); |
| 359 | i->second.from.close(); | 362 | i->second.from.close(); |
| 360 | i->second.error.close(); | 363 | i->second.error.close(); |
| 361 | i->second.pid.wait(true); | 364 | if (i->second.pid != -1) |
| 365 | i->second.pid.wait(true); | ||
| 366 | } | ||
| 367 | } catch (...) { | ||
| 368 | ignoreException(); | ||
| 369 | } | ||
| 370 | |||
| 371 | try { | ||
| 372 | if (fdTempRoots != -1) { | ||
| 373 | fdTempRoots.close(); | ||
| 374 | unlink(fnTempRoots.c_str()); | ||
| 362 | } | 375 | } |
| 363 | } catch (...) { | 376 | } catch (...) { |
| 364 | ignoreException(); | 377 | ignoreException(); |
| @@ -489,7 +502,7 @@ void LocalStore::makeStoreWritable() | |||
| 489 | if (unshare(CLONE_NEWNS) == -1) | 502 | if (unshare(CLONE_NEWNS) == -1) |
| 490 | throw SysError("setting up a private mount namespace"); | 503 | throw SysError("setting up a private mount namespace"); |
| 491 | 504 | ||
| 492 | if (mount(0, settings.nixStore.c_str(), 0, MS_REMOUNT | MS_BIND, 0) == -1) | 505 | if (mount(0, settings.nixStore.c_str(), "none", MS_REMOUNT | MS_BIND, 0) == -1) |
| 493 | throw SysError(format("remounting %1% writable") % settings.nixStore); | 506 | throw SysError(format("remounting %1% writable") % settings.nixStore); |
| 494 | } | 507 | } |
| 495 | #endif | 508 | #endif |
| @@ -551,9 +564,9 @@ static void canonicalisePathMetaData_(const Path & path, uid_t fromUid, InodesSe | |||
| 551 | if (lstat(path.c_str(), &st)) | 564 | if (lstat(path.c_str(), &st)) |
| 552 | throw SysError(format("getting attributes of path `%1%'") % path); | 565 | throw SysError(format("getting attributes of path `%1%'") % path); |
| 553 | 566 | ||
| 554 | /* Really make sure that the path is of a supported type. This | 567 | /* Really make sure that the path is of a supported type. */ |
| 555 | has already been checked in dumpPath(). */ | 568 | if (!(S_ISREG(st.st_mode) || S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))) |
| 556 | assert(S_ISREG(st.st_mode) || S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode)); | 569 | throw Error(format("file ‘%1%’ has an unsupported type") % path); |
| 557 | 570 | ||
| 558 | /* Fail if the file is not owned by the build user. This prevents | 571 | /* Fail if the file is not owned by the build user. This prevents |
| 559 | us from messing up the ownership/permissions of files | 572 | us from messing up the ownership/permissions of files |
| @@ -593,9 +606,9 @@ static void canonicalisePathMetaData_(const Path & path, uid_t fromUid, InodesSe | |||
| 593 | } | 606 | } |
| 594 | 607 | ||
| 595 | if (S_ISDIR(st.st_mode)) { | 608 | if (S_ISDIR(st.st_mode)) { |
| 596 | Strings names = readDirectory(path); | 609 | DirEntries entries = readDirectory(path); |
| 597 | foreach (Strings::iterator, i, names) | 610 | for (auto & i : entries) |
| 598 | canonicalisePathMetaData_(path + "/" + *i, fromUid, inodesSeen); | 611 | canonicalisePathMetaData_(path + "/" + i.name, fromUid, inodesSeen); |
| 599 | } | 612 | } |
| 600 | } | 613 | } |
| 601 | 614 | ||
| @@ -1083,31 +1096,16 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter & | |||
| 1083 | 1096 | ||
| 1084 | setSubstituterEnv(); | 1097 | setSubstituterEnv(); |
| 1085 | 1098 | ||
| 1086 | run.pid = maybeVfork(); | 1099 | run.pid = startProcess([&]() { |
| 1087 | 1100 | if (dup2(toPipe.readSide, STDIN_FILENO) == -1) | |
| 1088 | switch (run.pid) { | 1101 | throw SysError("dupping stdin"); |
| 1089 | 1102 | if (dup2(fromPipe.writeSide, STDOUT_FILENO) == -1) | |
| 1090 | case -1: | 1103 | throw SysError("dupping stdout"); |
| 1091 | throw SysError("unable to fork"); | 1104 | if (dup2(errorPipe.writeSide, STDERR_FILENO) == -1) |
| 1092 | 1105 | throw SysError("dupping stderr"); | |
| 1093 | case 0: /* child */ | 1106 | execl(substituter.c_str(), substituter.c_str(), "--query", NULL); |
| 1094 | try { | 1107 | throw SysError(format("executing `%1%'") % substituter); |
| 1095 | restoreAffinity(); | 1108 | }); |
| 1096 | if (dup2(toPipe.readSide, STDIN_FILENO) == -1) | ||
| 1097 | throw SysError("dupping stdin"); | ||
| 1098 | if (dup2(fromPipe.writeSide, STDOUT_FILENO) == -1) | ||
| 1099 | throw SysError("dupping stdout"); | ||
| 1100 | if (dup2(errorPipe.writeSide, STDERR_FILENO) == -1) | ||
| 1101 | throw SysError("dupping stderr"); | ||
| 1102 | execl(substituter.c_str(), substituter.c_str(), "--query", NULL); | ||
| 1103 | throw SysError(format("executing `%1%'") % substituter); | ||
| 1104 | } catch (std::exception & e) { | ||
| 1105 | std::cerr << "error: " << e.what() << std::endl; | ||
| 1106 | } | ||
| 1107 | _exit(1); | ||
| 1108 | } | ||
| 1109 | |||
| 1110 | /* Parent. */ | ||
| 1111 | 1109 | ||
| 1112 | run.program = baseNameOf(substituter); | 1110 | run.program = baseNameOf(substituter); |
| 1113 | run.to = toPipe.writeSide.borrow(); | 1111 | run.to = toPipe.writeSide.borrow(); |
| @@ -1171,7 +1169,7 @@ string LocalStore::getLineFromSubstituter(RunningSubstituter & run) | |||
| 1171 | while (((p = err.find('\n')) != string::npos) | 1169 | while (((p = err.find('\n')) != string::npos) |
| 1172 | || ((p = err.find('\r')) != string::npos)) { | 1170 | || ((p = err.find('\r')) != string::npos)) { |
| 1173 | string thing(err, 0, p + 1); | 1171 | string thing(err, 0, p + 1); |
| 1174 | writeToStderr(run.program + ": " + thing); | 1172 | writeToStderr(run.program + ": " + thing); |
| 1175 | err = string(err, p + 1); | 1173 | err = string(err, p + 1); |
| 1176 | } | 1174 | } |
| 1177 | } | 1175 | } |
| @@ -1409,7 +1407,7 @@ Path LocalStore::addToStoreFromDump(const string & dump, const string & name, | |||
| 1409 | } | 1407 | } |
| 1410 | 1408 | ||
| 1411 | 1409 | ||
| 1412 | Path LocalStore::addToStore(const Path & _srcPath, | 1410 | Path LocalStore::addToStore(const string & name, const Path & _srcPath, |
| 1413 | bool recursive, HashType hashAlgo, PathFilter & filter, bool repair) | 1411 | bool recursive, HashType hashAlgo, PathFilter & filter, bool repair) |
| 1414 | { | 1412 | { |
| 1415 | Path srcPath(absPath(_srcPath)); | 1413 | Path srcPath(absPath(_srcPath)); |
| @@ -1424,7 +1422,7 @@ Path LocalStore::addToStore(const Path & _srcPath, | |||
| 1424 | else | 1422 | else |
| 1425 | sink.s = readFile(srcPath); | 1423 | sink.s = readFile(srcPath); |
| 1426 | 1424 | ||
| 1427 | return addToStoreFromDump(sink.s, baseNameOf(srcPath), recursive, hashAlgo, repair); | 1425 | return addToStoreFromDump(sink.s, name, recursive, hashAlgo, repair); |
| 1428 | } | 1426 | } |
| 1429 | 1427 | ||
| 1430 | 1428 | ||
| @@ -1503,7 +1501,8 @@ void LocalStore::exportPath(const Path & path, bool sign, | |||
| 1503 | { | 1501 | { |
| 1504 | assertStorePath(path); | 1502 | assertStorePath(path); |
| 1505 | 1503 | ||
| 1506 | addTempRoot(path); | 1504 | printMsg(lvlInfo, format("exporting path `%1%'") % path); |
| 1505 | |||
| 1507 | if (!isValidPath(path)) | 1506 | if (!isValidPath(path)) |
| 1508 | throw Error(format("path `%1%' is not valid") % path); | 1507 | throw Error(format("path `%1%' is not valid") % path); |
| 1509 | 1508 | ||
| @@ -1613,8 +1612,6 @@ Path LocalStore::importPath(bool requireSignature, Source & source) | |||
| 1613 | 1612 | ||
| 1614 | Path dstPath = readStorePath(hashAndReadSource); | 1613 | Path dstPath = readStorePath(hashAndReadSource); |
| 1615 | 1614 | ||
| 1616 | printMsg(lvlInfo, format("importing path `%1%'") % dstPath); | ||
| 1617 | |||
| 1618 | PathSet references = readStorePaths<PathSet>(hashAndReadSource); | 1615 | PathSet references = readStorePaths<PathSet>(hashAndReadSource); |
| 1619 | 1616 | ||
| 1620 | Path deriver = readString(hashAndReadSource); | 1617 | Path deriver = readString(hashAndReadSource); |
| @@ -1747,8 +1744,8 @@ bool LocalStore::verifyStore(bool checkContents, bool repair) | |||
| 1747 | /* Acquire the global GC lock to prevent a garbage collection. */ | 1744 | /* Acquire the global GC lock to prevent a garbage collection. */ |
| 1748 | AutoCloseFD fdGCLock = openGCLock(ltWrite); | 1745 | AutoCloseFD fdGCLock = openGCLock(ltWrite); |
| 1749 | 1746 | ||
| 1750 | Paths entries = readDirectory(settings.nixStore); | 1747 | PathSet store; |
| 1751 | PathSet store(entries.begin(), entries.end()); | 1748 | for (auto & i : readDirectory(settings.nixStore)) store.insert(i.name); |
| 1752 | 1749 | ||
| 1753 | /* Check whether all valid paths actually exist. */ | 1750 | /* Check whether all valid paths actually exist. */ |
| 1754 | printMsg(lvlInfo, "checking path existence..."); | 1751 | printMsg(lvlInfo, "checking path existence..."); |
| @@ -1898,9 +1895,8 @@ void LocalStore::markContentsGood(const Path & path) | |||
| 1898 | PathSet LocalStore::queryValidPathsOld() | 1895 | PathSet LocalStore::queryValidPathsOld() |
| 1899 | { | 1896 | { |
| 1900 | PathSet paths; | 1897 | PathSet paths; |
| 1901 | Strings entries = readDirectory(settings.nixDBPath + "/info"); | 1898 | for (auto & i : readDirectory(settings.nixDBPath + "/info")) |
| 1902 | foreach (Strings::iterator, i, entries) | 1899 | if (i.name.at(0) != '.') paths.insert(settings.nixStore + "/" + i.name); |
| 1903 | if (i->at(0) != '.') paths.insert(settings.nixStore + "/" + *i); | ||
| 1904 | return paths; | 1900 | return paths; |
| 1905 | } | 1901 | } |
| 1906 | 1902 | ||
| @@ -1987,9 +1983,8 @@ static void makeMutable(const Path & path) | |||
| 1987 | if (!S_ISDIR(st.st_mode) && !S_ISREG(st.st_mode)) return; | 1983 | if (!S_ISDIR(st.st_mode) && !S_ISREG(st.st_mode)) return; |
| 1988 | 1984 | ||
| 1989 | if (S_ISDIR(st.st_mode)) { | 1985 | if (S_ISDIR(st.st_mode)) { |
| 1990 | Strings names = readDirectory(path); | 1986 | for (auto & i : readDirectory(path)) |
| 1991 | foreach (Strings::iterator, i, names) | 1987 | makeMutable(path + "/" + i.name); |
| 1992 | makeMutable(path + "/" + *i); | ||
| 1993 | } | 1988 | } |
| 1994 | 1989 | ||
| 1995 | /* The O_NOFOLLOW is important to prevent us from changing the | 1990 | /* The O_NOFOLLOW is important to prevent us from changing the |
diff --git a/nix/libstore/local-store.hh b/nix/libstore/local-store.hh index 54331e448a9..819f59327a2 100644 --- a/nix/libstore/local-store.hh +++ b/nix/libstore/local-store.hh | |||
| @@ -1,16 +1,12 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #include <string> | 3 | #include <string> |
| 4 | #include <unordered_set> | ||
| 4 | 5 | ||
| 5 | #include "store-api.hh" | 6 | #include "store-api.hh" |
| 6 | #include "util.hh" | 7 | #include "util.hh" |
| 7 | #include "pathlocks.hh" | 8 | #include "pathlocks.hh" |
| 8 | 9 | ||
| 9 | #if HAVE_TR1_UNORDERED_SET | ||
| 10 | #include <tr1/unordered_set> | ||
| 11 | #endif | ||
| 12 | |||
| 13 | |||
| 14 | 10 | ||
| 15 | class sqlite3; | 11 | class sqlite3; |
| 16 | class sqlite3_stmt; | 12 | class sqlite3_stmt; |
| @@ -134,7 +130,7 @@ public: | |||
| 134 | void querySubstitutablePathInfos(const PathSet & paths, | 130 | void querySubstitutablePathInfos(const PathSet & paths, |
| 135 | SubstitutablePathInfos & infos); | 131 | SubstitutablePathInfos & infos); |
| 136 | 132 | ||
| 137 | Path addToStore(const Path & srcPath, | 133 | Path addToStore(const string & name, const Path & srcPath, |
| 138 | bool recursive = true, HashType hashAlgo = htSHA256, | 134 | bool recursive = true, HashType hashAlgo = htSHA256, |
| 139 | PathFilter & filter = defaultPathFilter, bool repair = false); | 135 | PathFilter & filter = defaultPathFilter, bool repair = false); |
| 140 | 136 | ||
| @@ -171,6 +167,9 @@ public: | |||
| 171 | files with the same contents. */ | 167 | files with the same contents. */ |
| 172 | void optimiseStore(OptimiseStats & stats); | 168 | void optimiseStore(OptimiseStats & stats); |
| 173 | 169 | ||
| 170 | /* Generic variant of the above method. */ | ||
| 171 | void optimiseStore(); | ||
| 172 | |||
| 174 | /* Optimise a single store path. */ | 173 | /* Optimise a single store path. */ |
| 175 | void optimisePath(const Path & path); | 174 | void optimisePath(const Path & path); |
| 176 | 175 | ||
| @@ -245,6 +244,10 @@ private: | |||
| 245 | 244 | ||
| 246 | bool didSetSubstituterEnv; | 245 | bool didSetSubstituterEnv; |
| 247 | 246 | ||
| 247 | /* The file to which we write our temporary roots. */ | ||
| 248 | Path fnTempRoots; | ||
| 249 | AutoCloseFD fdTempRoots; | ||
| 250 | |||
| 248 | int getSchema(); | 251 | int getSchema(); |
| 249 | 252 | ||
| 250 | void openDB(bool create); | 253 | void openDB(bool create); |
| @@ -306,11 +309,7 @@ private: | |||
| 306 | 309 | ||
| 307 | void checkDerivationOutputs(const Path & drvPath, const Derivation & drv); | 310 | void checkDerivationOutputs(const Path & drvPath, const Derivation & drv); |
| 308 | 311 | ||
| 309 | #if HAVE_TR1_UNORDERED_SET | 312 | typedef std::unordered_set<ino_t> InodeHash; |
| 310 | typedef std::tr1::unordered_set<ino_t> InodeHash; | ||
| 311 | #else | ||
| 312 | typedef std::set<ino_t> InodeHash; | ||
| 313 | #endif | ||
| 314 | 313 | ||
| 315 | InodeHash loadInodeHash(); | 314 | InodeHash loadInodeHash(); |
| 316 | Strings readDirectoryIgnoringInodes(const Path & path, const InodeHash & inodeHash); | 315 | Strings readDirectoryIgnoringInodes(const Path & path, const InodeHash & inodeHash); |
diff --git a/nix/libstore/optimise-store.cc b/nix/libstore/optimise-store.cc index 67ee94a4bde..c62b8e451b4 100644 --- a/nix/libstore/optimise-store.cc +++ b/nix/libstore/optimise-store.cc | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include "local-store.hh" | 4 | #include "local-store.hh" |
| 5 | #include "globals.hh" | 5 | #include "globals.hh" |
| 6 | 6 | ||
| 7 | #include <cstdlib> | ||
| 7 | #include <sys/types.h> | 8 | #include <sys/types.h> |
| 8 | #include <sys/stat.h> | 9 | #include <sys/stat.h> |
| 9 | #include <unistd.h> | 10 | #include <unistd.h> |
| @@ -225,6 +226,22 @@ void LocalStore::optimiseStore(OptimiseStats & stats) | |||
| 225 | } | 226 | } |
| 226 | } | 227 | } |
| 227 | 228 | ||
| 229 | static string showBytes(unsigned long long bytes) | ||
| 230 | { | ||
| 231 | return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str(); | ||
| 232 | } | ||
| 233 | |||
| 234 | void LocalStore::optimiseStore() | ||
| 235 | { | ||
| 236 | OptimiseStats stats; | ||
| 237 | |||
| 238 | optimiseStore(stats); | ||
| 239 | |||
| 240 | printMsg(lvlError, | ||
| 241 | format("%1% freed by hard-linking %2% files") | ||
| 242 | % showBytes(stats.bytesFreed) | ||
| 243 | % stats.filesLinked); | ||
| 244 | } | ||
| 228 | 245 | ||
| 229 | void LocalStore::optimisePath(const Path & path) | 246 | void LocalStore::optimisePath(const Path & path) |
| 230 | { | 247 | { |
diff --git a/nix/libstore/pathlocks.cc b/nix/libstore/pathlocks.cc index b858ed238de..830858ff8d9 100644 --- a/nix/libstore/pathlocks.cc +++ b/nix/libstore/pathlocks.cc | |||
| @@ -33,7 +33,7 @@ void deleteLockFile(const Path & path, int fd) | |||
| 33 | other processes waiting on this lock that the lock is stale | 33 | other processes waiting on this lock that the lock is stale |
| 34 | (deleted). */ | 34 | (deleted). */ |
| 35 | unlink(path.c_str()); | 35 | unlink(path.c_str()); |
| 36 | writeFull(fd, (const unsigned char *) "d", 1); | 36 | writeFull(fd, "d"); |
| 37 | /* Note that the result of unlink() is ignored; removing the lock | 37 | /* Note that the result of unlink() is ignored; removing the lock |
| 38 | file is an optimisation, not a necessity. */ | 38 | file is an optimisation, not a necessity. */ |
| 39 | } | 39 | } |
diff --git a/nix/libstore/remote-store.cc b/nix/libstore/remote-store.cc index 46192069329..0539bbe1270 100644 --- a/nix/libstore/remote-store.cc +++ b/nix/libstore/remote-store.cc | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <sys/stat.h> | 10 | #include <sys/stat.h> |
| 11 | #include <sys/socket.h> | 11 | #include <sys/socket.h> |
| 12 | #include <sys/un.h> | 12 | #include <sys/un.h> |
| 13 | #include <errno.h> | ||
| 13 | #include <fcntl.h> | 14 | #include <fcntl.h> |
| 14 | 15 | ||
| 15 | #include <iostream> | 16 | #include <iostream> |
| @@ -87,8 +88,7 @@ void RemoteStore::openConnection(bool reserveSpace) | |||
| 87 | processStderr(); | 88 | processStderr(); |
| 88 | } | 89 | } |
| 89 | catch (Error & e) { | 90 | catch (Error & e) { |
| 90 | throw Error(format("cannot start worker (%1%)") | 91 | throw Error(format("cannot start daemon worker: %1%") % e.msg()); |
| 91 | % e.msg()); | ||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | setOptions(); | 94 | setOptions(); |
| @@ -110,7 +110,7 @@ void RemoteStore::connectToDaemon() | |||
| 110 | applications... */ | 110 | applications... */ |
| 111 | AutoCloseFD fdPrevDir = open(".", O_RDONLY); | 111 | AutoCloseFD fdPrevDir = open(".", O_RDONLY); |
| 112 | if (fdPrevDir == -1) throw SysError("couldn't open current directory"); | 112 | if (fdPrevDir == -1) throw SysError("couldn't open current directory"); |
| 113 | chdir(dirOf(socketPath).c_str()); | 113 | if (chdir(dirOf(socketPath).c_str()) == -1) throw SysError(format("couldn't change to directory of ‘%1%’") % socketPath); |
| 114 | Path socketPathRel = "./" + baseNameOf(socketPath); | 114 | Path socketPathRel = "./" + baseNameOf(socketPath); |
| 115 | 115 | ||
| 116 | struct sockaddr_un addr; | 116 | struct sockaddr_un addr; |
| @@ -133,8 +133,6 @@ RemoteStore::~RemoteStore() | |||
| 133 | try { | 133 | try { |
| 134 | to.flush(); | 134 | to.flush(); |
| 135 | fdSocket.close(); | 135 | fdSocket.close(); |
| 136 | if (child != -1) | ||
| 137 | child.wait(true); | ||
| 138 | } catch (...) { | 136 | } catch (...) { |
| 139 | ignoreException(); | 137 | ignoreException(); |
| 140 | } | 138 | } |
| @@ -387,7 +385,7 @@ Path RemoteStore::queryPathFromHashPart(const string & hashPart) | |||
| 387 | } | 385 | } |
| 388 | 386 | ||
| 389 | 387 | ||
| 390 | Path RemoteStore::addToStore(const Path & _srcPath, | 388 | Path RemoteStore::addToStore(const string & name, const Path & _srcPath, |
| 391 | bool recursive, HashType hashAlgo, PathFilter & filter, bool repair) | 389 | bool recursive, HashType hashAlgo, PathFilter & filter, bool repair) |
| 392 | { | 390 | { |
| 393 | if (repair) throw Error("repairing is not supported when building through the Nix daemon"); | 391 | if (repair) throw Error("repairing is not supported when building through the Nix daemon"); |
| @@ -397,13 +395,28 @@ Path RemoteStore::addToStore(const Path & _srcPath, | |||
| 397 | Path srcPath(absPath(_srcPath)); | 395 | Path srcPath(absPath(_srcPath)); |
| 398 | 396 | ||
| 399 | writeInt(wopAddToStore, to); | 397 | writeInt(wopAddToStore, to); |
| 400 | writeString(baseNameOf(srcPath), to); | 398 | writeString(name, to); |
| 401 | /* backwards compatibility hack */ | 399 | /* backwards compatibility hack */ |
| 402 | writeInt((hashAlgo == htSHA256 && recursive) ? 0 : 1, to); | 400 | writeInt((hashAlgo == htSHA256 && recursive) ? 0 : 1, to); |
| 403 | writeInt(recursive ? 1 : 0, to); | 401 | writeInt(recursive ? 1 : 0, to); |
| 404 | writeString(printHashType(hashAlgo), to); | 402 | writeString(printHashType(hashAlgo), to); |
| 405 | dumpPath(srcPath, to, filter); | 403 | |
| 406 | processStderr(); | 404 | try { |
| 405 | to.written = 0; | ||
| 406 | to.warn = true; | ||
| 407 | dumpPath(srcPath, to, filter); | ||
| 408 | to.warn = false; | ||
| 409 | processStderr(); | ||
| 410 | } catch (SysError & e) { | ||
| 411 | /* Daemon closed while we were sending the path. Probably OOM | ||
| 412 | or I/O error. */ | ||
| 413 | if (e.errNo == EPIPE) | ||
| 414 | try { | ||
| 415 | processStderr(); | ||
| 416 | } catch (EndOfFile & e) { } | ||
| 417 | throw; | ||
| 418 | } | ||
| 419 | |||
| 407 | return readStorePath(from); | 420 | return readStorePath(from); |
| 408 | } | 421 | } |
| 409 | 422 | ||
| @@ -564,6 +577,23 @@ void RemoteStore::clearFailedPaths(const PathSet & paths) | |||
| 564 | readInt(from); | 577 | readInt(from); |
| 565 | } | 578 | } |
| 566 | 579 | ||
| 580 | void RemoteStore::optimiseStore() | ||
| 581 | { | ||
| 582 | openConnection(); | ||
| 583 | writeInt(wopOptimiseStore, to); | ||
| 584 | processStderr(); | ||
| 585 | readInt(from); | ||
| 586 | } | ||
| 587 | |||
| 588 | bool RemoteStore::verifyStore(bool checkContents, bool repair) | ||
| 589 | { | ||
| 590 | openConnection(); | ||
| 591 | writeInt(wopVerifyStore, to); | ||
| 592 | writeInt(checkContents, to); | ||
| 593 | writeInt(repair, to); | ||
| 594 | processStderr(); | ||
| 595 | return readInt(from) != 0; | ||
| 596 | } | ||
| 567 | 597 | ||
| 568 | void RemoteStore::processStderr(Sink * sink, Source * source) | 598 | void RemoteStore::processStderr(Sink * sink, Source * source) |
| 569 | { | 599 | { |
diff --git a/nix/libstore/remote-store.hh b/nix/libstore/remote-store.hh index 04b60fce4b4..030120db406 100644 --- a/nix/libstore/remote-store.hh +++ b/nix/libstore/remote-store.hh | |||
| @@ -21,15 +21,15 @@ public: | |||
| 21 | RemoteStore(); | 21 | RemoteStore(); |
| 22 | 22 | ||
| 23 | ~RemoteStore(); | 23 | ~RemoteStore(); |
| 24 | 24 | ||
| 25 | /* Implementations of abstract store API methods. */ | 25 | /* Implementations of abstract store API methods. */ |
| 26 | 26 | ||
| 27 | bool isValidPath(const Path & path); | 27 | bool isValidPath(const Path & path); |
| 28 | 28 | ||
| 29 | PathSet queryValidPaths(const PathSet & paths); | 29 | PathSet queryValidPaths(const PathSet & paths); |
| 30 | 30 | ||
| 31 | PathSet queryAllValidPaths(); | 31 | PathSet queryAllValidPaths(); |
| 32 | 32 | ||
| 33 | ValidPathInfo queryPathInfo(const Path & path); | 33 | ValidPathInfo queryPathInfo(const Path & path); |
| 34 | 34 | ||
| 35 | Hash queryPathHash(const Path & path); | 35 | Hash queryPathHash(const Path & path); |
| @@ -39,21 +39,21 @@ public: | |||
| 39 | void queryReferrers(const Path & path, PathSet & referrers); | 39 | void queryReferrers(const Path & path, PathSet & referrers); |
| 40 | 40 | ||
| 41 | Path queryDeriver(const Path & path); | 41 | Path queryDeriver(const Path & path); |
| 42 | 42 | ||
| 43 | PathSet queryValidDerivers(const Path & path); | 43 | PathSet queryValidDerivers(const Path & path); |
| 44 | 44 | ||
| 45 | PathSet queryDerivationOutputs(const Path & path); | 45 | PathSet queryDerivationOutputs(const Path & path); |
| 46 | 46 | ||
| 47 | StringSet queryDerivationOutputNames(const Path & path); | 47 | StringSet queryDerivationOutputNames(const Path & path); |
| 48 | 48 | ||
| 49 | Path queryPathFromHashPart(const string & hashPart); | 49 | Path queryPathFromHashPart(const string & hashPart); |
| 50 | 50 | ||
| 51 | PathSet querySubstitutablePaths(const PathSet & paths); | 51 | PathSet querySubstitutablePaths(const PathSet & paths); |
| 52 | 52 | ||
| 53 | void querySubstitutablePathInfos(const PathSet & paths, | 53 | void querySubstitutablePathInfos(const PathSet & paths, |
| 54 | SubstitutablePathInfos & infos); | 54 | SubstitutablePathInfos & infos); |
| 55 | 55 | ||
| 56 | Path addToStore(const Path & srcPath, | 56 | Path addToStore(const string & name, const Path & srcPath, |
| 57 | bool recursive = true, HashType hashAlgo = htSHA256, | 57 | bool recursive = true, HashType hashAlgo = htSHA256, |
| 58 | PathFilter & filter = defaultPathFilter, bool repair = false); | 58 | PathFilter & filter = defaultPathFilter, bool repair = false); |
| 59 | 59 | ||
| @@ -64,7 +64,7 @@ public: | |||
| 64 | Sink & sink); | 64 | Sink & sink); |
| 65 | 65 | ||
| 66 | Paths importPaths(bool requireSignature, Source & source); | 66 | Paths importPaths(bool requireSignature, Source & source); |
| 67 | 67 | ||
| 68 | void buildPaths(const PathSet & paths, BuildMode buildMode); | 68 | void buildPaths(const PathSet & paths, BuildMode buildMode); |
| 69 | 69 | ||
| 70 | void ensurePath(const Path & path); | 70 | void ensurePath(const Path & path); |
| @@ -72,22 +72,24 @@ public: | |||
| 72 | void addTempRoot(const Path & path); | 72 | void addTempRoot(const Path & path); |
| 73 | 73 | ||
| 74 | void addIndirectRoot(const Path & path); | 74 | void addIndirectRoot(const Path & path); |
| 75 | 75 | ||
| 76 | void syncWithGC(); | 76 | void syncWithGC(); |
| 77 | 77 | ||
| 78 | Roots findRoots(); | 78 | Roots findRoots(); |
| 79 | 79 | ||
| 80 | void collectGarbage(const GCOptions & options, GCResults & results); | 80 | void collectGarbage(const GCOptions & options, GCResults & results); |
| 81 | 81 | ||
| 82 | PathSet queryFailedPaths(); | 82 | PathSet queryFailedPaths(); |
| 83 | 83 | ||
| 84 | void clearFailedPaths(const PathSet & paths); | 84 | void clearFailedPaths(const PathSet & paths); |
| 85 | 85 | ||
| 86 | void optimiseStore(); | ||
| 87 | |||
| 88 | bool verifyStore(bool checkContents, bool repair); | ||
| 86 | private: | 89 | private: |
| 87 | AutoCloseFD fdSocket; | 90 | AutoCloseFD fdSocket; |
| 88 | FdSink to; | 91 | FdSink to; |
| 89 | FdSource from; | 92 | FdSource from; |
| 90 | Pid child; | ||
| 91 | unsigned int daemonVersion; | 93 | unsigned int daemonVersion; |
| 92 | bool initialised; | 94 | bool initialised; |
| 93 | 95 | ||
diff --git a/nix/libstore/store-api.hh b/nix/libstore/store-api.hh index b635fee2cf1..3764f3e5424 100644 --- a/nix/libstore/store-api.hh +++ b/nix/libstore/store-api.hh | |||
| @@ -54,7 +54,7 @@ struct GCOptions | |||
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | struct GCResults | 57 | struct GCResults |
| 58 | { | 58 | { |
| 59 | /* Depending on the action, the GC roots, or the paths that would | 59 | /* Depending on the action, the GC roots, or the paths that would |
| 60 | be or have been deleted. */ | 60 | be or have been deleted. */ |
| @@ -82,7 +82,7 @@ struct SubstitutablePathInfo | |||
| 82 | typedef std::map<Path, SubstitutablePathInfo> SubstitutablePathInfos; | 82 | typedef std::map<Path, SubstitutablePathInfo> SubstitutablePathInfos; |
| 83 | 83 | ||
| 84 | 84 | ||
| 85 | struct ValidPathInfo | 85 | struct ValidPathInfo |
| 86 | { | 86 | { |
| 87 | Path path; | 87 | Path path; |
| 88 | Path deriver; | 88 | Path deriver; |
| @@ -100,13 +100,13 @@ typedef list<ValidPathInfo> ValidPathInfos; | |||
| 100 | enum BuildMode { bmNormal, bmRepair, bmCheck }; | 100 | enum BuildMode { bmNormal, bmRepair, bmCheck }; |
| 101 | 101 | ||
| 102 | 102 | ||
| 103 | class StoreAPI | 103 | class StoreAPI |
| 104 | { | 104 | { |
| 105 | public: | 105 | public: |
| 106 | 106 | ||
| 107 | virtual ~StoreAPI() { } | 107 | virtual ~StoreAPI() { } |
| 108 | 108 | ||
| 109 | /* Check whether a path is valid. */ | 109 | /* Check whether a path is valid. */ |
| 110 | virtual bool isValidPath(const Path & path) = 0; | 110 | virtual bool isValidPath(const Path & path) = 0; |
| 111 | 111 | ||
| 112 | /* Query which of the given paths is valid. */ | 112 | /* Query which of the given paths is valid. */ |
| @@ -118,7 +118,7 @@ public: | |||
| 118 | /* Query information about a valid path. */ | 118 | /* Query information about a valid path. */ |
| 119 | virtual ValidPathInfo queryPathInfo(const Path & path) = 0; | 119 | virtual ValidPathInfo queryPathInfo(const Path & path) = 0; |
| 120 | 120 | ||
| 121 | /* Query the hash of a valid path. */ | 121 | /* Query the hash of a valid path. */ |
| 122 | virtual Hash queryPathHash(const Path & path) = 0; | 122 | virtual Hash queryPathHash(const Path & path) = 0; |
| 123 | 123 | ||
| 124 | /* Query the set of outgoing FS references for a store path. The | 124 | /* Query the set of outgoing FS references for a store path. The |
| @@ -150,7 +150,7 @@ public: | |||
| 150 | /* Query the full store path given the hash part of a valid store | 150 | /* Query the full store path given the hash part of a valid store |
| 151 | path, or "" if the path doesn't exist. */ | 151 | path, or "" if the path doesn't exist. */ |
| 152 | virtual Path queryPathFromHashPart(const string & hashPart) = 0; | 152 | virtual Path queryPathFromHashPart(const string & hashPart) = 0; |
| 153 | 153 | ||
| 154 | /* Query which of the given paths have substitutes. */ | 154 | /* Query which of the given paths have substitutes. */ |
| 155 | virtual PathSet querySubstitutablePaths(const PathSet & paths) = 0; | 155 | virtual PathSet querySubstitutablePaths(const PathSet & paths) = 0; |
| 156 | 156 | ||
| @@ -159,12 +159,12 @@ public: | |||
| 159 | info, it's omitted from the resulting ‘infos’ map. */ | 159 | info, it's omitted from the resulting ‘infos’ map. */ |
| 160 | virtual void querySubstitutablePathInfos(const PathSet & paths, | 160 | virtual void querySubstitutablePathInfos(const PathSet & paths, |
| 161 | SubstitutablePathInfos & infos) = 0; | 161 | SubstitutablePathInfos & infos) = 0; |
| 162 | 162 | ||
| 163 | /* Copy the contents of a path to the store and register the | 163 | /* Copy the contents of a path to the store and register the |
| 164 | validity the resulting path. The resulting path is returned. | 164 | validity the resulting path. The resulting path is returned. |
| 165 | The function object `filter' can be used to exclude files (see | 165 | The function object `filter' can be used to exclude files (see |
| 166 | libutil/archive.hh). */ | 166 | libutil/archive.hh). */ |
| 167 | virtual Path addToStore(const Path & srcPath, | 167 | virtual Path addToStore(const string & name, const Path & srcPath, |
| 168 | bool recursive = true, HashType hashAlgo = htSHA256, | 168 | bool recursive = true, HashType hashAlgo = htSHA256, |
| 169 | PathFilter & filter = defaultPathFilter, bool repair = false) = 0; | 169 | PathFilter & filter = defaultPathFilter, bool repair = false) = 0; |
| 170 | 170 | ||
| @@ -250,6 +250,14 @@ public: | |||
| 250 | `nix-store --register-validity'. */ | 250 | `nix-store --register-validity'. */ |
| 251 | string makeValidityRegistration(const PathSet & paths, | 251 | string makeValidityRegistration(const PathSet & paths, |
| 252 | bool showDerivers, bool showHash); | 252 | bool showDerivers, bool showHash); |
| 253 | |||
| 254 | /* Optimise the disk space usage of the Nix store by hard-linking files | ||
| 255 | with the same contents. */ | ||
| 256 | virtual void optimiseStore() = 0; | ||
| 257 | |||
| 258 | /* Check the integrity of the Nix store. Returns true if errors | ||
| 259 | remain. */ | ||
| 260 | virtual bool verifyStore(bool checkContents, bool repair) = 0; | ||
| 253 | }; | 261 | }; |
| 254 | 262 | ||
| 255 | 263 | ||
| @@ -263,7 +271,7 @@ bool isStorePath(const Path & path); | |||
| 263 | 271 | ||
| 264 | /* Extract the name part of the given store path. */ | 272 | /* Extract the name part of the given store path. */ |
| 265 | string storePathToName(const Path & path); | 273 | string storePathToName(const Path & path); |
| 266 | 274 | ||
| 267 | void checkStoreName(const string & name); | 275 | void checkStoreName(const string & name); |
| 268 | 276 | ||
| 269 | 277 | ||
| @@ -284,7 +292,7 @@ Path followLinksToStorePath(const Path & path); | |||
| 284 | /* Constructs a unique store path name. */ | 292 | /* Constructs a unique store path name. */ |
| 285 | Path makeStorePath(const string & type, | 293 | Path makeStorePath(const string & type, |
| 286 | const Hash & hash, const string & name); | 294 | const Hash & hash, const string & name); |
| 287 | 295 | ||
| 288 | Path makeOutputPath(const string & id, | 296 | Path makeOutputPath(const string & id, |
| 289 | const Hash & hash, const string & name); | 297 | const Hash & hash, const string & name); |
| 290 | 298 | ||
diff --git a/nix/libstore/worker-protocol.hh b/nix/libstore/worker-protocol.hh index 9317f89c376..d037d7402ed 100644 --- a/nix/libstore/worker-protocol.hh +++ b/nix/libstore/worker-protocol.hh | |||
| @@ -12,7 +12,6 @@ namespace nix { | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | typedef enum { | 14 | typedef enum { |
| 15 | wopQuit = 0, | ||
| 16 | wopIsValidPath = 1, | 15 | wopIsValidPath = 1, |
| 17 | wopHasSubstitutes = 3, | 16 | wopHasSubstitutes = 3, |
| 18 | wopQueryPathHash = 4, | 17 | wopQueryPathHash = 4, |
| @@ -43,6 +42,8 @@ typedef enum { | |||
| 43 | wopQueryValidPaths = 31, | 42 | wopQueryValidPaths = 31, |
| 44 | wopQuerySubstitutablePaths = 32, | 43 | wopQuerySubstitutablePaths = 32, |
| 45 | wopQueryValidDerivers = 33, | 44 | wopQueryValidDerivers = 33, |
| 45 | wopOptimiseStore = 34, | ||
| 46 | wopVerifyStore = 35 | ||
| 46 | } WorkerOp; | 47 | } WorkerOp; |
| 47 | 48 | ||
| 48 | 49 | ||
diff --git a/nix/libutil/archive.cc b/nix/libutil/archive.cc index 70a1c580dd1..6856ea0f283 100644 --- a/nix/libutil/archive.cc +++ b/nix/libutil/archive.cc | |||
| @@ -1,10 +1,14 @@ | |||
| 1 | #define _XOPEN_SOURCE 600 | ||
| 2 | |||
| 1 | #include "config.h" | 3 | #include "config.h" |
| 2 | 4 | ||
| 3 | #include <cerrno> | 5 | #include <cerrno> |
| 4 | #include <algorithm> | 6 | #include <algorithm> |
| 5 | #include <vector> | 7 | #include <vector> |
| 8 | #include <map> | ||
| 9 | |||
| 10 | #include <strings.h> // for strcasecmp | ||
| 6 | 11 | ||
| 7 | #define _XOPEN_SOURCE 600 | ||
| 8 | #include <sys/types.h> | 12 | #include <sys/types.h> |
| 9 | #include <sys/stat.h> | 13 | #include <sys/stat.h> |
| 10 | #include <unistd.h> | 14 | #include <unistd.h> |
| @@ -18,39 +22,21 @@ | |||
| 18 | namespace nix { | 22 | namespace nix { |
| 19 | 23 | ||
| 20 | 24 | ||
| 25 | bool useCaseHack = | ||
| 26 | #if __APPLE__ | ||
| 27 | true; | ||
| 28 | #else | ||
| 29 | false; | ||
| 30 | #endif | ||
| 31 | |||
| 21 | static string archiveVersion1 = "nix-archive-1"; | 32 | static string archiveVersion1 = "nix-archive-1"; |
| 22 | 33 | ||
| 34 | static string caseHackSuffix = "~nix~case~hack~"; | ||
| 23 | 35 | ||
| 24 | PathFilter defaultPathFilter; | 36 | PathFilter defaultPathFilter; |
| 25 | 37 | ||
| 26 | 38 | ||
| 27 | static void dump(const string & path, Sink & sink, PathFilter & filter); | 39 | static void dumpContents(const Path & path, size_t size, |
| 28 | |||
| 29 | |||
| 30 | static void dumpEntries(const Path & path, Sink & sink, PathFilter & filter) | ||
| 31 | { | ||
| 32 | Strings names = readDirectory(path); | ||
| 33 | vector<string> names2(names.begin(), names.end()); | ||
| 34 | sort(names2.begin(), names2.end()); | ||
| 35 | |||
| 36 | for (vector<string>::iterator i = names2.begin(); | ||
| 37 | i != names2.end(); ++i) | ||
| 38 | { | ||
| 39 | Path entry = path + "/" + *i; | ||
| 40 | if (filter(entry)) { | ||
| 41 | writeString("entry", sink); | ||
| 42 | writeString("(", sink); | ||
| 43 | writeString("name", sink); | ||
| 44 | writeString(*i, sink); | ||
| 45 | writeString("node", sink); | ||
| 46 | dump(entry, sink, filter); | ||
| 47 | writeString(")", sink); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | static void dumpContents(const Path & path, size_t size, | ||
| 54 | Sink & sink) | 40 | Sink & sink) |
| 55 | { | 41 | { |
| 56 | writeString("contents", sink); | 42 | writeString("contents", sink); |
| @@ -58,7 +44,7 @@ static void dumpContents(const Path & path, size_t size, | |||
| 58 | 44 | ||
| 59 | AutoCloseFD fd = open(path.c_str(), O_RDONLY); | 45 | AutoCloseFD fd = open(path.c_str(), O_RDONLY); |
| 60 | if (fd == -1) throw SysError(format("opening file `%1%'") % path); | 46 | if (fd == -1) throw SysError(format("opening file `%1%'") % path); |
| 61 | 47 | ||
| 62 | unsigned char buf[65536]; | 48 | unsigned char buf[65536]; |
| 63 | size_t left = size; | 49 | size_t left = size; |
| 64 | 50 | ||
| @@ -89,12 +75,40 @@ static void dump(const Path & path, Sink & sink, PathFilter & filter) | |||
| 89 | writeString("", sink); | 75 | writeString("", sink); |
| 90 | } | 76 | } |
| 91 | dumpContents(path, (size_t) st.st_size, sink); | 77 | dumpContents(path, (size_t) st.st_size, sink); |
| 92 | } | 78 | } |
| 93 | 79 | ||
| 94 | else if (S_ISDIR(st.st_mode)) { | 80 | else if (S_ISDIR(st.st_mode)) { |
| 95 | writeString("type", sink); | 81 | writeString("type", sink); |
| 96 | writeString("directory", sink); | 82 | writeString("directory", sink); |
| 97 | dumpEntries(path, sink, filter); | 83 | |
| 84 | /* If we're on a case-insensitive system like Mac OS X, undo | ||
| 85 | the case hack applied by restorePath(). */ | ||
| 86 | std::map<string, string> unhacked; | ||
| 87 | for (auto & i : readDirectory(path)) | ||
| 88 | if (useCaseHack) { | ||
| 89 | string name(i.name); | ||
| 90 | size_t pos = i.name.find(caseHackSuffix); | ||
| 91 | if (pos != string::npos) { | ||
| 92 | printMsg(lvlDebug, format("removing case hack suffix from `%1%'") % (path + "/" + i.name)); | ||
| 93 | name.erase(pos); | ||
| 94 | } | ||
| 95 | if (unhacked.find(name) != unhacked.end()) | ||
| 96 | throw Error(format("file name collision in between `%1%' and `%2%'") | ||
| 97 | % (path + "/" + unhacked[name]) % (path + "/" + i.name)); | ||
| 98 | unhacked[name] = i.name; | ||
| 99 | } else | ||
| 100 | unhacked[i.name] = i.name; | ||
| 101 | |||
| 102 | for (auto & i : unhacked) | ||
| 103 | if (filter(path + "/" + i.first)) { | ||
| 104 | writeString("entry", sink); | ||
| 105 | writeString("(", sink); | ||
| 106 | writeString("name", sink); | ||
| 107 | writeString(i.first, sink); | ||
| 108 | writeString("node", sink); | ||
| 109 | dump(path + "/" + i.second, sink, filter); | ||
| 110 | writeString(")", sink); | ||
| 111 | } | ||
| 98 | } | 112 | } |
| 99 | 113 | ||
| 100 | else if (S_ISLNK(st.st_mode)) { | 114 | else if (S_ISLNK(st.st_mode)) { |
| @@ -123,6 +137,7 @@ static SerialisationError badArchive(string s) | |||
| 123 | } | 137 | } |
| 124 | 138 | ||
| 125 | 139 | ||
| 140 | #if 0 | ||
| 126 | static void skipGeneric(Source & source) | 141 | static void skipGeneric(Source & source) |
| 127 | { | 142 | { |
| 128 | if (readString(source) == "(") { | 143 | if (readString(source) == "(") { |
| @@ -130,43 +145,13 @@ static void skipGeneric(Source & source) | |||
| 130 | skipGeneric(source); | 145 | skipGeneric(source); |
| 131 | } | 146 | } |
| 132 | } | 147 | } |
| 133 | 148 | #endif | |
| 134 | |||
| 135 | static void parse(ParseSink & sink, Source & source, const Path & path); | ||
| 136 | |||
| 137 | |||
| 138 | |||
| 139 | static void parseEntry(ParseSink & sink, Source & source, const Path & path) | ||
| 140 | { | ||
| 141 | string s, name; | ||
| 142 | |||
| 143 | s = readString(source); | ||
| 144 | if (s != "(") throw badArchive("expected open tag"); | ||
| 145 | |||
| 146 | while (1) { | ||
| 147 | checkInterrupt(); | ||
| 148 | |||
| 149 | s = readString(source); | ||
| 150 | |||
| 151 | if (s == ")") { | ||
| 152 | break; | ||
| 153 | } else if (s == "name") { | ||
| 154 | name = readString(source); | ||
| 155 | } else if (s == "node") { | ||
| 156 | if (s == "") throw badArchive("entry name missing"); | ||
| 157 | parse(sink, source, path + "/" + name); | ||
| 158 | } else { | ||
| 159 | throw badArchive("unknown field " + s); | ||
| 160 | skipGeneric(source); | ||
| 161 | } | ||
| 162 | } | ||
| 163 | } | ||
| 164 | 149 | ||
| 165 | 150 | ||
| 166 | static void parseContents(ParseSink & sink, Source & source, const Path & path) | 151 | static void parseContents(ParseSink & sink, Source & source, const Path & path) |
| 167 | { | 152 | { |
| 168 | unsigned long long size = readLongLong(source); | 153 | unsigned long long size = readLongLong(source); |
| 169 | 154 | ||
| 170 | sink.preallocateContents(size); | 155 | sink.preallocateContents(size); |
| 171 | 156 | ||
| 172 | unsigned long long left = size; | 157 | unsigned long long left = size; |
| @@ -185,6 +170,15 @@ static void parseContents(ParseSink & sink, Source & source, const Path & path) | |||
| 185 | } | 170 | } |
| 186 | 171 | ||
| 187 | 172 | ||
| 173 | struct CaseInsensitiveCompare | ||
| 174 | { | ||
| 175 | bool operator() (const string & a, const string & b) const | ||
| 176 | { | ||
| 177 | return strcasecmp(a.c_str(), b.c_str()) < 0; | ||
| 178 | } | ||
| 179 | }; | ||
| 180 | |||
| 181 | |||
| 188 | static void parse(ParseSink & sink, Source & source, const Path & path) | 182 | static void parse(ParseSink & sink, Source & source, const Path & path) |
| 189 | { | 183 | { |
| 190 | string s; | 184 | string s; |
| @@ -194,6 +188,8 @@ static void parse(ParseSink & sink, Source & source, const Path & path) | |||
| 194 | 188 | ||
| 195 | enum { tpUnknown, tpRegular, tpDirectory, tpSymlink } type = tpUnknown; | 189 | enum { tpUnknown, tpRegular, tpDirectory, tpSymlink } type = tpUnknown; |
| 196 | 190 | ||
| 191 | std::map<Path, int, CaseInsensitiveCompare> names; | ||
| 192 | |||
| 197 | while (1) { | 193 | while (1) { |
| 198 | checkInterrupt(); | 194 | checkInterrupt(); |
| 199 | 195 | ||
| @@ -221,9 +217,9 @@ static void parse(ParseSink & sink, Source & source, const Path & path) | |||
| 221 | else if (t == "symlink") { | 217 | else if (t == "symlink") { |
| 222 | type = tpSymlink; | 218 | type = tpSymlink; |
| 223 | } | 219 | } |
| 224 | 220 | ||
| 225 | else throw badArchive("unknown file type " + t); | 221 | else throw badArchive("unknown file type " + t); |
| 226 | 222 | ||
| 227 | } | 223 | } |
| 228 | 224 | ||
| 229 | else if (s == "contents" && type == tpRegular) { | 225 | else if (s == "contents" && type == tpRegular) { |
| @@ -236,7 +232,40 @@ static void parse(ParseSink & sink, Source & source, const Path & path) | |||
| 236 | } | 232 | } |
| 237 | 233 | ||
| 238 | else if (s == "entry" && type == tpDirectory) { | 234 | else if (s == "entry" && type == tpDirectory) { |
| 239 | parseEntry(sink, source, path); | 235 | string name, prevName; |
| 236 | |||
| 237 | s = readString(source); | ||
| 238 | if (s != "(") throw badArchive("expected open tag"); | ||
| 239 | |||
| 240 | while (1) { | ||
| 241 | checkInterrupt(); | ||
| 242 | |||
| 243 | s = readString(source); | ||
| 244 | |||
| 245 | if (s == ")") { | ||
| 246 | break; | ||
| 247 | } else if (s == "name") { | ||
| 248 | name = readString(source); | ||
| 249 | if (name.empty() || name == "." || name == ".." || name.find('/') != string::npos || name.find((char) 0) != string::npos) | ||
| 250 | throw Error(format("NAR contains invalid file name `%1%'") % name); | ||
| 251 | if (name <= prevName) | ||
| 252 | throw Error("NAR directory is not sorted"); | ||
| 253 | prevName = name; | ||
| 254 | if (useCaseHack) { | ||
| 255 | auto i = names.find(name); | ||
| 256 | if (i != names.end()) { | ||
| 257 | printMsg(lvlDebug, format("case collision between `%1%' and `%2%'") % i->first % name); | ||
| 258 | name += caseHackSuffix; | ||
| 259 | name += int2String(++i->second); | ||
| 260 | } else | ||
| 261 | names[name] = 0; | ||
| 262 | } | ||
| 263 | } else if (s == "node") { | ||
| 264 | if (s.empty()) throw badArchive("entry name missing"); | ||
| 265 | parse(sink, source, path + "/" + name); | ||
| 266 | } else | ||
| 267 | throw badArchive("unknown field " + s); | ||
| 268 | } | ||
| 240 | } | 269 | } |
| 241 | 270 | ||
| 242 | else if (s == "target" && type == tpSymlink) { | 271 | else if (s == "target" && type == tpSymlink) { |
| @@ -244,17 +273,15 @@ static void parse(ParseSink & sink, Source & source, const Path & path) | |||
| 244 | sink.createSymlink(path, target); | 273 | sink.createSymlink(path, target); |
| 245 | } | 274 | } |
| 246 | 275 | ||
| 247 | else { | 276 | else |
| 248 | throw badArchive("unknown field " + s); | 277 | throw badArchive("unknown field " + s); |
| 249 | skipGeneric(source); | ||
| 250 | } | ||
| 251 | } | 278 | } |
| 252 | } | 279 | } |
| 253 | 280 | ||
| 254 | 281 | ||
| 255 | void parseDump(ParseSink & sink, Source & source) | 282 | void parseDump(ParseSink & sink, Source & source) |
| 256 | { | 283 | { |
| 257 | string version; | 284 | string version; |
| 258 | try { | 285 | try { |
| 259 | version = readString(source); | 286 | version = readString(source); |
| 260 | } catch (SerialisationError & e) { | 287 | } catch (SerialisationError & e) { |
| @@ -323,7 +350,7 @@ struct RestoreSink : ParseSink | |||
| 323 | } | 350 | } |
| 324 | }; | 351 | }; |
| 325 | 352 | ||
| 326 | 353 | ||
| 327 | void restorePath(const Path & path, Source & source) | 354 | void restorePath(const Path & path, Source & source) |
| 328 | { | 355 | { |
| 329 | RestoreSink sink; | 356 | RestoreSink sink; |
| @@ -331,5 +358,5 @@ void restorePath(const Path & path, Source & source) | |||
| 331 | parseDump(sink, source); | 358 | parseDump(sink, source); |
| 332 | } | 359 | } |
| 333 | 360 | ||
| 334 | 361 | ||
| 335 | } | 362 | } |
diff --git a/nix/libutil/archive.hh b/nix/libutil/archive.hh index ccac92074d5..c216e9768fd 100644 --- a/nix/libutil/archive.hh +++ b/nix/libutil/archive.hh | |||
| @@ -28,7 +28,7 @@ namespace nix { | |||
| 28 | 28 | ||
| 29 | where: | 29 | where: |
| 30 | 30 | ||
| 31 | attrs(as) = concat(map(attr, as)) + encN(0) | 31 | attrs(as) = concat(map(attr, as)) + encN(0) |
| 32 | attrs((a, b)) = encS(a) + encS(b) | 32 | attrs((a, b)) = encS(a) + encS(b) |
| 33 | 33 | ||
| 34 | encS(s) = encN(len(s)) + s + (padding until next 64-bit boundary) | 34 | encS(s) = encN(len(s)) + s + (padding until next 64-bit boundary) |
| @@ -58,7 +58,7 @@ void dumpPath(const Path & path, Sink & sink, | |||
| 58 | struct ParseSink | 58 | struct ParseSink |
| 59 | { | 59 | { |
| 60 | virtual void createDirectory(const Path & path) { }; | 60 | virtual void createDirectory(const Path & path) { }; |
| 61 | 61 | ||
| 62 | virtual void createRegularFile(const Path & path) { }; | 62 | virtual void createRegularFile(const Path & path) { }; |
| 63 | virtual void isExecutable() { }; | 63 | virtual void isExecutable() { }; |
| 64 | virtual void preallocateContents(unsigned long long size) { }; | 64 | virtual void preallocateContents(unsigned long long size) { }; |
| @@ -66,10 +66,14 @@ struct ParseSink | |||
| 66 | 66 | ||
| 67 | virtual void createSymlink(const Path & path, const string & target) { }; | 67 | virtual void createSymlink(const Path & path, const string & target) { }; |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | void parseDump(ParseSink & sink, Source & source); | 70 | void parseDump(ParseSink & sink, Source & source); |
| 71 | 71 | ||
| 72 | void restorePath(const Path & path, Source & source); | 72 | void restorePath(const Path & path, Source & source); |
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | // FIXME: global variables are bad m'kay. | ||
| 76 | extern bool useCaseHack; | ||
| 77 | |||
| 78 | |||
| 75 | } | 79 | } |
diff --git a/nix/libutil/hash.cc b/nix/libutil/hash.cc index 050446610f0..2da00a53de0 100644 --- a/nix/libutil/hash.cc +++ b/nix/libutil/hash.cc | |||
| @@ -84,7 +84,7 @@ string printHash(const Hash & hash) | |||
| 84 | return string(buf, hash.hashSize * 2); | 84 | return string(buf, hash.hashSize * 2); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | Hash parseHash(HashType ht, const string & s) | 88 | Hash parseHash(HashType ht, const string & s) |
| 89 | { | 89 | { |
| 90 | Hash hash(ht); | 90 | Hash hash(ht); |
| @@ -92,7 +92,7 @@ Hash parseHash(HashType ht, const string & s) | |||
| 92 | throw Error(format("invalid hash `%1%'") % s); | 92 | throw Error(format("invalid hash `%1%'") % s); |
| 93 | for (unsigned int i = 0; i < hash.hashSize; i++) { | 93 | for (unsigned int i = 0; i < hash.hashSize; i++) { |
| 94 | string s2(s, i * 2, 2); | 94 | string s2(s, i * 2, 2); |
| 95 | if (!isxdigit(s2[0]) || !isxdigit(s2[1])) | 95 | if (!isxdigit(s2[0]) || !isxdigit(s2[1])) |
| 96 | throw Error(format("invalid hash `%1%'") % s); | 96 | throw Error(format("invalid hash `%1%'") % s); |
| 97 | std::istringstream str(s2); | 97 | std::istringstream str(s2); |
| 98 | int n; | 98 | int n; |
| @@ -103,24 +103,6 @@ Hash parseHash(HashType ht, const string & s) | |||
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | 105 | ||
| 106 | static unsigned char divMod(unsigned char * bytes, unsigned char y) | ||
| 107 | { | ||
| 108 | unsigned int borrow = 0; | ||
| 109 | |||
| 110 | int pos = Hash::maxHashSize - 1; | ||
| 111 | while (pos >= 0 && !bytes[pos]) --pos; | ||
| 112 | |||
| 113 | for ( ; pos >= 0; --pos) { | ||
| 114 | unsigned int s = bytes[pos] + (borrow << 8); | ||
| 115 | unsigned int d = s / y; | ||
| 116 | borrow = s % y; | ||
| 117 | bytes[pos] = d; | ||
| 118 | } | ||
| 119 | |||
| 120 | return borrow; | ||
| 121 | } | ||
| 122 | |||
| 123 | |||
| 124 | unsigned int hashLength32(const Hash & hash) | 106 | unsigned int hashLength32(const Hash & hash) |
| 125 | { | 107 | { |
| 126 | return (hash.hashSize * 8 - 1) / 5 + 1; | 108 | return (hash.hashSize * 8 - 1) / 5 + 1; |
| @@ -136,19 +118,19 @@ string printHash32(const Hash & hash) | |||
| 136 | Hash hash2(hash); | 118 | Hash hash2(hash); |
| 137 | unsigned int len = hashLength32(hash); | 119 | unsigned int len = hashLength32(hash); |
| 138 | 120 | ||
| 139 | const char * chars = base32Chars.data(); | 121 | string s; |
| 140 | 122 | s.reserve(len); | |
| 141 | string s(len, '0'); | 123 | |
| 142 | 124 | for (int n = len - 1; n >= 0; n--) { | |
| 143 | int pos = len - 1; | 125 | unsigned int b = n * 5; |
| 144 | while (pos >= 0) { | 126 | unsigned int i = b / 8; |
| 145 | unsigned char digit = divMod(hash2.hash, 32); | 127 | unsigned int j = b % 8; |
| 146 | s[pos--] = chars[digit]; | 128 | unsigned char c = |
| 129 | (hash.hash[i] >> j) | ||
| 130 | | (i >= hash.hashSize - 1 ? 0 : hash.hash[i + 1] << (8 - j)); | ||
| 131 | s.push_back(base32Chars[c & 0x1f]); | ||
| 147 | } | 132 | } |
| 148 | 133 | ||
| 149 | for (unsigned int i = 0; i < hash2.maxHashSize; ++i) | ||
| 150 | assert(hash2.hash[i] == 0); | ||
| 151 | |||
| 152 | return s; | 134 | return s; |
| 153 | } | 135 | } |
| 154 | 136 | ||
| @@ -159,51 +141,24 @@ string printHash16or32(const Hash & hash) | |||
| 159 | } | 141 | } |
| 160 | 142 | ||
| 161 | 143 | ||
| 162 | static bool mul(unsigned char * bytes, unsigned char y, int maxSize) | ||
| 163 | { | ||
| 164 | unsigned char carry = 0; | ||
| 165 | |||
| 166 | for (int pos = 0; pos < maxSize; ++pos) { | ||
| 167 | unsigned int m = bytes[pos] * y + carry; | ||
| 168 | bytes[pos] = m & 0xff; | ||
| 169 | carry = m >> 8; | ||
| 170 | } | ||
| 171 | |||
| 172 | return carry; | ||
| 173 | } | ||
| 174 | |||
| 175 | |||
| 176 | static bool add(unsigned char * bytes, unsigned char y, int maxSize) | ||
| 177 | { | ||
| 178 | unsigned char carry = y; | ||
| 179 | |||
| 180 | for (int pos = 0; pos < maxSize; ++pos) { | ||
| 181 | unsigned int m = bytes[pos] + carry; | ||
| 182 | bytes[pos] = m & 0xff; | ||
| 183 | carry = m >> 8; | ||
| 184 | if (carry == 0) break; | ||
| 185 | } | ||
| 186 | |||
| 187 | return carry; | ||
| 188 | } | ||
| 189 | |||
| 190 | |||
| 191 | Hash parseHash32(HashType ht, const string & s) | 144 | Hash parseHash32(HashType ht, const string & s) |
| 192 | { | 145 | { |
| 193 | Hash hash(ht); | 146 | Hash hash(ht); |
| 147 | unsigned int len = hashLength32(ht); | ||
| 148 | assert(s.size() == len); | ||
| 194 | 149 | ||
| 195 | const char * chars = base32Chars.data(); | 150 | for (unsigned int n = 0; n < len; ++n) { |
| 196 | 151 | char c = s[len - n - 1]; | |
| 197 | for (unsigned int i = 0; i < s.length(); ++i) { | ||
| 198 | char c = s[i]; | ||
| 199 | unsigned char digit; | 152 | unsigned char digit; |
| 200 | for (digit = 0; digit < base32Chars.size(); ++digit) /* !!! slow */ | 153 | for (digit = 0; digit < base32Chars.size(); ++digit) /* !!! slow */ |
| 201 | if (chars[digit] == c) break; | 154 | if (base32Chars[digit] == c) break; |
| 202 | if (digit >= 32) | 155 | if (digit >= 32) |
| 203 | throw Error(format("invalid base-32 hash `%1%'") % s); | 156 | throw Error(format("invalid base-32 hash '%1%'") % s); |
| 204 | if (mul(hash.hash, 32, hash.hashSize) || | 157 | unsigned int b = n * 5; |
| 205 | add(hash.hash, digit, hash.hashSize)) | 158 | unsigned int i = b / 8; |
| 206 | throw Error(format("base-32 hash `%1%' is too large") % s); | 159 | unsigned int j = b % 8; |
| 160 | hash.hash[i] |= digit << j; | ||
| 161 | if (i < hash.hashSize - 1) hash.hash[i + 1] |= digit >> (8 - j); | ||
| 207 | } | 162 | } |
| 208 | 163 | ||
| 209 | return hash; | 164 | return hash; |
| @@ -299,7 +254,7 @@ Hash hashFile(HashType ht, const Path & path) | |||
| 299 | if (n == -1) throw SysError(format("reading file `%1%'") % path); | 254 | if (n == -1) throw SysError(format("reading file `%1%'") % path); |
| 300 | update(ht, ctx, buf, n); | 255 | update(ht, ctx, buf, n); |
| 301 | } | 256 | } |
| 302 | 257 | ||
| 303 | finish(ht, ctx, hash.hash); | 258 | finish(ht, ctx, hash.hash); |
| 304 | return hash; | 259 | return hash; |
| 305 | } | 260 | } |
| @@ -311,7 +266,7 @@ HashSink::HashSink(HashType ht) : ht(ht) | |||
| 311 | bytes = 0; | 266 | bytes = 0; |
| 312 | start(ht, *ctx); | 267 | start(ht, *ctx); |
| 313 | } | 268 | } |
| 314 | 269 | ||
| 315 | HashSink::~HashSink() | 270 | HashSink::~HashSink() |
| 316 | { | 271 | { |
| 317 | bufPos = 0; | 272 | bufPos = 0; |
| @@ -369,7 +324,7 @@ HashType parseHashType(const string & s) | |||
| 369 | else return htUnknown; | 324 | else return htUnknown; |
| 370 | } | 325 | } |
| 371 | 326 | ||
| 372 | 327 | ||
| 373 | string printHashType(HashType ht) | 328 | string printHashType(HashType ht) |
| 374 | { | 329 | { |
| 375 | if (ht == htMD5) return "md5"; | 330 | if (ht == htMD5) return "md5"; |
| @@ -378,5 +333,5 @@ string printHashType(HashType ht) | |||
| 378 | else throw Error("cannot print unknown hash type"); | 333 | else throw Error("cannot print unknown hash type"); |
| 379 | } | 334 | } |
| 380 | 335 | ||
| 381 | 336 | ||
| 382 | } | 337 | } |
diff --git a/nix/libutil/serialise.cc b/nix/libutil/serialise.cc index 6b71f52c151..92417507508 100644 --- a/nix/libutil/serialise.cc +++ b/nix/libutil/serialise.cc | |||
| @@ -54,8 +54,24 @@ FdSink::~FdSink() | |||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | size_t threshold = 256 * 1024 * 1024; | ||
| 58 | |||
| 59 | static void warnLargeDump() | ||
| 60 | { | ||
| 61 | printMsg(lvlError, "warning: dumping very large path (> 256 MiB); this may run out of memory"); | ||
| 62 | } | ||
| 63 | |||
| 64 | |||
| 57 | void FdSink::write(const unsigned char * data, size_t len) | 65 | void FdSink::write(const unsigned char * data, size_t len) |
| 58 | { | 66 | { |
| 67 | static bool warned = false; | ||
| 68 | if (warn && !warned) { | ||
| 69 | written += len; | ||
| 70 | if (written > threshold) { | ||
| 71 | warnLargeDump(); | ||
| 72 | warned = true; | ||
| 73 | } | ||
| 74 | } | ||
| 59 | writeFull(fd, data, len); | 75 | writeFull(fd, data, len); |
| 60 | } | 76 | } |
| 61 | 77 | ||
| @@ -256,4 +272,15 @@ template Paths readStrings(Source & source); | |||
| 256 | template PathSet readStrings(Source & source); | 272 | template PathSet readStrings(Source & source); |
| 257 | 273 | ||
| 258 | 274 | ||
| 275 | void StringSink::operator () (const unsigned char * data, size_t len) | ||
| 276 | { | ||
| 277 | static bool warned = false; | ||
| 278 | if (!warned && s.size() > threshold) { | ||
| 279 | warnLargeDump(); | ||
| 280 | warned = true; | ||
| 281 | } | ||
| 282 | s.append((const char *) data, len); | ||
| 283 | } | ||
| 284 | |||
| 285 | |||
| 259 | } | 286 | } |
diff --git a/nix/libutil/serialise.hh b/nix/libutil/serialise.hh index e5a9df1d050..6a6f028aa65 100644 --- a/nix/libutil/serialise.hh +++ b/nix/libutil/serialise.hh | |||
| @@ -72,9 +72,11 @@ struct BufferedSource : Source | |||
| 72 | struct FdSink : BufferedSink | 72 | struct FdSink : BufferedSink |
| 73 | { | 73 | { |
| 74 | int fd; | 74 | int fd; |
| 75 | bool warn; | ||
| 76 | size_t written; | ||
| 75 | 77 | ||
| 76 | FdSink() : fd(-1) { } | 78 | FdSink() : fd(-1), warn(false), written(0) { } |
| 77 | FdSink(int fd) : fd(fd) { } | 79 | FdSink(int fd) : fd(fd), warn(false), written(0) { } |
| 78 | ~FdSink(); | 80 | ~FdSink(); |
| 79 | 81 | ||
| 80 | void write(const unsigned char * data, size_t len); | 82 | void write(const unsigned char * data, size_t len); |
| @@ -95,10 +97,7 @@ struct FdSource : BufferedSource | |||
| 95 | struct StringSink : Sink | 97 | struct StringSink : Sink |
| 96 | { | 98 | { |
| 97 | string s; | 99 | string s; |
| 98 | void operator () (const unsigned char * data, size_t len) | 100 | void operator () (const unsigned char * data, size_t len); |
| 99 | { | ||
| 100 | s.append((const char *) data, len); | ||
| 101 | } | ||
| 102 | }; | 101 | }; |
| 103 | 102 | ||
| 104 | 103 | ||
diff --git a/nix/libutil/types.hh b/nix/libutil/types.hh index 4b5ce9a78c4..160884ee1ad 100644 --- a/nix/libutil/types.hh +++ b/nix/libutil/types.hh | |||
| @@ -8,6 +8,15 @@ | |||
| 8 | 8 | ||
| 9 | #include <boost/format.hpp> | 9 | #include <boost/format.hpp> |
| 10 | 10 | ||
| 11 | /* Before 4.7, gcc's std::exception uses empty throw() specifiers for | ||
| 12 | * its (virtual) destructor and what() in c++11 mode, in violation of spec | ||
| 13 | */ | ||
| 14 | #ifdef __GNUC__ | ||
| 15 | #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) | ||
| 16 | #define EXCEPTION_NEEDS_THROW_SPEC | ||
| 17 | #endif | ||
| 18 | #endif | ||
| 19 | |||
| 11 | 20 | ||
| 12 | namespace nix { | 21 | namespace nix { |
| 13 | 22 | ||
| @@ -39,10 +48,14 @@ protected: | |||
| 39 | public: | 48 | public: |
| 40 | unsigned int status; // exit status | 49 | unsigned int status; // exit status |
| 41 | BaseError(const FormatOrString & fs, unsigned int status = 1); | 50 | BaseError(const FormatOrString & fs, unsigned int status = 1); |
| 51 | #ifdef EXCEPTION_NEEDS_THROW_SPEC | ||
| 42 | ~BaseError() throw () { }; | 52 | ~BaseError() throw () { }; |
| 43 | const char * what() const throw () { return err.c_str(); } | 53 | const char * what() const throw () { return err.c_str(); } |
| 44 | const string & msg() const throw () { return err; } | 54 | #else |
| 45 | const string & prefix() const throw () { return prefix_; } | 55 | const char * what() const noexcept { return err.c_str(); } |
| 56 | #endif | ||
| 57 | const string & msg() const { return err; } | ||
| 58 | const string & prefix() const { return prefix_; } | ||
| 46 | BaseError & addPrefix(const FormatOrString & fs); | 59 | BaseError & addPrefix(const FormatOrString & fs); |
| 47 | }; | 60 | }; |
| 48 | 61 | ||
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc index 846674a29d9..dab4235b04f 100644 --- a/nix/libutil/util.cc +++ b/nix/libutil/util.cc | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | #include "config.h" | 1 | #include "config.h" |
| 2 | 2 | ||
| 3 | #include "util.hh" | ||
| 4 | #include "affinity.hh" | ||
| 5 | |||
| 3 | #include <iostream> | 6 | #include <iostream> |
| 4 | #include <cerrno> | 7 | #include <cerrno> |
| 5 | #include <cstdio> | 8 | #include <cstdio> |
| @@ -16,7 +19,9 @@ | |||
| 16 | #include <sys/syscall.h> | 19 | #include <sys/syscall.h> |
| 17 | #endif | 20 | #endif |
| 18 | 21 | ||
| 19 | #include "util.hh" | 22 | #ifdef __linux__ |
| 23 | #include <sys/prctl.h> | ||
| 24 | #endif | ||
| 20 | 25 | ||
| 21 | 26 | ||
| 22 | extern char * * environ; | 27 | extern char * * environ; |
| @@ -125,7 +130,6 @@ Path canonPath(const Path & path, bool resolveSymlinks) | |||
| 125 | i = temp.begin(); /* restart */ | 130 | i = temp.begin(); /* restart */ |
| 126 | end = temp.end(); | 131 | end = temp.end(); |
| 127 | s = ""; | 132 | s = ""; |
| 128 | /* !!! potential for infinite loop */ | ||
| 129 | } | 133 | } |
| 130 | } | 134 | } |
| 131 | } | 135 | } |
| @@ -189,8 +193,12 @@ Path readLink(const Path & path) | |||
| 189 | if (!S_ISLNK(st.st_mode)) | 193 | if (!S_ISLNK(st.st_mode)) |
| 190 | throw Error(format("`%1%' is not a symlink") % path); | 194 | throw Error(format("`%1%' is not a symlink") % path); |
| 191 | char buf[st.st_size]; | 195 | char buf[st.st_size]; |
| 192 | if (readlink(path.c_str(), buf, st.st_size) != st.st_size) | 196 | ssize_t rlsize = readlink(path.c_str(), buf, st.st_size); |
| 193 | throw SysError(format("reading symbolic link `%1%'") % path); | 197 | if (rlsize == -1) |
| 198 | throw SysError(format("reading symbolic link '%1%'") % path); | ||
| 199 | else if (rlsize > st.st_size) | ||
| 200 | throw Error(format("symbolic link ‘%1%’ size overflow %2% > %3%") | ||
| 201 | % path % rlsize % st.st_size); | ||
| 194 | return string(buf, st.st_size); | 202 | return string(buf, st.st_size); |
| 195 | } | 203 | } |
| 196 | 204 | ||
| @@ -202,9 +210,10 @@ bool isLink(const Path & path) | |||
| 202 | } | 210 | } |
| 203 | 211 | ||
| 204 | 212 | ||
| 205 | Strings readDirectory(const Path & path) | 213 | DirEntries readDirectory(const Path & path) |
| 206 | { | 214 | { |
| 207 | Strings names; | 215 | DirEntries entries; |
| 216 | entries.reserve(64); | ||
| 208 | 217 | ||
| 209 | AutoCloseDir dir = opendir(path.c_str()); | 218 | AutoCloseDir dir = opendir(path.c_str()); |
| 210 | if (!dir) throw SysError(format("opening directory `%1%'") % path); | 219 | if (!dir) throw SysError(format("opening directory `%1%'") % path); |
| @@ -214,11 +223,21 @@ Strings readDirectory(const Path & path) | |||
| 214 | checkInterrupt(); | 223 | checkInterrupt(); |
| 215 | string name = dirent->d_name; | 224 | string name = dirent->d_name; |
| 216 | if (name == "." || name == "..") continue; | 225 | if (name == "." || name == "..") continue; |
| 217 | names.push_back(name); | 226 | entries.emplace_back(name, dirent->d_ino, dirent->d_type); |
| 218 | } | 227 | } |
| 219 | if (errno) throw SysError(format("reading directory `%1%'") % path); | 228 | if (errno) throw SysError(format("reading directory `%1%'") % path); |
| 220 | 229 | ||
| 221 | return names; | 230 | return entries; |
| 231 | } | ||
| 232 | |||
| 233 | |||
| 234 | unsigned char getFileType(const Path & path) | ||
| 235 | { | ||
| 236 | struct stat st = lstat(path); | ||
| 237 | if (S_ISDIR(st.st_mode)) return DT_DIR; | ||
| 238 | if (S_ISLNK(st.st_mode)) return DT_LNK; | ||
| 239 | if (S_ISREG(st.st_mode)) return DT_REG; | ||
| 240 | return DT_UNKNOWN; | ||
| 222 | } | 241 | } |
| 223 | 242 | ||
| 224 | 243 | ||
| @@ -249,8 +268,8 @@ void writeFile(const Path & path, const string & s) | |||
| 249 | { | 268 | { |
| 250 | AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0666); | 269 | AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0666); |
| 251 | if (fd == -1) | 270 | if (fd == -1) |
| 252 | throw SysError(format("opening file `%1%'") % path); | 271 | throw SysError(format("opening file '%1%'") % path); |
| 253 | writeFull(fd, (unsigned char *) s.data(), s.size()); | 272 | writeFull(fd, s); |
| 254 | } | 273 | } |
| 255 | 274 | ||
| 256 | 275 | ||
| @@ -277,7 +296,7 @@ string readLine(int fd) | |||
| 277 | void writeLine(int fd, string s) | 296 | void writeLine(int fd, string s) |
| 278 | { | 297 | { |
| 279 | s += '\n'; | 298 | s += '\n'; |
| 280 | writeFull(fd, (const unsigned char *) s.data(), s.size()); | 299 | writeFull(fd, s); |
| 281 | } | 300 | } |
| 282 | 301 | ||
| 283 | 302 | ||
| @@ -293,16 +312,14 @@ static void _deletePath(const Path & path, unsigned long long & bytesFreed) | |||
| 293 | bytesFreed += st.st_blocks * 512; | 312 | bytesFreed += st.st_blocks * 512; |
| 294 | 313 | ||
| 295 | if (S_ISDIR(st.st_mode)) { | 314 | if (S_ISDIR(st.st_mode)) { |
| 296 | Strings names = readDirectory(path); | ||
| 297 | |||
| 298 | /* Make the directory writable. */ | 315 | /* Make the directory writable. */ |
| 299 | if (!(st.st_mode & S_IWUSR)) { | 316 | if (!(st.st_mode & S_IWUSR)) { |
| 300 | if (chmod(path.c_str(), st.st_mode | S_IWUSR) == -1) | 317 | if (chmod(path.c_str(), st.st_mode | S_IWUSR) == -1) |
| 301 | throw SysError(format("making `%1%' writable") % path); | 318 | throw SysError(format("making `%1%' writable") % path); |
| 302 | } | 319 | } |
| 303 | 320 | ||
| 304 | for (Strings::iterator i = names.begin(); i != names.end(); ++i) | 321 | for (auto & i : readDirectory(path)) |
| 305 | _deletePath(path + "/" + *i, bytesFreed); | 322 | _deletePath(path + "/" + i.name, bytesFreed); |
| 306 | } | 323 | } |
| 307 | 324 | ||
| 308 | if (remove(path.c_str()) == -1) | 325 | if (remove(path.c_str()) == -1) |
| @@ -380,6 +397,9 @@ Paths createDirs(const Path & path) | |||
| 380 | created.push_back(path); | 397 | created.push_back(path); |
| 381 | } | 398 | } |
| 382 | 399 | ||
| 400 | if (S_ISLNK(st.st_mode) && stat(path.c_str(), &st) == -1) | ||
| 401 | throw SysError(format("statting symlink `%1%'") % path); | ||
| 402 | |||
| 383 | if (!S_ISDIR(st.st_mode)) throw Error(format("`%1%' is not a directory") % path); | 403 | if (!S_ISDIR(st.st_mode)) throw Error(format("`%1%' is not a directory") % path); |
| 384 | 404 | ||
| 385 | return created; | 405 | return created; |
| @@ -469,7 +489,10 @@ void warnOnce(bool & haveWarned, const FormatOrString & fs) | |||
| 469 | void writeToStderr(const string & s) | 489 | void writeToStderr(const string & s) |
| 470 | { | 490 | { |
| 471 | try { | 491 | try { |
| 472 | _writeToStderr((const unsigned char *) s.data(), s.size()); | 492 | if (_writeToStderr) |
| 493 | _writeToStderr((const unsigned char *) s.data(), s.size()); | ||
| 494 | else | ||
| 495 | writeFull(STDERR_FILENO, s); | ||
| 473 | } catch (SysError & e) { | 496 | } catch (SysError & e) { |
| 474 | /* Ignore failing writes to stderr if we're in an exception | 497 | /* Ignore failing writes to stderr if we're in an exception |
| 475 | handler, otherwise throw an exception. We need to ignore | 498 | handler, otherwise throw an exception. We need to ignore |
| @@ -481,13 +504,7 @@ void writeToStderr(const string & s) | |||
| 481 | } | 504 | } |
| 482 | 505 | ||
| 483 | 506 | ||
| 484 | static void defaultWriteToStderr(const unsigned char * buf, size_t count) | 507 | void (*_writeToStderr) (const unsigned char * buf, size_t count) = 0; |
| 485 | { | ||
| 486 | writeFull(STDERR_FILENO, buf, count); | ||
| 487 | } | ||
| 488 | |||
| 489 | |||
| 490 | void (*_writeToStderr) (const unsigned char * buf, size_t count) = defaultWriteToStderr; | ||
| 491 | 508 | ||
| 492 | 509 | ||
| 493 | void readFull(int fd, unsigned char * buf, size_t count) | 510 | void readFull(int fd, unsigned char * buf, size_t count) |
| @@ -521,6 +538,12 @@ void writeFull(int fd, const unsigned char * buf, size_t count) | |||
| 521 | } | 538 | } |
| 522 | 539 | ||
| 523 | 540 | ||
| 541 | void writeFull(int fd, const string & s) | ||
| 542 | { | ||
| 543 | writeFull(fd, (const unsigned char *) s.data(), s.size()); | ||
| 544 | } | ||
| 545 | |||
| 546 | |||
| 524 | string drainFD(int fd) | 547 | string drainFD(int fd) |
| 525 | { | 548 | { |
| 526 | string result; | 549 | string result; |
| @@ -707,10 +730,14 @@ void AutoCloseDir::close() | |||
| 707 | 730 | ||
| 708 | 731 | ||
| 709 | Pid::Pid() | 732 | Pid::Pid() |
| 733 | : pid(-1), separatePG(false), killSignal(SIGKILL) | ||
| 734 | { | ||
| 735 | } | ||
| 736 | |||
| 737 | |||
| 738 | Pid::Pid(pid_t pid) | ||
| 739 | : pid(pid), separatePG(false), killSignal(SIGKILL) | ||
| 710 | { | 740 | { |
| 711 | pid = -1; | ||
| 712 | separatePG = false; | ||
| 713 | killSignal = SIGKILL; | ||
| 714 | } | 741 | } |
| 715 | 742 | ||
| 716 | 743 | ||
| @@ -734,11 +761,12 @@ Pid::operator pid_t() | |||
| 734 | } | 761 | } |
| 735 | 762 | ||
| 736 | 763 | ||
| 737 | void Pid::kill() | 764 | void Pid::kill(bool quiet) |
| 738 | { | 765 | { |
| 739 | if (pid == -1 || pid == 0) return; | 766 | if (pid == -1 || pid == 0) return; |
| 740 | 767 | ||
| 741 | printMsg(lvlError, format("killing process %1%") % pid); | 768 | if (!quiet) |
| 769 | printMsg(lvlError, format("killing process %1%") % pid); | ||
| 742 | 770 | ||
| 743 | /* Send the requested signal to the child. If it has its own | 771 | /* Send the requested signal to the child. If it has its own |
| 744 | process group, send the signal to every process in the child | 772 | process group, send the signal to every process in the child |
| @@ -801,43 +829,30 @@ void killUser(uid_t uid) | |||
| 801 | users to which the current process can send signals. So we | 829 | users to which the current process can send signals. So we |
| 802 | fork a process, switch to uid, and send a mass kill. */ | 830 | fork a process, switch to uid, and send a mass kill. */ |
| 803 | 831 | ||
| 804 | Pid pid; | 832 | Pid pid = startProcess([&]() { |
| 805 | pid = fork(); | ||
| 806 | switch (pid) { | ||
| 807 | |||
| 808 | case -1: | ||
| 809 | throw SysError("unable to fork"); | ||
| 810 | |||
| 811 | case 0: | ||
| 812 | try { /* child */ | ||
| 813 | 833 | ||
| 814 | if (setuid(uid) == -1) | 834 | if (setuid(uid) == -1) |
| 815 | throw SysError("setting uid"); | 835 | throw SysError("setting uid"); |
| 816 | 836 | ||
| 817 | while (true) { | 837 | while (true) { |
| 818 | #ifdef __APPLE__ | 838 | #ifdef __APPLE__ |
| 819 | /* OSX's kill syscall takes a third parameter that, among other | 839 | /* OSX's kill syscall takes a third parameter that, among |
| 820 | things, determines if kill(-1, signo) affects the calling | 840 | other things, determines if kill(-1, signo) affects the |
| 821 | process. In the OSX libc, it's set to true, which means | 841 | calling process. In the OSX libc, it's set to true, |
| 822 | "follow POSIX", which we don't want here | 842 | which means "follow POSIX", which we don't want here |
| 823 | */ | 843 | */ |
| 824 | if (syscall(SYS_kill, -1, SIGKILL, false) == 0) break; | 844 | if (syscall(SYS_kill, -1, SIGKILL, false) == 0) break; |
| 825 | #else | 845 | #else |
| 826 | if (kill(-1, SIGKILL) == 0) break; | 846 | if (kill(-1, SIGKILL) == 0) break; |
| 827 | #endif | 847 | #endif |
| 828 | if (errno == ESRCH) break; /* no more processes */ | 848 | if (errno == ESRCH) break; /* no more processes */ |
| 829 | if (errno != EINTR) | 849 | if (errno != EINTR) |
| 830 | throw SysError(format("cannot kill processes for uid `%1%'") % uid); | 850 | throw SysError(format("cannot kill processes for uid `%1%'") % uid); |
| 831 | } | ||
| 832 | |||
| 833 | } catch (std::exception & e) { | ||
| 834 | writeToStderr((format("killing processes belonging to uid `%1%': %2%\n") % uid % e.what()).str()); | ||
| 835 | _exit(1); | ||
| 836 | } | 851 | } |
| 852 | |||
| 837 | _exit(0); | 853 | _exit(0); |
| 838 | } | 854 | }); |
| 839 | 855 | ||
| 840 | /* parent */ | ||
| 841 | int status = pid.wait(true); | 856 | int status = pid.wait(true); |
| 842 | if (status != 0) | 857 | if (status != 0) |
| 843 | throw Error(format("cannot kill processes for uid `%1%': %2%") % uid % statusToString(status)); | 858 | throw Error(format("cannot kill processes for uid `%1%': %2%") % uid % statusToString(status)); |
| @@ -852,47 +867,69 @@ void killUser(uid_t uid) | |||
| 852 | ////////////////////////////////////////////////////////////////////// | 867 | ////////////////////////////////////////////////////////////////////// |
| 853 | 868 | ||
| 854 | 869 | ||
| 870 | pid_t startProcess(std::function<void()> fun, | ||
| 871 | bool dieWithParent, const string & errorPrefix, bool runExitHandlers) | ||
| 872 | { | ||
| 873 | pid_t pid = fork(); | ||
| 874 | if (pid == -1) throw SysError("unable to fork"); | ||
| 875 | |||
| 876 | if (pid == 0) { | ||
| 877 | _writeToStderr = 0; | ||
| 878 | try { | ||
| 879 | #if __linux__ | ||
| 880 | if (dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1) | ||
| 881 | throw SysError("setting death signal"); | ||
| 882 | #endif | ||
| 883 | restoreAffinity(); | ||
| 884 | fun(); | ||
| 885 | } catch (std::exception & e) { | ||
| 886 | try { | ||
| 887 | std::cerr << errorPrefix << e.what() << "\n"; | ||
| 888 | } catch (...) { } | ||
| 889 | } catch (...) { } | ||
| 890 | if (runExitHandlers) | ||
| 891 | exit(1); | ||
| 892 | else | ||
| 893 | _exit(1); | ||
| 894 | } | ||
| 895 | |||
| 896 | return pid; | ||
| 897 | } | ||
| 898 | |||
| 899 | |||
| 900 | std::vector<const char *> stringsToCharPtrs(const Strings & ss) | ||
| 901 | { | ||
| 902 | std::vector<const char *> res; | ||
| 903 | for (auto & s : ss) res.push_back(s.c_str()); | ||
| 904 | res.push_back(0); | ||
| 905 | return res; | ||
| 906 | } | ||
| 907 | |||
| 908 | |||
| 855 | string runProgram(Path program, bool searchPath, const Strings & args) | 909 | string runProgram(Path program, bool searchPath, const Strings & args) |
| 856 | { | 910 | { |
| 857 | checkInterrupt(); | 911 | checkInterrupt(); |
| 858 | 912 | ||
| 859 | std::vector<const char *> cargs; /* careful with c_str()! */ | ||
| 860 | cargs.push_back(program.c_str()); | ||
| 861 | for (Strings::const_iterator i = args.begin(); i != args.end(); ++i) | ||
| 862 | cargs.push_back(i->c_str()); | ||
| 863 | cargs.push_back(0); | ||
| 864 | |||
| 865 | /* Create a pipe. */ | 913 | /* Create a pipe. */ |
| 866 | Pipe pipe; | 914 | Pipe pipe; |
| 867 | pipe.create(); | 915 | pipe.create(); |
| 868 | 916 | ||
| 869 | /* Fork. */ | 917 | /* Fork. */ |
| 870 | Pid pid; | 918 | Pid pid = startProcess([&]() { |
| 871 | pid = maybeVfork(); | 919 | if (dup2(pipe.writeSide, STDOUT_FILENO) == -1) |
| 872 | 920 | throw SysError("dupping stdout"); | |
| 873 | switch (pid) { | ||
| 874 | |||
| 875 | case -1: | ||
| 876 | throw SysError("unable to fork"); | ||
| 877 | |||
| 878 | case 0: /* child */ | ||
| 879 | try { | ||
| 880 | if (dup2(pipe.writeSide, STDOUT_FILENO) == -1) | ||
| 881 | throw SysError("dupping stdout"); | ||
| 882 | 921 | ||
| 883 | if (searchPath) | 922 | Strings args_(args); |
| 884 | execvp(program.c_str(), (char * *) &cargs[0]); | 923 | args_.push_front(program); |
| 885 | else | 924 | auto cargs = stringsToCharPtrs(args_); |
| 886 | execv(program.c_str(), (char * *) &cargs[0]); | ||
| 887 | throw SysError(format("executing `%1%'") % program); | ||
| 888 | 925 | ||
| 889 | } catch (std::exception & e) { | 926 | if (searchPath) |
| 890 | writeToStderr("error: " + string(e.what()) + "\n"); | 927 | execvp(program.c_str(), (char * *) &cargs[0]); |
| 891 | } | 928 | else |
| 892 | _exit(1); | 929 | execv(program.c_str(), (char * *) &cargs[0]); |
| 893 | } | ||
| 894 | 930 | ||
| 895 | /* Parent. */ | 931 | throw SysError(format("executing `%1%'") % program); |
| 932 | }); | ||
| 896 | 933 | ||
| 897 | pipe.writeSide.close(); | 934 | pipe.writeSide.close(); |
| 898 | 935 | ||
| @@ -901,7 +938,7 @@ string runProgram(Path program, bool searchPath, const Strings & args) | |||
| 901 | /* Wait for the child to finish. */ | 938 | /* Wait for the child to finish. */ |
| 902 | int status = pid.wait(true); | 939 | int status = pid.wait(true); |
| 903 | if (!statusOk(status)) | 940 | if (!statusOk(status)) |
| 904 | throw Error(format("program `%1%' %2%") | 941 | throw ExecError(format("program `%1%' %2%") |
| 905 | % program % statusToString(status)); | 942 | % program % statusToString(status)); |
| 906 | 943 | ||
| 907 | return result; | 944 | return result; |
| @@ -928,13 +965,6 @@ void closeOnExec(int fd) | |||
| 928 | } | 965 | } |
| 929 | 966 | ||
| 930 | 967 | ||
| 931 | #if HAVE_VFORK | ||
| 932 | pid_t (*maybeVfork)() = vfork; | ||
| 933 | #else | ||
| 934 | pid_t (*maybeVfork)() = fork; | ||
| 935 | #endif | ||
| 936 | |||
| 937 | |||
| 938 | ////////////////////////////////////////////////////////////////////// | 968 | ////////////////////////////////////////////////////////////////////// |
| 939 | 969 | ||
| 940 | 970 | ||
diff --git a/nix/libutil/util.hh b/nix/libutil/util.hh index ce2d77c19a4..6a84ed88518 100644 --- a/nix/libutil/util.hh +++ b/nix/libutil/util.hh | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <dirent.h> | 7 | #include <dirent.h> |
| 8 | #include <unistd.h> | 8 | #include <unistd.h> |
| 9 | #include <signal.h> | 9 | #include <signal.h> |
| 10 | #include <functional> | ||
| 10 | 11 | ||
| 11 | #include <cstdio> | 12 | #include <cstdio> |
| 12 | 13 | ||
| @@ -63,7 +64,20 @@ bool isLink(const Path & path); | |||
| 63 | 64 | ||
| 64 | /* Read the contents of a directory. The entries `.' and `..' are | 65 | /* Read the contents of a directory. The entries `.' and `..' are |
| 65 | removed. */ | 66 | removed. */ |
| 66 | Strings readDirectory(const Path & path); | 67 | struct DirEntry |
| 68 | { | ||
| 69 | string name; | ||
| 70 | ino_t ino; | ||
| 71 | unsigned char type; // one of DT_* | ||
| 72 | DirEntry(const string & name, ino_t ino, unsigned char type) | ||
| 73 | : name(name), ino(ino), type(type) { } | ||
| 74 | }; | ||
| 75 | |||
| 76 | typedef vector<DirEntry> DirEntries; | ||
| 77 | |||
| 78 | DirEntries readDirectory(const Path & path); | ||
| 79 | |||
| 80 | unsigned char getFileType(const Path & path); | ||
| 67 | 81 | ||
| 68 | /* Read the contents of a file into a string. */ | 82 | /* Read the contents of a file into a string. */ |
| 69 | string readFile(int fd); | 83 | string readFile(int fd); |
| @@ -157,6 +171,7 @@ extern void (*_writeToStderr) (const unsigned char * buf, size_t count); | |||
| 157 | requested number of bytes. */ | 171 | requested number of bytes. */ |
| 158 | void readFull(int fd, unsigned char * buf, size_t count); | 172 | void readFull(int fd, unsigned char * buf, size_t count); |
| 159 | void writeFull(int fd, const unsigned char * buf, size_t count); | 173 | void writeFull(int fd, const unsigned char * buf, size_t count); |
| 174 | void writeFull(int fd, const string & s); | ||
| 160 | 175 | ||
| 161 | MakeError(EndOfFile, Error) | 176 | MakeError(EndOfFile, Error) |
| 162 | 177 | ||
| @@ -237,10 +252,11 @@ class Pid | |||
| 237 | int killSignal; | 252 | int killSignal; |
| 238 | public: | 253 | public: |
| 239 | Pid(); | 254 | Pid(); |
| 255 | Pid(pid_t pid); | ||
| 240 | ~Pid(); | 256 | ~Pid(); |
| 241 | void operator =(pid_t pid); | 257 | void operator =(pid_t pid); |
| 242 | operator pid_t(); | 258 | operator pid_t(); |
| 243 | void kill(); | 259 | void kill(bool quiet = false); |
| 244 | int wait(bool block); | 260 | int wait(bool block); |
| 245 | void setSeparatePG(bool separatePG); | 261 | void setSeparatePG(bool separatePG); |
| 246 | void setKillSignal(int signal); | 262 | void setKillSignal(int signal); |
| @@ -252,11 +268,24 @@ public: | |||
| 252 | void killUser(uid_t uid); | 268 | void killUser(uid_t uid); |
| 253 | 269 | ||
| 254 | 270 | ||
| 271 | /* Fork a process that runs the given function, and return the child | ||
| 272 | pid to the caller. */ | ||
| 273 | pid_t startProcess(std::function<void()> fun, bool dieWithParent = true, | ||
| 274 | const string & errorPrefix = "error: ", bool runExitHandlers = false); | ||
| 275 | |||
| 276 | |||
| 255 | /* Run a program and return its stdout in a string (i.e., like the | 277 | /* Run a program and return its stdout in a string (i.e., like the |
| 256 | shell backtick operator). */ | 278 | shell backtick operator). */ |
| 257 | string runProgram(Path program, bool searchPath = false, | 279 | string runProgram(Path program, bool searchPath = false, |
| 258 | const Strings & args = Strings()); | 280 | const Strings & args = Strings()); |
| 259 | 281 | ||
| 282 | MakeError(ExecError, Error) | ||
| 283 | |||
| 284 | /* Convert a list of strings to a null-terminated vector of char | ||
| 285 | *'s. The result must not be accessed beyond the lifetime of the | ||
| 286 | list of strings. */ | ||
| 287 | std::vector<const char *> stringsToCharPtrs(const Strings & ss); | ||
| 288 | |||
| 260 | /* Close all file descriptors except stdin, stdout, stderr, and those | 289 | /* Close all file descriptors except stdin, stdout, stderr, and those |
| 261 | listed in the given set. Good practice in child processes. */ | 290 | listed in the given set. Good practice in child processes. */ |
| 262 | void closeMostFDs(const set<int> & exceptions); | 291 | void closeMostFDs(const set<int> & exceptions); |
| @@ -264,9 +293,6 @@ void closeMostFDs(const set<int> & exceptions); | |||
| 264 | /* Set the close-on-exec flag for the given file descriptor. */ | 293 | /* Set the close-on-exec flag for the given file descriptor. */ |
| 265 | void closeOnExec(int fd); | 294 | void closeOnExec(int fd); |
| 266 | 295 | ||
| 267 | /* Call vfork() if available, otherwise fork(). */ | ||
| 268 | extern pid_t (*maybeVfork)(); | ||
| 269 | |||
| 270 | 296 | ||
| 271 | /* User interruption. */ | 297 | /* User interruption. */ |
| 272 | 298 | ||
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index f096ed5a972..1934487d241 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc | |||
| @@ -33,6 +33,9 @@ | |||
| 33 | #include <strings.h> | 33 | #include <strings.h> |
| 34 | #include <exception> | 34 | #include <exception> |
| 35 | 35 | ||
| 36 | #include <libintl.h> | ||
| 37 | #include <locale.h> | ||
| 38 | |||
| 36 | /* Variables used by `nix-daemon.cc'. */ | 39 | /* Variables used by `nix-daemon.cc'. */ |
| 37 | volatile ::sig_atomic_t blockInt; | 40 | volatile ::sig_atomic_t blockInt; |
| 38 | char **argvSaved; | 41 | char **argvSaved; |
| @@ -45,16 +48,21 @@ extern void run (Strings args); | |||
| 45 | 48 | ||
| 46 | /* Command-line options. */ | 49 | /* Command-line options. */ |
| 47 | 50 | ||
| 51 | #define n_(str) str | ||
| 52 | #define _(str) gettext (str) | ||
| 53 | static const char guix_textdomain[] = "guix"; | ||
| 54 | |||
| 55 | |||
| 48 | const char *argp_program_version = | 56 | const char *argp_program_version = |
| 49 | "guix-daemon (" PACKAGE_NAME ") " PACKAGE_VERSION; | 57 | "guix-daemon (" PACKAGE_NAME ") " PACKAGE_VERSION; |
| 50 | const char *argp_program_bug_address = PACKAGE_BUGREPORT; | 58 | const char *argp_program_bug_address = PACKAGE_BUGREPORT; |
| 51 | 59 | ||
| 52 | static char doc[] = | 60 | static char doc[] = |
| 53 | "guix-daemon -- perform derivation builds and store accesses\ | 61 | n_("guix-daemon -- perform derivation builds and store accesses") |
| 54 | \v\ | 62 | "\v\n" |
| 55 | This program is a daemon meant to run in the background. It serves \ | 63 | n_("This program is a daemon meant to run in the background. It serves \ |
| 56 | requests sent over a Unix-domain socket. It accesses the store, and \ | 64 | requests sent over a Unix-domain socket. It accesses the store, and \ |
| 57 | builds derivations on behalf of its clients."; | 65 | builds derivations on behalf of its clients."); |
| 58 | 66 | ||
| 59 | #define GUIX_OPT_SYSTEM 1 | 67 | #define GUIX_OPT_SYSTEM 1 |
| 60 | #define GUIX_OPT_DISABLE_CHROOT 2 | 68 | #define GUIX_OPT_DISABLE_CHROOT 2 |
| @@ -75,56 +83,59 @@ builds derivations on behalf of its clients."; | |||
| 75 | 83 | ||
| 76 | static const struct argp_option options[] = | 84 | static const struct argp_option options[] = |
| 77 | { | 85 | { |
| 78 | { "system", GUIX_OPT_SYSTEM, "SYSTEM", 0, | 86 | { "system", GUIX_OPT_SYSTEM, n_("SYSTEM"), 0, |
| 79 | "Assume SYSTEM as the current system type" }, | 87 | n_("assume SYSTEM as the current system type") }, |
| 80 | { "cores", 'c', "N", 0, | 88 | { "cores", 'c', n_("N"), 0, |
| 81 | "Use N CPU cores to build each derivation; 0 means as many as available" }, | 89 | n_("use N CPU cores to build each derivation; 0 means as many as available") |
| 82 | { "max-jobs", 'M', "N", 0, | 90 | }, |
| 83 | "Allow at most N build jobs" }, | 91 | { "max-jobs", 'M', n_("N"), 0, |
| 92 | n_("allow at most N build jobs") }, | ||
| 84 | { "disable-chroot", GUIX_OPT_DISABLE_CHROOT, 0, 0, | 93 | { "disable-chroot", GUIX_OPT_DISABLE_CHROOT, 0, 0, |
| 85 | "Disable chroot builds" }, | 94 | n_("disable chroot builds") }, |
| 86 | { "chroot-directory", GUIX_OPT_CHROOT_DIR, "DIR", 0, | 95 | { "chroot-directory", GUIX_OPT_CHROOT_DIR, n_("DIR"), 0, |
| 87 | "Add DIR to the build chroot" }, | 96 | n_("add DIR to the build chroot") }, |
| 88 | { "build-users-group", GUIX_OPT_BUILD_USERS_GROUP, "GROUP", 0, | 97 | { "build-users-group", GUIX_OPT_BUILD_USERS_GROUP, n_("GROUP"), 0, |
| 89 | "Perform builds as a user of GROUP" }, | 98 | n_("perform builds as a user of GROUP") }, |
| 90 | { "no-substitutes", GUIX_OPT_NO_SUBSTITUTES, 0, 0, | 99 | { "no-substitutes", GUIX_OPT_NO_SUBSTITUTES, 0, 0, |
| 91 | "Do not use substitutes" }, | 100 | n_("do not use substitutes") }, |
| 92 | { "substitute-urls", GUIX_OPT_SUBSTITUTE_URLS, "URLS", 0, | 101 | { "substitute-urls", GUIX_OPT_SUBSTITUTE_URLS, n_("URLS"), 0, |
| 93 | "Use URLS as the default list of substitute providers" }, | 102 | n_("use URLS as the default list of substitute providers") }, |
| 94 | { "no-build-hook", GUIX_OPT_NO_BUILD_HOOK, 0, 0, | 103 | { "no-build-hook", GUIX_OPT_NO_BUILD_HOOK, 0, 0, |
| 95 | "Do not use the 'build hook'" }, | 104 | n_("do not use the 'build hook'") }, |
| 96 | { "cache-failures", GUIX_OPT_CACHE_FAILURES, 0, 0, | 105 | { "cache-failures", GUIX_OPT_CACHE_FAILURES, 0, 0, |
| 97 | "Cache build failures" }, | 106 | n_("cache build failures") }, |
| 98 | { "lose-logs", GUIX_OPT_LOSE_LOGS, 0, 0, | 107 | { "lose-logs", GUIX_OPT_LOSE_LOGS, 0, 0, |
| 99 | "Do not keep build logs" }, | 108 | n_("do not keep build logs") }, |
| 100 | { "disable-log-compression", GUIX_OPT_DISABLE_LOG_COMPRESSION, 0, 0, | 109 | { "disable-log-compression", GUIX_OPT_DISABLE_LOG_COMPRESSION, 0, 0, |
| 101 | "Disable compression of the build logs" }, | 110 | n_("disable compression of the build logs") }, |
| 102 | 111 | ||
| 103 | /* '--disable-deduplication' was known as '--disable-store-optimization' | 112 | /* '--disable-deduplication' was known as '--disable-store-optimization' |
| 104 | up to Guix 0.7 included, so keep the alias around. */ | 113 | up to Guix 0.7 included, so keep the alias around. */ |
| 105 | { "disable-deduplication", GUIX_OPT_DISABLE_DEDUPLICATION, 0, 0, | 114 | { "disable-deduplication", GUIX_OPT_DISABLE_DEDUPLICATION, 0, 0, |
| 106 | "Disable automatic file \"deduplication\" in the store" }, | 115 | n_("disable automatic file \"deduplication\" in the store") }, |
| 107 | { "disable-store-optimization", GUIX_OPT_DISABLE_DEDUPLICATION, 0, | 116 | { "disable-store-optimization", GUIX_OPT_DISABLE_DEDUPLICATION, 0, |
| 108 | OPTION_ALIAS | OPTION_HIDDEN, NULL }, | 117 | OPTION_ALIAS | OPTION_HIDDEN, NULL }, |
| 109 | 118 | ||
| 110 | { "impersonate-linux-2.6", GUIX_OPT_IMPERSONATE_LINUX_26, 0, 0, | 119 | { "impersonate-linux-2.6", GUIX_OPT_IMPERSONATE_LINUX_26, 0, |
| 111 | "Impersonate Linux 2.6" | 120 | #ifdef HAVE_SYS_PERSONALITY_H |
| 112 | #ifndef HAVE_SYS_PERSONALITY_H | 121 | 0, |
| 113 | " (this option has no effect in this configuration)" | 122 | #else |
| 123 | OPTION_HIDDEN, | ||
| 114 | #endif | 124 | #endif |
| 125 | n_("impersonate Linux 2.6") | ||
| 115 | }, | 126 | }, |
| 116 | { "gc-keep-outputs", GUIX_OPT_GC_KEEP_OUTPUTS, | 127 | { "gc-keep-outputs", GUIX_OPT_GC_KEEP_OUTPUTS, |
| 117 | "yes/no", OPTION_ARG_OPTIONAL, | 128 | "yes/no", OPTION_ARG_OPTIONAL, |
| 118 | "Tell whether the GC must keep outputs of live derivations" }, | 129 | n_("tell whether the GC must keep outputs of live derivations") }, |
| 119 | { "gc-keep-derivations", GUIX_OPT_GC_KEEP_DERIVATIONS, | 130 | { "gc-keep-derivations", GUIX_OPT_GC_KEEP_DERIVATIONS, |
| 120 | "yes/no", OPTION_ARG_OPTIONAL, | 131 | "yes/no", OPTION_ARG_OPTIONAL, |
| 121 | "Tell whether the GC must keep derivations corresponding \ | 132 | n_("tell whether the GC must keep derivations corresponding \ |
| 122 | to live outputs" }, | 133 | to live outputs") }, |
| 123 | 134 | ||
| 124 | { "listen", GUIX_OPT_LISTEN, "SOCKET", 0, | 135 | { "listen", GUIX_OPT_LISTEN, n_("SOCKET"), 0, |
| 125 | "Listen for connections on SOCKET" }, | 136 | n_("listen for connections on SOCKET") }, |
| 126 | { "debug", GUIX_OPT_DEBUG, 0, 0, | 137 | { "debug", GUIX_OPT_DEBUG, 0, 0, |
| 127 | "Produce debugging output" }, | 138 | n_("produce debugging output") }, |
| 128 | { 0, 0, 0, 0, 0 } | 139 | { 0, 0, 0, 0, 0 } |
| 129 | }; | 140 | }; |
| 130 | 141 | ||
| @@ -154,8 +165,18 @@ parse_opt (int key, char *arg, struct argp_state *state) | |||
| 154 | settings.useChroot = false; | 165 | settings.useChroot = false; |
| 155 | break; | 166 | break; |
| 156 | case GUIX_OPT_CHROOT_DIR: | 167 | case GUIX_OPT_CHROOT_DIR: |
| 157 | settings.dirsInChroot.insert (arg); | 168 | { |
| 158 | break; | 169 | std::string chroot_dirs; |
| 170 | |||
| 171 | chroot_dirs = settings.get ("build-extra-chroot-dirs", | ||
| 172 | (std::string) ""); | ||
| 173 | if (chroot_dirs == "") | ||
| 174 | chroot_dirs = arg; | ||
| 175 | else | ||
| 176 | chroot_dirs = chroot_dirs + " " + arg; | ||
| 177 | settings.set("build-extra-chroot-dirs", chroot_dirs); | ||
| 178 | break; | ||
| 179 | } | ||
| 159 | case GUIX_OPT_DISABLE_LOG_COMPRESSION: | 180 | case GUIX_OPT_DISABLE_LOG_COMPRESSION: |
| 160 | settings.compressLog = false; | 181 | settings.compressLog = false; |
| 161 | break; | 182 | break; |
| @@ -181,7 +202,7 @@ parse_opt (int key, char *arg, struct argp_state *state) | |||
| 181 | } | 202 | } |
| 182 | catch (std::exception &e) | 203 | catch (std::exception &e) |
| 183 | { | 204 | { |
| 184 | fprintf (stderr, "error: %s\n", e.what ()); | 205 | fprintf (stderr, _("error: %s\n"), e.what ()); |
| 185 | exit (EXIT_FAILURE); | 206 | exit (EXIT_FAILURE); |
| 186 | } | 207 | } |
| 187 | break; | 208 | break; |
| @@ -220,19 +241,29 @@ parse_opt (int key, char *arg, struct argp_state *state) | |||
| 220 | } | 241 | } |
| 221 | 242 | ||
| 222 | /* Argument parsing. */ | 243 | /* Argument parsing. */ |
| 223 | static struct argp argp = { options, parse_opt, 0, doc }; | 244 | static const struct argp argp = |
| 245 | { | ||
| 246 | options, parse_opt, | ||
| 247 | NULL, doc, | ||
| 248 | NULL, NULL, // children and help_filter | ||
| 249 | guix_textdomain | ||
| 250 | }; | ||
| 224 | 251 | ||
| 225 | 252 | ||
| 226 | 253 | ||
| 227 | int | 254 | int |
| 228 | main (int argc, char *argv[]) | 255 | main (int argc, char *argv[]) |
| 229 | { | 256 | { |
| 230 | Strings nothing; | 257 | static const Strings nothing; |
| 258 | |||
| 259 | setlocale (LC_ALL, ""); | ||
| 260 | bindtextdomain (guix_textdomain, LOCALEDIR); | ||
| 261 | textdomain (guix_textdomain); | ||
| 231 | 262 | ||
| 232 | /* Initialize libgcrypt. */ | 263 | /* Initialize libgcrypt. */ |
| 233 | if (!gcry_check_version (GCRYPT_VERSION)) | 264 | if (!gcry_check_version (GCRYPT_VERSION)) |
| 234 | { | 265 | { |
| 235 | fprintf (stderr, "error: libgcrypt version mismatch\n"); | 266 | fprintf (stderr, _("error: libgcrypt version mismatch\n")); |
| 236 | exit (EXIT_FAILURE); | 267 | exit (EXIT_FAILURE); |
| 237 | } | 268 | } |
| 238 | 269 | ||
| @@ -323,16 +354,17 @@ main (int argc, char *argv[]) | |||
| 323 | settings.update (); | 354 | settings.update (); |
| 324 | 355 | ||
| 325 | if (geteuid () == 0 && settings.buildUsersGroup.empty ()) | 356 | if (geteuid () == 0 && settings.buildUsersGroup.empty ()) |
| 326 | fprintf (stderr, "warning: daemon is running as root, so " | 357 | fprintf (stderr, _("warning: daemon is running as root, so \ |
| 327 | "using `--build-users-group' is highly recommended\n"); | 358 | using `--build-users-group' is highly recommended\n")); |
| 328 | 359 | ||
| 329 | if (settings.useChroot) | 360 | if (settings.useChroot) |
| 330 | { | 361 | { |
| 331 | foreach (PathSet::iterator, i, settings.dirsInChroot) | 362 | std::string chroot_dirs; |
| 332 | { | 363 | |
| 333 | printMsg (lvlDebug, | 364 | chroot_dirs = settings.get ("build-extra-chroot-dirs", |
| 334 | format ("directory `%1%' added to the chroot") % *i); | 365 | (std::string) ""); |
| 335 | } | 366 | printMsg (lvlDebug, |
| 367 | format ("extra chroot directories: '%1%'") % chroot_dirs); | ||
| 336 | } | 368 | } |
| 337 | 369 | ||
| 338 | printMsg (lvlDebug, | 370 | printMsg (lvlDebug, |
| @@ -346,7 +378,7 @@ main (int argc, char *argv[]) | |||
| 346 | } | 378 | } |
| 347 | catch (std::exception &e) | 379 | catch (std::exception &e) |
| 348 | { | 380 | { |
| 349 | fprintf (stderr, "error: %s\n", e.what ()); | 381 | fprintf (stderr, _("error: %s\n"), e.what ()); |
| 350 | return EXIT_FAILURE; | 382 | return EXIT_FAILURE; |
| 351 | } | 383 | } |
| 352 | 384 | ||
diff --git a/nix/nix-daemon/nix-daemon.cc b/nix/nix-daemon/nix-daemon.cc index 8814fe3155e..10159db62e0 100644 --- a/nix/nix-daemon/nix-daemon.cc +++ b/nix/nix-daemon/nix-daemon.cc | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include "affinity.hh" | 7 | #include "affinity.hh" |
| 8 | #include "globals.hh" | 8 | #include "globals.hh" |
| 9 | 9 | ||
| 10 | #include <algorithm> | ||
| 11 | |||
| 10 | #include <cstring> | 12 | #include <cstring> |
| 11 | #include <unistd.h> | 13 | #include <unistd.h> |
| 12 | #include <signal.h> | 14 | #include <signal.h> |
| @@ -17,6 +19,8 @@ | |||
| 17 | #include <sys/un.h> | 19 | #include <sys/un.h> |
| 18 | #include <fcntl.h> | 20 | #include <fcntl.h> |
| 19 | #include <errno.h> | 21 | #include <errno.h> |
| 22 | #include <pwd.h> | ||
| 23 | #include <grp.h> | ||
| 20 | 24 | ||
| 21 | using namespace nix; | 25 | using namespace nix; |
| 22 | 26 | ||
| @@ -44,7 +48,6 @@ static FdSource from(STDIN_FILENO); | |||
| 44 | static FdSink to(STDOUT_FILENO); | 48 | static FdSink to(STDOUT_FILENO); |
| 45 | 49 | ||
| 46 | bool canSendStderr; | 50 | bool canSendStderr; |
| 47 | pid_t myPid; | ||
| 48 | 51 | ||
| 49 | 52 | ||
| 50 | 53 | ||
| @@ -54,11 +57,7 @@ pid_t myPid; | |||
| 54 | socket. */ | 57 | socket. */ |
| 55 | static void tunnelStderr(const unsigned char * buf, size_t count) | 58 | static void tunnelStderr(const unsigned char * buf, size_t count) |
| 56 | { | 59 | { |
| 57 | /* Don't send the message to the client if we're a child of the | 60 | if (canSendStderr) { |
| 58 | process handling the connection. Otherwise we could screw up | ||
| 59 | the protocol. It's up to the parent to redirect stderr and | ||
| 60 | send it to the client somehow (e.g., as in build.cc). */ | ||
| 61 | if (canSendStderr && myPid == getpid()) { | ||
| 62 | try { | 61 | try { |
| 63 | writeInt(STDERR_NEXT, to); | 62 | writeInt(STDERR_NEXT, to); |
| 64 | writeString(buf, count, to); | 63 | writeString(buf, count, to); |
| @@ -284,15 +283,6 @@ static void performOp(bool trusted, unsigned int clientVersion, | |||
| 284 | { | 283 | { |
| 285 | switch (op) { | 284 | switch (op) { |
| 286 | 285 | ||
| 287 | #if 0 | ||
| 288 | case wopQuit: { | ||
| 289 | /* Close the database. */ | ||
| 290 | store.reset((StoreAPI *) 0); | ||
| 291 | writeInt(1, to); | ||
| 292 | break; | ||
| 293 | } | ||
| 294 | #endif | ||
| 295 | |||
| 296 | case wopIsValidPath: { | 286 | case wopIsValidPath: { |
| 297 | /* 'readStorePath' could raise an error leading to the connection | 287 | /* 'readStorePath' could raise an error leading to the connection |
| 298 | being closed. To be able to recover from an invalid path error, | 288 | being closed. To be able to recover from an invalid path error, |
| @@ -450,6 +440,9 @@ static void performOp(bool trusted, unsigned int clientVersion, | |||
| 450 | case wopImportPaths: { | 440 | case wopImportPaths: { |
| 451 | startWork(); | 441 | startWork(); |
| 452 | TunnelSource source(from); | 442 | TunnelSource source(from); |
| 443 | |||
| 444 | /* Unlike Nix, always require a signature, even for "trusted" | ||
| 445 | users. */ | ||
| 453 | Paths paths = store->importPaths(true, source); | 446 | Paths paths = store->importPaths(true, source); |
| 454 | stopWork(); | 447 | stopWork(); |
| 455 | writeStrings(paths, to); | 448 | writeStrings(paths, to); |
| @@ -650,6 +643,25 @@ static void performOp(bool trusted, unsigned int clientVersion, | |||
| 650 | break; | 643 | break; |
| 651 | } | 644 | } |
| 652 | 645 | ||
| 646 | case wopOptimiseStore: | ||
| 647 | startWork(); | ||
| 648 | store->optimiseStore(); | ||
| 649 | stopWork(); | ||
| 650 | writeInt(1, to); | ||
| 651 | break; | ||
| 652 | |||
| 653 | case wopVerifyStore: { | ||
| 654 | bool checkContents = readInt(from) != 0; | ||
| 655 | bool repair = readInt(from) != 0; | ||
| 656 | startWork(); | ||
| 657 | if (repair && !trusted) | ||
| 658 | throw Error("you are not privileged to repair paths"); | ||
| 659 | bool errors = store->verifyStore(checkContents, repair); | ||
| 660 | stopWork(); | ||
| 661 | writeInt(errors, to); | ||
| 662 | break; | ||
| 663 | } | ||
| 664 | |||
| 653 | default: | 665 | default: |
| 654 | throw Error(format("invalid operation %1%") % op); | 666 | throw Error(format("invalid operation %1%") % op); |
| 655 | } | 667 | } |
| @@ -659,7 +671,6 @@ static void performOp(bool trusted, unsigned int clientVersion, | |||
| 659 | static void processConnection(bool trusted) | 671 | static void processConnection(bool trusted) |
| 660 | { | 672 | { |
| 661 | canSendStderr = false; | 673 | canSendStderr = false; |
| 662 | myPid = getpid(); | ||
| 663 | _writeToStderr = tunnelStderr; | 674 | _writeToStderr = tunnelStderr; |
| 664 | 675 | ||
| 665 | #ifdef HAVE_HUP_NOTIFICATION | 676 | #ifdef HAVE_HUP_NOTIFICATION |
| @@ -708,7 +719,7 @@ static void processConnection(bool trusted) | |||
| 708 | to.flush(); | 719 | to.flush(); |
| 709 | 720 | ||
| 710 | } catch (Error & e) { | 721 | } catch (Error & e) { |
| 711 | stopWork(false, e.msg()); | 722 | stopWork(false, e.msg(), GET_PROTOCOL_MINOR(clientVersion) >= 8 ? 1 : 0); |
| 712 | to.flush(); | 723 | to.flush(); |
| 713 | return; | 724 | return; |
| 714 | } | 725 | } |
| @@ -735,12 +746,10 @@ static void processConnection(bool trusted) | |||
| 735 | during addTextToStore() / importPath(). If that | 746 | during addTextToStore() / importPath(). If that |
| 736 | happens, just send the error message and exit. */ | 747 | happens, just send the error message and exit. */ |
| 737 | bool errorAllowed = canSendStderr; | 748 | bool errorAllowed = canSendStderr; |
| 738 | if (!errorAllowed) printMsg(lvlError, format("error processing client input: %1%") % e.msg()); | ||
| 739 | stopWork(false, e.msg(), GET_PROTOCOL_MINOR(clientVersion) >= 8 ? e.status : 0); | 749 | stopWork(false, e.msg(), GET_PROTOCOL_MINOR(clientVersion) >= 8 ? e.status : 0); |
| 740 | if (!errorAllowed) break; | 750 | if (!errorAllowed) throw; |
| 741 | } catch (std::bad_alloc & e) { | 751 | } catch (std::bad_alloc & e) { |
| 742 | if (canSendStderr) | 752 | stopWork(false, "Nix daemon out of memory", GET_PROTOCOL_MINOR(clientVersion) >= 8 ? 1 : 0); |
| 743 | stopWork(false, "Nix daemon out of memory", GET_PROTOCOL_MINOR(clientVersion) >= 8 ? 1 : 0); | ||
| 744 | throw; | 753 | throw; |
| 745 | } | 754 | } |
| 746 | 755 | ||
| @@ -749,7 +758,9 @@ static void processConnection(bool trusted) | |||
| 749 | assert(!canSendStderr); | 758 | assert(!canSendStderr); |
| 750 | }; | 759 | }; |
| 751 | 760 | ||
| 752 | printMsg(lvlError, format("%1% operations") % opCount); | 761 | canSendStderr = false; |
| 762 | _isInterrupted = false; | ||
| 763 | printMsg(lvlDebug, format("%1% operations") % opCount); | ||
| 753 | } | 764 | } |
| 754 | 765 | ||
| 755 | 766 | ||
| @@ -771,11 +782,35 @@ static void setSigChldAction(bool autoReap) | |||
| 771 | } | 782 | } |
| 772 | 783 | ||
| 773 | 784 | ||
| 785 | bool matchUser(const string & user, const string & group, const Strings & users) | ||
| 786 | { | ||
| 787 | if (find(users.begin(), users.end(), "*") != users.end()) | ||
| 788 | return true; | ||
| 789 | |||
| 790 | if (find(users.begin(), users.end(), user) != users.end()) | ||
| 791 | return true; | ||
| 792 | |||
| 793 | for (auto & i : users) | ||
| 794 | if (string(i, 0, 1) == "@") { | ||
| 795 | if (group == string(i, 1)) return true; | ||
| 796 | struct group * gr = getgrnam(i.c_str() + 1); | ||
| 797 | if (!gr) continue; | ||
| 798 | for (char * * mem = gr->gr_mem; *mem; mem++) | ||
| 799 | if (user == string(*mem)) return true; | ||
| 800 | } | ||
| 801 | |||
| 802 | return false; | ||
| 803 | } | ||
| 804 | |||
| 805 | |||
| 774 | #define SD_LISTEN_FDS_START 3 | 806 | #define SD_LISTEN_FDS_START 3 |
| 775 | 807 | ||
| 776 | 808 | ||
| 777 | static void daemonLoop() | 809 | static void daemonLoop() |
| 778 | { | 810 | { |
| 811 | if (chdir("/") == -1) | ||
| 812 | throw SysError("cannot change current directory"); | ||
| 813 | |||
| 779 | /* Get rid of children automatically; don't let them become | 814 | /* Get rid of children automatically; don't let them become |
| 780 | zombies. */ | 815 | zombies. */ |
| 781 | setSigChldAction(true); | 816 | setSigChldAction(true); |
| @@ -804,7 +839,8 @@ static void daemonLoop() | |||
| 804 | /* Urgh, sockaddr_un allows path names of only 108 characters. | 839 | /* Urgh, sockaddr_un allows path names of only 108 characters. |
| 805 | So chdir to the socket directory so that we can pass a | 840 | So chdir to the socket directory so that we can pass a |
| 806 | relative path name. */ | 841 | relative path name. */ |
| 807 | chdir(dirOf(socketPath).c_str()); | 842 | if (chdir(dirOf(socketPath).c_str()) == -1) |
| 843 | throw SysError("cannot change current directory"); | ||
| 808 | Path socketPathRel = "./" + baseNameOf(socketPath); | 844 | Path socketPathRel = "./" + baseNameOf(socketPath); |
| 809 | 845 | ||
| 810 | struct sockaddr_un addr; | 846 | struct sockaddr_un addr; |
| @@ -824,7 +860,8 @@ static void daemonLoop() | |||
| 824 | if (res == -1) | 860 | if (res == -1) |
| 825 | throw SysError(format("cannot bind to socket `%1%'") % socketPath); | 861 | throw SysError(format("cannot bind to socket `%1%'") % socketPath); |
| 826 | 862 | ||
| 827 | chdir("/"); /* back to the root */ | 863 | if (chdir("/") == -1) /* back to the root */ |
| 864 | throw SysError("cannot change current directory"); | ||
| 828 | 865 | ||
| 829 | if (listen(fdSocket, 5) == -1) | 866 | if (listen(fdSocket, 5) == -1) |
| 830 | throw SysError(format("cannot listen on socket `%1%'") % socketPath); | 867 | throw SysError(format("cannot listen on socket `%1%'") % socketPath); |
| @@ -856,58 +893,61 @@ static void daemonLoop() | |||
| 856 | 893 | ||
| 857 | closeOnExec(remote); | 894 | closeOnExec(remote); |
| 858 | 895 | ||
| 859 | /* Get the identity of the caller, if possible. */ | ||
| 860 | uid_t clientUid = -1; | ||
| 861 | pid_t clientPid = -1; | ||
| 862 | bool trusted = false; | 896 | bool trusted = false; |
| 897 | pid_t clientPid = -1; | ||
| 863 | 898 | ||
| 864 | #if defined(SO_PEERCRED) | 899 | #if defined(SO_PEERCRED) |
| 900 | /* Get the identity of the caller, if possible. */ | ||
| 865 | ucred cred; | 901 | ucred cred; |
| 866 | socklen_t credLen = sizeof(cred); | 902 | socklen_t credLen = sizeof(cred); |
| 867 | if (getsockopt(remote, SOL_SOCKET, SO_PEERCRED, &cred, &credLen) != -1) { | 903 | if (getsockopt(remote, SOL_SOCKET, SO_PEERCRED, &cred, &credLen) == -1) |
| 868 | clientPid = cred.pid; | 904 | throw SysError("getting peer credentials"); |
| 869 | clientUid = cred.uid; | ||
| 870 | if (clientUid == 0) trusted = true; | ||
| 871 | } | ||
| 872 | #endif | ||
| 873 | 905 | ||
| 874 | printMsg(lvlInfo, format("accepted connection from pid %1%, uid %2%") % clientPid % clientUid); | 906 | clientPid = cred.pid; |
| 875 | 907 | ||
| 876 | /* Fork a child to handle the connection. */ | 908 | struct passwd * pw = getpwuid(cred.uid); |
| 877 | pid_t child; | 909 | string user = pw ? pw->pw_name : int2String(cred.uid); |
| 878 | child = fork(); | ||
| 879 | 910 | ||
| 880 | switch (child) { | 911 | struct group * gr = getgrgid(cred.gid); |
| 912 | string group = gr ? gr->gr_name : int2String(cred.gid); | ||
| 881 | 913 | ||
| 882 | case -1: | 914 | Strings trustedUsers = settings.get("trusted-users", Strings({"root"})); |
| 883 | throw SysError("unable to fork"); | 915 | Strings allowedUsers = settings.get("allowed-users", Strings({"*"})); |
| 884 | 916 | ||
| 885 | case 0: | 917 | if (matchUser(user, group, trustedUsers)) |
| 886 | try { /* child */ | 918 | trusted = true; |
| 887 | 919 | ||
| 888 | /* Background the daemon. */ | 920 | if (!trusted && !matchUser(user, group, allowedUsers)) |
| 889 | if (setsid() == -1) | 921 | throw Error(format("user `%1%' is not allowed to connect to the Nix daemon") % user); |
| 890 | throw SysError(format("creating a new session")); | ||
| 891 | 922 | ||
| 892 | /* Restore normal handling of SIGCHLD. */ | 923 | printMsg(lvlInfo, format((string) "accepted connection from pid %1%, user %2%" |
| 893 | setSigChldAction(false); | 924 | + (trusted ? " (trusted)" : "")) % clientPid % user); |
| 925 | #endif | ||
| 894 | 926 | ||
| 895 | /* For debugging, stuff the pid into argv[1]. */ | 927 | /* Fork a child to handle the connection. */ |
| 896 | if (clientPid != -1 && argvSaved[1]) { | 928 | startProcess([&]() { |
| 897 | string processName = int2String(clientPid); | 929 | fdSocket.close(); |
| 898 | strncpy(argvSaved[1], processName.c_str(), strlen(argvSaved[1])); | ||
| 899 | } | ||
| 900 | 930 | ||
| 901 | /* Handle the connection. */ | 931 | /* Background the daemon. */ |
| 902 | from.fd = remote; | 932 | if (setsid() == -1) |
| 903 | to.fd = remote; | 933 | throw SysError(format("creating a new session")); |
| 904 | processConnection(trusted); | ||
| 905 | 934 | ||
| 906 | } catch (std::exception & e) { | 935 | /* Restore normal handling of SIGCHLD. */ |
| 907 | writeToStderr("unexpected Nix daemon error: " + string(e.what()) + "\n"); | 936 | setSigChldAction(false); |
| 937 | |||
| 938 | /* For debugging, stuff the pid into argv[1]. */ | ||
| 939 | if (clientPid != -1 && argvSaved[1]) { | ||
| 940 | string processName = int2String(clientPid); | ||
| 941 | strncpy(argvSaved[1], processName.c_str(), strlen(argvSaved[1])); | ||
| 908 | } | 942 | } |
| 943 | |||
| 944 | /* Handle the connection. */ | ||
| 945 | from.fd = remote; | ||
| 946 | to.fd = remote; | ||
| 947 | processConnection(trusted); | ||
| 948 | |||
| 909 | exit(0); | 949 | exit(0); |
| 910 | } | 950 | }, false, "unexpected Nix daemon error: ", true); |
| 911 | 951 | ||
| 912 | } catch (Interrupted & e) { | 952 | } catch (Interrupted & e) { |
| 913 | throw; | 953 | throw; |
| @@ -925,7 +965,6 @@ void run(Strings args) | |||
| 925 | if (arg == "--daemon") /* ignored for backwards compatibility */; | 965 | if (arg == "--daemon") /* ignored for backwards compatibility */; |
| 926 | } | 966 | } |
| 927 | 967 | ||
| 928 | chdir("/"); | ||
| 929 | daemonLoop(); | 968 | daemonLoop(); |
| 930 | } | 969 | } |
| 931 | 970 | ||
diff --git a/po/guix/Makevars b/po/guix/Makevars index 9c5965a136b..8ec7d8aed6d 100644 --- a/po/guix/Makevars +++ b/po/guix/Makevars | |||
| @@ -6,12 +6,14 @@ subdir = po/guix | |||
| 6 | top_builddir = ../.. | 6 | top_builddir = ../.. |
| 7 | 7 | ||
| 8 | # These options get passed to xgettext. We want to catch standard | 8 | # These options get passed to xgettext. We want to catch standard |
| 9 | # gettext uses, and SRFI-35 error condition messages. | 9 | # gettext uses, and SRFI-35 error condition messages. In C++ code |
| 10 | # we use 'n_' instead of the more usual 'N_' for no-ops. | ||
| 10 | XGETTEXT_OPTIONS = \ | 11 | XGETTEXT_OPTIONS = \ |
| 11 | --language=Scheme --from-code=UTF-8 \ | 12 | --from-code=UTF-8 \ |
| 12 | --keyword=_ --keyword=N_:1,2 \ | 13 | --keyword=_ --keyword=N_:1,2 \ |
| 13 | --keyword=message \ | 14 | --keyword=message \ |
| 14 | --keyword=description | 15 | --keyword=description \ |
| 16 | --keyword=n_ | ||
| 15 | 17 | ||
| 16 | COPYRIGHT_HOLDER = Ludovic Courtès | 18 | COPYRIGHT_HOLDER = Ludovic Courtès |
| 17 | 19 | ||
diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index 30ce28b712c..4f27f54d6c1 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | gnu/packages.scm | 3 | gnu/packages.scm |
| 4 | gnu/system.scm | 4 | gnu/system.scm |
| 5 | gnu/services/dmd.scm | 5 | gnu/services/dmd.scm |
| 6 | gnu/system/shadow.scm | ||
| 6 | guix/scripts/build.scm | 7 | guix/scripts/build.scm |
| 7 | guix/scripts/download.scm | 8 | guix/scripts/download.scm |
| 8 | guix/scripts/package.scm | 9 | guix/scripts/package.scm |
| @@ -19,3 +20,4 @@ guix/gnu-maintenance.scm | |||
| 19 | guix/ui.scm | 20 | guix/ui.scm |
| 20 | guix/http-client.scm | 21 | guix/http-client.scm |
| 21 | guix/nar.scm | 22 | guix/nar.scm |
| 23 | nix/nix-daemon/guix-daemon.cc | ||
diff --git a/po/guix/da.po b/po/guix/da.po index 3e0c84caf12..2274ebff570 100644 --- a/po/guix/da.po +++ b/po/guix/da.po | |||
| @@ -7,10 +7,10 @@ | |||
| 7 | # | 7 | # |
| 8 | msgid "" | 8 | msgid "" |
| 9 | msgstr "" | 9 | msgstr "" |
| 10 | "Project-Id-Version: guix 0.8.1\n" | 10 | "Project-Id-Version: guix 0.8.2\n" |
| 11 | "Report-Msgid-Bugs-To: ludo@gnu.org\n" | 11 | "Report-Msgid-Bugs-To: ludo@gnu.org\n" |
| 12 | "POT-Creation-Date: 2015-01-26 23:51+0100\n" | 12 | "POT-Creation-Date: 2015-05-10 14:02+0200\n" |
| 13 | "PO-Revision-Date: 2015-04-06 19:30+01:00\n" | 13 | "PO-Revision-Date: 2015-05-14 19:30+01:00\n" |
| 14 | "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" | 14 | "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" |
| 15 | "Language-Team: Danish <dansk@dansk-gruppen.dk>\n" | 15 | "Language-Team: Danish <dansk@dansk-gruppen.dk>\n" |
| 16 | "Language: da\n" | 16 | "Language: da\n" |
| @@ -34,40 +34,45 @@ msgstr "kunne ikke finde bootstraps binære »~a« for system »~a«" | |||
| 34 | msgid "cannot access `~a': ~a~%" | 34 | msgid "cannot access `~a': ~a~%" |
| 35 | msgstr "kan ikke tilgå »~a«: ~a~%" | 35 | msgstr "kan ikke tilgå »~a«: ~a~%" |
| 36 | 36 | ||
| 37 | #: gnu/packages.scm:372 | 37 | #: gnu/packages.scm:382 |
| 38 | #, scheme-format | 38 | #, scheme-format |
| 39 | msgid "looking for the latest release of GNU ~a..." | 39 | msgid "looking for the latest release of GNU ~a..." |
| 40 | msgstr "kigger efter den seneste udgivelse af GNU ~a..." | 40 | msgstr "kigger efter den seneste udgivelse af GNU ~a..." |
| 41 | 41 | ||
| 42 | #: gnu/packages.scm:379 | 42 | #: gnu/packages.scm:389 |
| 43 | #, scheme-format | 43 | #, scheme-format |
| 44 | msgid "~a: note: using ~a but ~a is available upstream~%" | 44 | msgid "~a: note: using ~a but ~a is available upstream~%" |
| 45 | msgstr "~a: bemærk: bruger ~a men ~a er tilgængelig opstrøm~%" | 45 | msgstr "~a: bemærk: bruger ~a men ~a er tilgængelig opstrøm~%" |
| 46 | 46 | ||
| 47 | #: gnu/packages.scm:401 guix/scripts/package.scm:306 | 47 | #: gnu/packages.scm:411 guix/scripts/package.scm:350 |
| 48 | #, scheme-format | 48 | #, scheme-format |
| 49 | msgid "ambiguous package specification `~a'~%" | 49 | msgid "ambiguous package specification `~a'~%" |
| 50 | msgstr "tvetydig pakkespecifikation »~a«~%" | 50 | msgstr "tvetydig pakkespecifikation »~a«~%" |
| 51 | 51 | ||
| 52 | #: gnu/packages.scm:402 guix/scripts/package.scm:308 | 52 | #: gnu/packages.scm:412 guix/scripts/package.scm:352 |
| 53 | #, scheme-format | 53 | #, scheme-format |
| 54 | msgid "choosing ~a from ~a~%" | 54 | msgid "choosing ~a from ~a~%" |
| 55 | msgstr "vælger ~a fra ~a~%" | 55 | msgstr "vælger ~a fra ~a~%" |
| 56 | 56 | ||
| 57 | #: gnu/packages.scm:408 | 57 | #: gnu/packages.scm:418 |
| 58 | #, scheme-format | 58 | #, scheme-format |
| 59 | msgid "~A: package not found for version ~a~%" | 59 | msgid "~A: package not found for version ~a~%" |
| 60 | msgstr "~A: pakke ikke fundet for version ~a~%" | 60 | msgstr "~A: pakke ikke fundet for version ~a~%" |
| 61 | 61 | ||
| 62 | #: gnu/packages.scm:410 | 62 | #: gnu/packages.scm:420 |
| 63 | #, scheme-format | 63 | #, scheme-format |
| 64 | msgid "~A: unknown package~%" | 64 | msgid "~A: unknown package~%" |
| 65 | msgstr "~A: ukendt pakke~%" | 65 | msgstr "~A: ukendt pakke~%" |
| 66 | 66 | ||
| 67 | #: gnu/system.scm:716 | 67 | #: gnu/system.scm:811 |
| 68 | msgid "system locale lacks a definition" | 68 | msgid "system locale lacks a definition" |
| 69 | msgstr "systemsprog mangler en definition" | 69 | msgstr "systemsprog mangler en definition" |
| 70 | 70 | ||
| 71 | #: gnu/services/dmd.scm:51 | ||
| 72 | #, scheme-format | ||
| 73 | msgid "service '~a' provided more than once" | ||
| 74 | msgstr "tjeneste »~a« tilbudt mere end en gang" | ||
| 75 | |||
| 71 | #: guix/scripts/build.scm:65 | 76 | #: guix/scripts/build.scm:65 |
| 72 | #, scheme-format | 77 | #, scheme-format |
| 73 | msgid "failed to create GC root `~a': ~a~%" | 78 | msgid "failed to create GC root `~a': ~a~%" |
| @@ -196,12 +201,22 @@ msgstr "" | |||
| 196 | #: guix/scripts/build.scm:230 | 201 | #: guix/scripts/build.scm:230 |
| 197 | msgid "" | 202 | msgid "" |
| 198 | "\n" | 203 | "\n" |
| 204 | " --sources[=TYPE] build source derivations; TYPE may optionally be one\n" | ||
| 205 | " of \"package\", \"all\" (default), or \"transitive\"" | ||
| 206 | msgstr "" | ||
| 207 | "\n" | ||
| 208 | " --sources[=TYPE] bygningskildeafledninger; TYPE kan valgfrit være\n" | ||
| 209 | " »package«, »all« (standard) eller »transitive«" | ||
| 210 | |||
| 211 | #: guix/scripts/build.scm:233 | ||
| 212 | msgid "" | ||
| 213 | "\n" | ||
| 199 | " -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"" | 214 | " -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"" |
| 200 | msgstr "" | 215 | msgstr "" |
| 201 | "\n" | 216 | "\n" |
| 202 | " -s, --system=SYSTEM forsøger at bygge for SYSTEM--f.eks., »i686-linux«" | 217 | " -s, --system=SYSTEM forsøger at bygge for SYSTEM--f.eks., »i686-linux«" |
| 203 | 218 | ||
| 204 | #: guix/scripts/build.scm:232 | 219 | #: guix/scripts/build.scm:235 |
| 205 | msgid "" | 220 | msgid "" |
| 206 | "\n" | 221 | "\n" |
| 207 | " --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\"" | 222 | " --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\"" |
| @@ -209,7 +224,7 @@ msgstr "" | |||
| 209 | "\n" | 224 | "\n" |
| 210 | " --target=TRIPLET krydsbyg for TRIPLET--f.eks., »armel-linux-gnu«" | 225 | " --target=TRIPLET krydsbyg for TRIPLET--f.eks., »armel-linux-gnu«" |
| 211 | 226 | ||
| 212 | #: guix/scripts/build.scm:234 | 227 | #: guix/scripts/build.scm:237 |
| 213 | msgid "" | 228 | msgid "" |
| 214 | "\n" | 229 | "\n" |
| 215 | " --with-source=SOURCE\n" | 230 | " --with-source=SOURCE\n" |
| @@ -219,7 +234,7 @@ msgstr "" | |||
| 219 | " --with-source=KILDE\n" | 234 | " --with-source=KILDE\n" |
| 220 | " brug KILDE når den tilsvarende pakke bygges" | 235 | " brug KILDE når den tilsvarende pakke bygges" |
| 221 | 236 | ||
| 222 | #: guix/scripts/build.scm:237 | 237 | #: guix/scripts/build.scm:240 |
| 223 | msgid "" | 238 | msgid "" |
| 224 | "\n" | 239 | "\n" |
| 225 | " --no-grafts do not graft packages" | 240 | " --no-grafts do not graft packages" |
| @@ -227,7 +242,7 @@ msgstr "" | |||
| 227 | "\n" | 242 | "\n" |
| 228 | " --no-grafts pod ikke pakker" | 243 | " --no-grafts pod ikke pakker" |
| 229 | 244 | ||
| 230 | #: guix/scripts/build.scm:239 | 245 | #: guix/scripts/build.scm:242 |
| 231 | msgid "" | 246 | msgid "" |
| 232 | "\n" | 247 | "\n" |
| 233 | " -d, --derivations return the derivation paths of the given packages" | 248 | " -d, --derivations return the derivation paths of the given packages" |
| @@ -235,7 +250,7 @@ msgstr "" | |||
| 235 | "\n" | 250 | "\n" |
| 236 | " -d, --derivations returner de afledte stier for de givne pakker" | 251 | " -d, --derivations returner de afledte stier for de givne pakker" |
| 237 | 252 | ||
| 238 | #: guix/scripts/build.scm:241 | 253 | #: guix/scripts/build.scm:244 |
| 239 | msgid "" | 254 | msgid "" |
| 240 | "\n" | 255 | "\n" |
| 241 | " -r, --root=FILE make FILE a symlink to the result, and register it\n" | 256 | " -r, --root=FILE make FILE a symlink to the result, and register it\n" |
| @@ -245,7 +260,7 @@ msgstr "" | |||
| 245 | " -r, --root=FIL gør FIL til en symbolsk henvisning for resultatet, og\n" | 260 | " -r, --root=FIL gør FIL til en symbolsk henvisning for resultatet, og\n" |
| 246 | " registrer den som en affaldsindsamlerroot" | 261 | " registrer den som en affaldsindsamlerroot" |
| 247 | 262 | ||
| 248 | #: guix/scripts/build.scm:244 | 263 | #: guix/scripts/build.scm:247 |
| 249 | msgid "" | 264 | msgid "" |
| 250 | "\n" | 265 | "\n" |
| 251 | " --log-file return the log file names for the given derivations" | 266 | " --log-file return the log file names for the given derivations" |
| @@ -253,11 +268,12 @@ msgstr "" | |||
| 253 | "\n" | 268 | "\n" |
| 254 | " --log-file returner logfilnavnen for de givne afledninger" | 269 | " --log-file returner logfilnavnen for de givne afledninger" |
| 255 | 270 | ||
| 256 | #: guix/scripts/build.scm:249 guix/scripts/download.scm:53 | 271 | #: guix/scripts/build.scm:252 guix/scripts/download.scm:53 |
| 257 | #: guix/scripts/package.scm:467 guix/scripts/gc.scm:58 | 272 | #: guix/scripts/package.scm:464 guix/scripts/gc.scm:58 |
| 258 | #: guix/scripts/hash.scm:55 guix/scripts/pull.scm:81 | 273 | #: guix/scripts/hash.scm:55 guix/scripts/import.scm:90 |
| 259 | #: guix/scripts/substitute-binary.scm:566 guix/scripts/system.scm:414 | 274 | #: guix/scripts/pull.scm:81 guix/scripts/substitute.scm:682 |
| 260 | #: guix/scripts/lint.scm:469 | 275 | #: guix/scripts/system.scm:400 guix/scripts/lint.scm:534 |
| 276 | #: guix/scripts/publish.scm:56 | ||
| 261 | msgid "" | 277 | msgid "" |
| 262 | "\n" | 278 | "\n" |
| 263 | " -h, --help display this help and exit" | 279 | " -h, --help display this help and exit" |
| @@ -265,11 +281,12 @@ msgstr "" | |||
| 265 | "\n" | 281 | "\n" |
| 266 | " -h, --help vis denne hjælpetekst og afslut" | 282 | " -h, --help vis denne hjælpetekst og afslut" |
| 267 | 283 | ||
| 268 | #: guix/scripts/build.scm:251 guix/scripts/download.scm:55 | 284 | #: guix/scripts/build.scm:254 guix/scripts/download.scm:55 |
| 269 | #: guix/scripts/package.scm:469 guix/scripts/gc.scm:60 | 285 | #: guix/scripts/package.scm:466 guix/scripts/gc.scm:60 |
| 270 | #: guix/scripts/hash.scm:57 guix/scripts/pull.scm:83 | 286 | #: guix/scripts/hash.scm:57 guix/scripts/import.scm:92 |
| 271 | #: guix/scripts/substitute-binary.scm:568 guix/scripts/system.scm:416 | 287 | #: guix/scripts/pull.scm:83 guix/scripts/substitute.scm:684 |
| 272 | #: guix/scripts/lint.scm:473 | 288 | #: guix/scripts/system.scm:402 guix/scripts/lint.scm:538 |
| 289 | #: guix/scripts/publish.scm:58 | ||
| 273 | msgid "" | 290 | msgid "" |
| 274 | "\n" | 291 | "\n" |
| 275 | " -V, --version display version information and exit" | 292 | " -V, --version display version information and exit" |
| @@ -277,20 +294,21 @@ msgstr "" | |||
| 277 | "\n" | 294 | "\n" |
| 278 | " -V, --version vis versioninformation og afslut" | 295 | " -V, --version vis versioninformation og afslut" |
| 279 | 296 | ||
| 280 | #: guix/scripts/build.scm:383 | 297 | #: guix/scripts/build.scm:281 |
| 281 | #, scheme-format | 298 | #, scheme-format |
| 282 | msgid "sources do not match any package:~{ ~a~}~%" | 299 | msgid "" |
| 283 | msgstr "kilder matcher ikke nogen pakke:~{ ~a~}~%" | 300 | "invalid argument: '~a' option argument: ~a, ~\n" |
| 301 | "must be one of 'package', 'all', or 'transitive'~%" | ||
| 302 | msgstr "" | ||
| 303 | "ugyldigt argument: »~a« tilvalgsargumentet: ~a, ~\n" | ||
| 304 | "skal være »package«, »all« eller »transitive«~%" | ||
| 284 | 305 | ||
| 285 | #: guix/scripts/build.scm:417 guix/scripts/download.scm:96 | 306 | #: guix/scripts/build.scm:404 |
| 286 | #: guix/scripts/package.scm:694 guix/scripts/gc.scm:122 | ||
| 287 | #: guix/scripts/pull.scm:213 guix/scripts/system.scm:499 | ||
| 288 | #: guix/scripts/lint.scm:521 | ||
| 289 | #, scheme-format | 307 | #, scheme-format |
| 290 | msgid "~A: unrecognized option~%" | 308 | msgid "sources do not match any package:~{ ~a~}~%" |
| 291 | msgstr "~A: ikke genkendt tilvalg~%" | 309 | msgstr "kilder matcher ikke nogen pakke:~{ ~a~}~%" |
| 292 | 310 | ||
| 293 | #: guix/scripts/build.scm:445 | 311 | #: guix/scripts/build.scm:453 |
| 294 | #, scheme-format | 312 | #, scheme-format |
| 295 | msgid "no build log for '~a'~%" | 313 | msgid "no build log for '~a'~%" |
| 296 | msgstr "ingen byggelog for »~a«~%" | 314 | msgstr "ingen byggelog for »~a«~%" |
| @@ -324,6 +342,13 @@ msgstr "" | |||
| 324 | msgid "unsupported hash format: ~a~%" | 342 | msgid "unsupported hash format: ~a~%" |
| 325 | msgstr "ikke understøttet hash-format: ~a~%" | 343 | msgstr "ikke understøttet hash-format: ~a~%" |
| 326 | 344 | ||
| 345 | #: guix/scripts/download.scm:96 guix/scripts/gc.scm:122 | ||
| 346 | #: guix/scripts/pull.scm:217 guix/scripts/lint.scm:585 | ||
| 347 | #: guix/scripts/publish.scm:233 guix/ui.scm:829 | ||
| 348 | #, scheme-format | ||
| 349 | msgid "~A: unrecognized option~%" | ||
| 350 | msgstr "~A: ikke genkendt tilvalg~%" | ||
| 351 | |||
| 327 | #: guix/scripts/download.scm:106 | 352 | #: guix/scripts/download.scm:106 |
| 328 | #, scheme-format | 353 | #, scheme-format |
| 329 | msgid "~a: failed to parse URI~%" | 354 | msgid "~a: failed to parse URI~%" |
| @@ -334,42 +359,57 @@ msgstr "~a: kunne ikke fortolke URI~%" | |||
| 334 | msgid "~a: download failed~%" | 359 | msgid "~a: download failed~%" |
| 335 | msgstr "~a: overførsel mislykkede~%" | 360 | msgstr "~a: overførsel mislykkede~%" |
| 336 | 361 | ||
| 337 | #: guix/scripts/package.scm:98 | 362 | #: guix/scripts/package.scm:108 |
| 338 | #, scheme-format | 363 | #, scheme-format |
| 339 | msgid "failed to build the empty profile~%" | 364 | msgid "failed to build the empty profile~%" |
| 340 | msgstr "kunne ikke bygge den tomme profil~%" | 365 | msgstr "kunne ikke bygge den tomme profil~%" |
| 341 | 366 | ||
| 342 | #: guix/scripts/package.scm:114 | 367 | #: guix/scripts/package.scm:124 |
| 343 | #, scheme-format | 368 | #, scheme-format |
| 344 | msgid "switching from generation ~a to ~a~%" | 369 | msgid "switching from generation ~a to ~a~%" |
| 345 | msgstr "skifter fra generation ~a til ~a~%" | 370 | msgstr "skifter fra generation ~a til ~a~%" |
| 346 | 371 | ||
| 347 | #: guix/scripts/package.scm:133 | 372 | #: guix/scripts/package.scm:143 |
| 348 | #, scheme-format | 373 | #, scheme-format |
| 349 | msgid "nothing to do: already at the empty profile~%" | 374 | msgid "nothing to do: already at the empty profile~%" |
| 350 | msgstr "intet at udføre: allerede en tom profil~%" | 375 | msgstr "intet at udføre: allerede en tom profil~%" |
| 351 | 376 | ||
| 352 | #: guix/scripts/package.scm:145 | 377 | #: guix/scripts/package.scm:155 |
| 353 | #, scheme-format | 378 | #, scheme-format |
| 354 | msgid "deleting ~a~%" | 379 | msgid "deleting ~a~%" |
| 355 | msgstr "sletter ~a~%" | 380 | msgstr "sletter ~a~%" |
| 356 | 381 | ||
| 357 | #: guix/scripts/package.scm:296 | 382 | #: guix/scripts/package.scm:268 |
| 383 | #, scheme-format | ||
| 384 | msgid "not removing generation ~a, which is current~%" | ||
| 385 | msgstr "fjerner ikke generation ~a, som er nuværende~%" | ||
| 386 | |||
| 387 | #: guix/scripts/package.scm:275 | ||
| 388 | #, scheme-format | ||
| 389 | msgid "no matching generation~%" | ||
| 390 | msgstr "ingen matchende generation~%" | ||
| 391 | |||
| 392 | #: guix/scripts/package.scm:278 guix/scripts/package.scm:917 | ||
| 393 | #, scheme-format | ||
| 394 | msgid "invalid syntax: ~a~%" | ||
| 395 | msgstr "ugyldig syntaks: ~a~%" | ||
| 396 | |||
| 397 | #: guix/scripts/package.scm:340 | ||
| 358 | #, scheme-format | 398 | #, scheme-format |
| 359 | msgid "package `~a' lacks output `~a'~%" | 399 | msgid "package `~a' lacks output `~a'~%" |
| 360 | msgstr "pakke »~a« mangler uddata »~a«~%" | 400 | msgstr "pakke »~a« mangler uddata »~a«~%" |
| 361 | 401 | ||
| 362 | #: guix/scripts/package.scm:313 | 402 | #: guix/scripts/package.scm:357 |
| 363 | #, scheme-format | 403 | #, scheme-format |
| 364 | msgid "~a: package not found~%" | 404 | msgid "~a: package not found~%" |
| 365 | msgstr "~a: pakken blev ikke fundet~%" | 405 | msgstr "~a: pakken blev ikke fundet~%" |
| 366 | 406 | ||
| 367 | #: guix/scripts/package.scm:406 | 407 | #: guix/scripts/package.scm:401 |
| 368 | #, scheme-format | 408 | #, scheme-format |
| 369 | msgid "The following environment variable definitions may be needed:~%" | 409 | msgid "The following environment variable definitions may be needed:~%" |
| 370 | msgstr "De følgende miljøvariabeldefinitioner kan være krævet:~%" | 410 | msgstr "De følgende miljøvariabeldefinitioner kan være krævet:~%" |
| 371 | 411 | ||
| 372 | #: guix/scripts/package.scm:422 | 412 | #: guix/scripts/package.scm:417 |
| 373 | msgid "" | 413 | msgid "" |
| 374 | "Usage: guix package [OPTION]... PACKAGES...\n" | 414 | "Usage: guix package [OPTION]... PACKAGES...\n" |
| 375 | "Install, remove, or upgrade PACKAGES in a single transaction.\n" | 415 | "Install, remove, or upgrade PACKAGES in a single transaction.\n" |
| @@ -377,7 +417,7 @@ msgstr "" | |||
| 377 | "Brug: guix-pakke [TILVALG]... PAKKER...\n" | 417 | "Brug: guix-pakke [TILVALG]... PAKKER...\n" |
| 378 | "Installer, fjern eller opgrader PAKKER i en enkel transaktion.\n" | 418 | "Installer, fjern eller opgrader PAKKER i en enkel transaktion.\n" |
| 379 | 419 | ||
| 380 | #: guix/scripts/package.scm:424 | 420 | #: guix/scripts/package.scm:419 |
| 381 | msgid "" | 421 | msgid "" |
| 382 | "\n" | 422 | "\n" |
| 383 | " -i, --install=PACKAGE install PACKAGE" | 423 | " -i, --install=PACKAGE install PACKAGE" |
| @@ -385,7 +425,7 @@ msgstr "" | |||
| 385 | "\n" | 425 | "\n" |
| 386 | " -i, --install=PAKKE installer PAKKE" | 426 | " -i, --install=PAKKE installer PAKKE" |
| 387 | 427 | ||
| 388 | #: guix/scripts/package.scm:426 | 428 | #: guix/scripts/package.scm:421 |
| 389 | msgid "" | 429 | msgid "" |
| 390 | "\n" | 430 | "\n" |
| 391 | " -e, --install-from-expression=EXP\n" | 431 | " -e, --install-from-expression=EXP\n" |
| @@ -395,7 +435,7 @@ msgstr "" | |||
| 395 | " -e, --install-from-expression=UDTRYK\n" | 435 | " -e, --install-from-expression=UDTRYK\n" |
| 396 | " installer pakken UDTRYK evaluerer til" | 436 | " installer pakken UDTRYK evaluerer til" |
| 397 | 437 | ||
| 398 | #: guix/scripts/package.scm:429 | 438 | #: guix/scripts/package.scm:424 |
| 399 | msgid "" | 439 | msgid "" |
| 400 | "\n" | 440 | "\n" |
| 401 | " -r, --remove=PACKAGE remove PACKAGE" | 441 | " -r, --remove=PACKAGE remove PACKAGE" |
| @@ -403,7 +443,7 @@ msgstr "" | |||
| 403 | "\n" | 443 | "\n" |
| 404 | " -r, --remove=PAKKE fjern PAKKE" | 444 | " -r, --remove=PAKKE fjern PAKKE" |
| 405 | 445 | ||
| 406 | #: guix/scripts/package.scm:431 | 446 | #: guix/scripts/package.scm:426 |
| 407 | msgid "" | 447 | msgid "" |
| 408 | "\n" | 448 | "\n" |
| 409 | " -u, --upgrade[=REGEXP] upgrade all the installed packages matching REGEXP" | 449 | " -u, --upgrade[=REGEXP] upgrade all the installed packages matching REGEXP" |
| @@ -413,7 +453,15 @@ msgstr "" | |||
| 413 | " opgrader alle de installerede pakker der matcher\n" | 453 | " opgrader alle de installerede pakker der matcher\n" |
| 414 | " REGUDTRYK" | 454 | " REGUDTRYK" |
| 415 | 455 | ||
| 416 | #: guix/scripts/package.scm:433 | 456 | #: guix/scripts/package.scm:428 |
| 457 | msgid "" | ||
| 458 | "\n" | ||
| 459 | " --do-not-upgrade[=REGEXP] do not upgrade any packages matching REGEXP" | ||
| 460 | msgstr "" | ||
| 461 | "\n" | ||
| 462 | " --do-not--upgrade[=REGUDTRYK] opgrader ikke pakker der matcher REGUDTRYK" | ||
| 463 | |||
| 464 | #: guix/scripts/package.scm:430 | ||
| 417 | msgid "" | 465 | msgid "" |
| 418 | "\n" | 466 | "\n" |
| 419 | " --roll-back roll back to the previous generation" | 467 | " --roll-back roll back to the previous generation" |
| @@ -421,7 +469,7 @@ msgstr "" | |||
| 421 | "\n" | 469 | "\n" |
| 422 | " --roll-back rul tilbage til den forrige generation" | 470 | " --roll-back rul tilbage til den forrige generation" |
| 423 | 471 | ||
| 424 | #: guix/scripts/package.scm:435 | 472 | #: guix/scripts/package.scm:432 |
| 425 | msgid "" | 473 | msgid "" |
| 426 | "\n" | 474 | "\n" |
| 427 | " --search-paths display needed environment variable definitions" | 475 | " --search-paths display needed environment variable definitions" |
| @@ -429,7 +477,7 @@ msgstr "" | |||
| 429 | "\n" | 477 | "\n" |
| 430 | " --search-paths vis krævede miljøvariabeldefinitioner" | 478 | " --search-paths vis krævede miljøvariabeldefinitioner" |
| 431 | 479 | ||
| 432 | #: guix/scripts/package.scm:437 | 480 | #: guix/scripts/package.scm:434 |
| 433 | msgid "" | 481 | msgid "" |
| 434 | "\n" | 482 | "\n" |
| 435 | " -l, --list-generations[=PATTERN]\n" | 483 | " -l, --list-generations[=PATTERN]\n" |
| @@ -439,7 +487,7 @@ msgstr "" | |||
| 439 | " -l, --list-generations[=MØNSTER]\n" | 487 | " -l, --list-generations[=MØNSTER]\n" |
| 440 | " vis generationer der matcher MØNSTER" | 488 | " vis generationer der matcher MØNSTER" |
| 441 | 489 | ||
| 442 | #: guix/scripts/package.scm:440 | 490 | #: guix/scripts/package.scm:437 |
| 443 | msgid "" | 491 | msgid "" |
| 444 | "\n" | 492 | "\n" |
| 445 | " -d, --delete-generations[=PATTERN]\n" | 493 | " -d, --delete-generations[=PATTERN]\n" |
| @@ -449,7 +497,7 @@ msgstr "" | |||
| 449 | " -d, --delete-generations[=MØNSTER]\n" | 497 | " -d, --delete-generations[=MØNSTER]\n" |
| 450 | " slet generationer der matcher MØNSTER" | 498 | " slet generationer der matcher MØNSTER" |
| 451 | 499 | ||
| 452 | #: guix/scripts/package.scm:443 | 500 | #: guix/scripts/package.scm:440 |
| 453 | msgid "" | 501 | msgid "" |
| 454 | "\n" | 502 | "\n" |
| 455 | " -S, --switch-generation=PATTERN\n" | 503 | " -S, --switch-generation=PATTERN\n" |
| @@ -459,7 +507,7 @@ msgstr "" | |||
| 459 | " -S, --switch-generation=MØNSTER\n" | 507 | " -S, --switch-generation=MØNSTER\n" |
| 460 | " skift til et generationsmatchende MØNSTER" | 508 | " skift til et generationsmatchende MØNSTER" |
| 461 | 509 | ||
| 462 | #: guix/scripts/package.scm:446 | 510 | #: guix/scripts/package.scm:443 |
| 463 | msgid "" | 511 | msgid "" |
| 464 | "\n" | 512 | "\n" |
| 465 | " -p, --profile=PROFILE use PROFILE instead of the user's default profile" | 513 | " -p, --profile=PROFILE use PROFILE instead of the user's default profile" |
| @@ -467,7 +515,7 @@ msgstr "" | |||
| 467 | "\n" | 515 | "\n" |
| 468 | " -p, --profile=PROFIL brug PROFIL i stedet for brugerens standardprofil" | 516 | " -p, --profile=PROFIL brug PROFIL i stedet for brugerens standardprofil" |
| 469 | 517 | ||
| 470 | #: guix/scripts/package.scm:449 | 518 | #: guix/scripts/package.scm:446 |
| 471 | msgid "" | 519 | msgid "" |
| 472 | "\n" | 520 | "\n" |
| 473 | " --bootstrap use the bootstrap Guile to build the profile" | 521 | " --bootstrap use the bootstrap Guile to build the profile" |
| @@ -475,7 +523,7 @@ msgstr "" | |||
| 475 | "\n" | 523 | "\n" |
| 476 | " --bootstrap brug bootstrap Guile til at bygge profilen" | 524 | " --bootstrap brug bootstrap Guile til at bygge profilen" |
| 477 | 525 | ||
| 478 | #: guix/scripts/package.scm:451 guix/scripts/pull.scm:74 | 526 | #: guix/scripts/package.scm:448 guix/scripts/pull.scm:74 |
| 479 | msgid "" | 527 | msgid "" |
| 480 | "\n" | 528 | "\n" |
| 481 | " --verbose produce verbose output" | 529 | " --verbose produce verbose output" |
| @@ -483,7 +531,7 @@ msgstr "" | |||
| 483 | "\n" | 531 | "\n" |
| 484 | " --verbose lav uddybende uddata" | 532 | " --verbose lav uddybende uddata" |
| 485 | 533 | ||
| 486 | #: guix/scripts/package.scm:454 | 534 | #: guix/scripts/package.scm:451 |
| 487 | msgid "" | 535 | msgid "" |
| 488 | "\n" | 536 | "\n" |
| 489 | " -s, --search=REGEXP search in synopsis and description using REGEXP" | 537 | " -s, --search=REGEXP search in synopsis and description using REGEXP" |
| @@ -491,7 +539,7 @@ msgstr "" | |||
| 491 | "\n" | 539 | "\n" |
| 492 | " -s, --search=REGUDTRYK søg i synopsis og beskrivelse via REGUDTRYK" | 540 | " -s, --search=REGUDTRYK søg i synopsis og beskrivelse via REGUDTRYK" |
| 493 | 541 | ||
| 494 | #: guix/scripts/package.scm:456 | 542 | #: guix/scripts/package.scm:453 |
| 495 | msgid "" | 543 | msgid "" |
| 496 | "\n" | 544 | "\n" |
| 497 | " -I, --list-installed[=REGEXP]\n" | 545 | " -I, --list-installed[=REGEXP]\n" |
| @@ -501,7 +549,7 @@ msgstr "" | |||
| 501 | " -I, --list-installed[=REGUDTRYK]\n" | 549 | " -I, --list-installed[=REGUDTRYK]\n" |
| 502 | " vis installerede pakker der matcher REGUDTRYK" | 550 | " vis installerede pakker der matcher REGUDTRYK" |
| 503 | 551 | ||
| 504 | #: guix/scripts/package.scm:459 | 552 | #: guix/scripts/package.scm:456 |
| 505 | msgid "" | 553 | msgid "" |
| 506 | "\n" | 554 | "\n" |
| 507 | " -A, --list-available[=REGEXP]\n" | 555 | " -A, --list-available[=REGEXP]\n" |
| @@ -511,7 +559,7 @@ msgstr "" | |||
| 511 | " -A, --list-available[=REGUDTRYK]\n" | 559 | " -A, --list-available[=REGUDTRYK]\n" |
| 512 | " vis tilgængelige pakker der matcher REGUDTRYK" | 560 | " vis tilgængelige pakker der matcher REGUDTRYK" |
| 513 | 561 | ||
| 514 | #: guix/scripts/package.scm:462 | 562 | #: guix/scripts/package.scm:459 |
| 515 | msgid "" | 563 | msgid "" |
| 516 | "\n" | 564 | "\n" |
| 517 | " --show=PACKAGE show details about PACKAGE" | 565 | " --show=PACKAGE show details about PACKAGE" |
| @@ -519,64 +567,59 @@ msgstr "" | |||
| 519 | "\n" | 567 | "\n" |
| 520 | " --show=PACKAGE vis detaljer om PAKKE" | 568 | " --show=PACKAGE vis detaljer om PAKKE" |
| 521 | 569 | ||
| 522 | #: guix/scripts/package.scm:698 | 570 | #: guix/scripts/package.scm:730 |
| 523 | #, scheme-format | 571 | #, scheme-format |
| 524 | msgid "~A: extraneous argument~%" | 572 | msgid "~A: extraneous argument~%" |
| 525 | msgstr "~A: uvedkommende argument~%" | 573 | msgstr "~A: uvedkommende argument~%" |
| 526 | 574 | ||
| 527 | #: guix/scripts/package.scm:708 | 575 | #: guix/scripts/package.scm:738 |
| 528 | #, scheme-format | 576 | #, scheme-format |
| 529 | msgid "Try \"info '(guix) Invoking guix package'\" for more information.~%" | 577 | msgid "Try \"info '(guix) Invoking guix package'\" for more information.~%" |
| 530 | msgstr "Prøv »info '(guix) Invoking guix package« for yderligere information.~%" | 578 | msgstr "Prøv »info '(guix) Invoking guix package« for yderligere information.~%" |
| 531 | 579 | ||
| 532 | #: guix/scripts/package.scm:730 | 580 | #: guix/scripts/package.scm:760 |
| 533 | #, scheme-format | 581 | #, scheme-format |
| 534 | msgid "error: while creating directory `~a': ~a~%" | 582 | msgid "error: while creating directory `~a': ~a~%" |
| 535 | msgstr "fejl: under oprettelse af mappe »~a«: ~a~%" | 583 | msgstr "fejl: under oprettelse af mappe »~a«: ~a~%" |
| 536 | 584 | ||
| 537 | #: guix/scripts/package.scm:734 | 585 | #: guix/scripts/package.scm:764 |
| 538 | #, scheme-format | 586 | #, scheme-format |
| 539 | msgid "Please create the `~a' directory, with you as the owner.~%" | 587 | msgid "Please create the `~a' directory, with you as the owner.~%" |
| 540 | msgstr "Opret venligst mappen »~a«, med dig som ejer.~%" | 588 | msgstr "Opret venligst mappen »~a«, med dig som ejer.~%" |
| 541 | 589 | ||
| 542 | #: guix/scripts/package.scm:741 | 590 | #: guix/scripts/package.scm:771 |
| 543 | #, scheme-format | 591 | #, scheme-format |
| 544 | msgid "error: directory `~a' is not owned by you~%" | 592 | msgid "error: directory `~a' is not owned by you~%" |
| 545 | msgstr "fejl: mappen »~a« er ikke ejet af dig~%" | 593 | msgstr "fejl: mappen »~a« er ikke ejet af dig~%" |
| 546 | 594 | ||
| 547 | #: guix/scripts/package.scm:744 | 595 | #: guix/scripts/package.scm:774 |
| 548 | #, scheme-format | 596 | #, scheme-format |
| 549 | msgid "Please change the owner of `~a' to user ~s.~%" | 597 | msgid "Please change the owner of `~a' to user ~s.~%" |
| 550 | msgstr "Ændr venligst ejeren af »~a« til brugeren ~s.~%" | 598 | msgstr "Ændr venligst ejeren af »~a« til brugeren ~s.~%" |
| 551 | 599 | ||
| 552 | #: guix/scripts/package.scm:777 | 600 | #: guix/scripts/package.scm:804 |
| 553 | #, scheme-format | 601 | #, scheme-format |
| 554 | msgid "cannot switch to generation '~a'~%" | 602 | msgid "cannot switch to generation '~a'~%" |
| 555 | msgstr "kan ikke skifte til generation »~a«~%" | 603 | msgstr "kan ikke skifte til generation »~a«~%" |
| 556 | 604 | ||
| 557 | #: guix/scripts/package.scm:809 guix/scripts/package.scm:910 | 605 | #: guix/scripts/package.scm:852 |
| 558 | #, scheme-format | ||
| 559 | msgid "invalid syntax: ~a~%" | ||
| 560 | msgstr "ugyldig syntaks: ~a~%" | ||
| 561 | |||
| 562 | #: guix/scripts/package.scm:846 | ||
| 563 | #, scheme-format | 606 | #, scheme-format |
| 564 | msgid "nothing to be done~%" | 607 | msgid "nothing to be done~%" |
| 565 | msgstr "intet at udføre~%" | 608 | msgstr "intet at udføre~%" |
| 566 | 609 | ||
| 567 | #: guix/scripts/package.scm:861 | 610 | #: guix/scripts/package.scm:868 |
| 568 | #, scheme-format | 611 | #, scheme-format |
| 569 | msgid "~a package in profile~%" | 612 | msgid "~a package in profile~%" |
| 570 | msgid_plural "~a packages in profile~%" | 613 | msgid_plural "~a packages in profile~%" |
| 571 | msgstr[0] "~a pakke i profil~%" | 614 | msgstr[0] "~a pakke i profil~%" |
| 572 | msgstr[1] "~a pakker i profil~%" | 615 | msgstr[1] "~a pakker i profil~%" |
| 573 | 616 | ||
| 574 | #: guix/scripts/package.scm:876 | 617 | #: guix/scripts/package.scm:883 |
| 575 | #, scheme-format | 618 | #, scheme-format |
| 576 | msgid "Generation ~a\t~a" | 619 | msgid "Generation ~a\t~a" |
| 577 | msgstr "Generation ~a\t~a" | 620 | msgstr "Generation ~a\t~a" |
| 578 | 621 | ||
| 579 | #: guix/scripts/package.scm:883 | 622 | #: guix/scripts/package.scm:890 |
| 580 | #, scheme-format | 623 | #, scheme-format |
| 581 | msgid "~a\t(current)~%" | 624 | msgid "~a\t(current)~%" |
| 582 | msgstr "~a\t(nuværende)~%" | 625 | msgstr "~a\t(nuværende)~%" |
| @@ -679,7 +722,7 @@ msgstr "" | |||
| 679 | msgid "unrecognized option: ~a~%" | 722 | msgid "unrecognized option: ~a~%" |
| 680 | msgstr "tilvalg blev ikke genkendt: ~a~%" | 723 | msgstr "tilvalg blev ikke genkendt: ~a~%" |
| 681 | 724 | ||
| 682 | #: guix/scripts/hash.scm:134 guix/ui.scm:258 | 725 | #: guix/scripts/hash.scm:134 guix/ui.scm:318 |
| 683 | #, scheme-format | 726 | #, scheme-format |
| 684 | msgid "~a~%" | 727 | msgid "~a~%" |
| 685 | msgstr "~a~%" | 728 | msgstr "~a~%" |
| @@ -689,6 +732,28 @@ msgstr "~a~%" | |||
| 689 | msgid "wrong number of arguments~%" | 732 | msgid "wrong number of arguments~%" |
| 690 | msgstr "forkert antal argumenter~%" | 733 | msgstr "forkert antal argumenter~%" |
| 691 | 734 | ||
| 735 | #: guix/scripts/import.scm:85 | ||
| 736 | msgid "" | ||
| 737 | "Usage: guix import IMPORTER ARGS ...\n" | ||
| 738 | "Run IMPORTER with ARGS.\n" | ||
| 739 | msgstr "" | ||
| 740 | "Brug: guix import IMPORTER ARG ...\n" | ||
| 741 | "Kør IMPORTER med ARG.\n" | ||
| 742 | |||
| 743 | #: guix/scripts/import.scm:88 | ||
| 744 | msgid "IMPORTER must be one of the importers listed below:\n" | ||
| 745 | msgstr "IMPORTER skal være en af importørerne vist nedenfor:\n" | ||
| 746 | |||
| 747 | #: guix/scripts/import.scm:101 | ||
| 748 | #, scheme-format | ||
| 749 | msgid "guix import: missing importer name~%" | ||
| 750 | msgstr "guix import: mangler importørnavn~%" | ||
| 751 | |||
| 752 | #: guix/scripts/import.scm:112 | ||
| 753 | #, scheme-format | ||
| 754 | msgid "guix import: invalid importer~%" | ||
| 755 | msgstr "guix import: ugyldig importør~%" | ||
| 756 | |||
| 692 | #: guix/scripts/pull.scm:72 | 757 | #: guix/scripts/pull.scm:72 |
| 693 | msgid "" | 758 | msgid "" |
| 694 | "Usage: guix pull [OPTION]...\n" | 759 | "Usage: guix pull [OPTION]...\n" |
| @@ -726,123 +791,123 @@ msgstr "udpakker »~a«...~%" | |||
| 726 | msgid "failed to unpack source code" | 791 | msgid "failed to unpack source code" |
| 727 | msgstr "kunne ikke udpakke kildekode" | 792 | msgstr "kunne ikke udpakke kildekode" |
| 728 | 793 | ||
| 729 | #: guix/scripts/pull.scm:200 | 794 | #: guix/scripts/pull.scm:202 |
| 795 | msgid "Guix already up to date\n" | ||
| 796 | msgstr "Guix er allerede opdateret\n" | ||
| 797 | |||
| 798 | #: guix/scripts/pull.scm:207 | ||
| 730 | #, scheme-format | 799 | #, scheme-format |
| 731 | msgid "updated ~a successfully deployed under `~a'~%" | 800 | msgid "updated ~a successfully deployed under `~a'~%" |
| 732 | msgstr "opdaterede ~a der med succes blev udrullet undet »~a«~%" | 801 | msgstr "opdaterede ~a der med succes blev udrullet undet »~a«~%" |
| 733 | 802 | ||
| 734 | #: guix/scripts/pull.scm:203 | 803 | #: guix/scripts/pull.scm:210 |
| 735 | #, scheme-format | 804 | #, scheme-format |
| 736 | msgid "failed to update Guix, check the build log~%" | 805 | msgid "failed to update Guix, check the build log~%" |
| 737 | msgstr "kunne ikke opdatere Guix, kontroller byggeloggen~%" | 806 | msgstr "kunne ikke opdatere Guix, kontroller byggeloggen~%" |
| 738 | 807 | ||
| 739 | #: guix/scripts/pull.scm:205 | 808 | #: guix/scripts/pull.scm:219 |
| 740 | msgid "Guix already up to date\n" | ||
| 741 | msgstr "Guix er allerede opdateret\n" | ||
| 742 | |||
| 743 | #: guix/scripts/pull.scm:215 | ||
| 744 | #, scheme-format | 809 | #, scheme-format |
| 745 | msgid "~A: unexpected argument~%" | 810 | msgid "~A: unexpected argument~%" |
| 746 | msgstr "~A: uventet argument~%" | 811 | msgstr "~A: uventet argument~%" |
| 747 | 812 | ||
| 748 | #: guix/scripts/pull.scm:224 | 813 | #: guix/scripts/pull.scm:228 |
| 749 | msgid "failed to download up-to-date source, exiting\n" | 814 | msgid "failed to download up-to-date source, exiting\n" |
| 750 | msgstr "kunne ikke hente opdateret kilde, afslutter\n" | 815 | msgstr "kunne ikke hente opdateret kilde, afslutter\n" |
| 751 | 816 | ||
| 752 | #: guix/scripts/substitute-binary.scm:80 | 817 | #: guix/scripts/substitute.scm:81 |
| 753 | #, scheme-format | 818 | #, scheme-format |
| 754 | msgid "authentication and authorization of substitutes disabled!~%" | 819 | msgid "authentication and authorization of substitutes disabled!~%" |
| 755 | msgstr "godkendelse og autorisation af substitutter er deaktiveret!~%" | 820 | msgstr "godkendelse og autorisation af substitutter er deaktiveret!~%" |
| 756 | 821 | ||
| 757 | #: guix/scripts/substitute-binary.scm:163 | 822 | #: guix/scripts/substitute.scm:157 |
| 758 | #, scheme-format | 823 | #, scheme-format |
| 759 | msgid "download from '~a' failed: ~a, ~s~%" | 824 | msgid "download from '~a' failed: ~a, ~s~%" |
| 760 | msgstr "hent fra »~a« mislykkedes: ~a, ~s~%" | 825 | msgstr "hent fra »~a« mislykkedes: ~a, ~s~%" |
| 761 | 826 | ||
| 762 | #: guix/scripts/substitute-binary.scm:178 | 827 | #: guix/scripts/substitute.scm:169 |
| 763 | #, scheme-format | 828 | #, scheme-format |
| 764 | msgid "while fetching ~a: server is somewhat slow~%" | 829 | msgid "while fetching ~a: server is somewhat slow~%" |
| 765 | msgstr "under overførsel af ~a: server er noget langsom~%" | 830 | msgstr "under overførsel af ~a: server er noget langsom~%" |
| 766 | 831 | ||
| 767 | #: guix/scripts/substitute-binary.scm:180 | 832 | #: guix/scripts/substitute.scm:171 |
| 768 | #, scheme-format | 833 | #, scheme-format |
| 769 | msgid "try `--no-substitutes' if the problem persists~%" | 834 | msgid "try `--no-substitutes' if the problem persists~%" |
| 770 | msgstr "prøv »--no-substitutes« hvis problemet fortsætter~%" | 835 | msgstr "prøv »--no-substitutes« hvis problemet fortsætter~%" |
| 771 | 836 | ||
| 772 | #: guix/scripts/substitute-binary.scm:221 | 837 | #: guix/scripts/substitute.scm:214 |
| 773 | #, scheme-format | 838 | #, scheme-format |
| 774 | msgid "updating list of substitutes from '~a'...~%" | 839 | msgid "updating list of substitutes from '~a'...\r" |
| 775 | msgstr "opdaterer liste af substitutter fra »~a«...~%" | 840 | msgstr "opdaterer liste af substitutter fra »~a«...\r" |
| 776 | 841 | ||
| 777 | #: guix/scripts/substitute-binary.scm:253 | 842 | #: guix/scripts/substitute.scm:246 |
| 778 | #, scheme-format | 843 | #, scheme-format |
| 779 | msgid "signature version must be a number: ~s~%" | 844 | msgid "signature version must be a number: ~s~%" |
| 780 | msgstr "signaturversion skal være et nummer: ~s~%" | 845 | msgstr "signaturversion skal være et nummer: ~s~%" |
| 781 | 846 | ||
| 782 | #: guix/scripts/substitute-binary.scm:257 | 847 | #: guix/scripts/substitute.scm:250 |
| 783 | #, scheme-format | 848 | #, scheme-format |
| 784 | msgid "unsupported signature version: ~a~%" | 849 | msgid "unsupported signature version: ~a~%" |
| 785 | msgstr "signaturversion er ikke understøttet: ~a~%" | 850 | msgstr "signaturversion er ikke understøttet: ~a~%" |
| 786 | 851 | ||
| 787 | #: guix/scripts/substitute-binary.scm:265 | 852 | #: guix/scripts/substitute.scm:258 |
| 788 | #, scheme-format | 853 | #, scheme-format |
| 789 | msgid "signature is not a valid s-expression: ~s~%" | 854 | msgid "signature is not a valid s-expression: ~s~%" |
| 790 | msgstr "signatur er ikke et gyldigt s-udtryk: ~s~%" | 855 | msgstr "signatur er ikke et gyldigt s-udtryk: ~s~%" |
| 791 | 856 | ||
| 792 | #: guix/scripts/substitute-binary.scm:269 | 857 | #: guix/scripts/substitute.scm:262 |
| 793 | #, scheme-format | 858 | #, scheme-format |
| 794 | msgid "invalid format of the signature field: ~a~%" | 859 | msgid "invalid format of the signature field: ~a~%" |
| 795 | msgstr "ugyldigt format for signaturfeltet: ~a~%" | 860 | msgstr "ugyldigt format for signaturfeltet: ~a~%" |
| 796 | 861 | ||
| 797 | #: guix/scripts/substitute-binary.scm:304 | 862 | #: guix/scripts/substitute.scm:297 |
| 798 | #, scheme-format | 863 | #, scheme-format |
| 799 | msgid "invalid signature for '~a'~%" | 864 | msgid "invalid signature for '~a'~%" |
| 800 | msgstr "ugyldig signatur for »~a«~%" | 865 | msgstr "ugyldig signatur for »~a«~%" |
| 801 | 866 | ||
| 802 | #: guix/scripts/substitute-binary.scm:306 | 867 | #: guix/scripts/substitute.scm:299 |
| 803 | #, scheme-format | 868 | #, scheme-format |
| 804 | msgid "hash mismatch for '~a'~%" | 869 | msgid "hash mismatch for '~a'~%" |
| 805 | msgstr "hash mismatch for »~a«~%" | 870 | msgstr "hash mismatch for »~a«~%" |
| 806 | 871 | ||
| 807 | #: guix/scripts/substitute-binary.scm:308 | 872 | #: guix/scripts/substitute.scm:301 |
| 808 | #, scheme-format | 873 | #, scheme-format |
| 809 | msgid "'~a' is signed with an unauthorized key~%" | 874 | msgid "'~a' is signed with an unauthorized key~%" |
| 810 | msgstr "»~a« er underskrevet med en uautoriseret nøgle~%" | 875 | msgstr "»~a« er underskrevet med en uautoriseret nøgle~%" |
| 811 | 876 | ||
| 812 | #: guix/scripts/substitute-binary.scm:310 | 877 | #: guix/scripts/substitute.scm:303 |
| 813 | #, scheme-format | 878 | #, scheme-format |
| 814 | msgid "signature on '~a' is corrupt~%" | 879 | msgid "signature on '~a' is corrupt~%" |
| 815 | msgstr "signatur på »~a« er ødelagt~%" | 880 | msgstr "signatur på »~a« er ødelagt~%" |
| 816 | 881 | ||
| 817 | #: guix/scripts/substitute-binary.scm:344 | 882 | #: guix/scripts/substitute.scm:341 |
| 818 | #, scheme-format | 883 | #, scheme-format |
| 819 | msgid "substitute at '~a' lacks a signature~%" | 884 | msgid "substitute at '~a' lacks a signature~%" |
| 820 | msgstr "substitut på »~a« mangler en signatur~%" | 885 | msgstr "substitut på »~a« mangler en signatur~%" |
| 821 | 886 | ||
| 822 | #: guix/scripts/substitute-binary.scm:532 | 887 | #: guix/scripts/substitute.scm:504 |
| 823 | #, scheme-format | 888 | #, scheme-format |
| 824 | msgid "Downloading, please wait...~%" | 889 | msgid "updating list of substitutes from '~a'... ~5,1f%" |
| 825 | msgstr "Henter, vent venligst ...~%" | 890 | msgstr "opdaterer liste af substitutter fra »~a«... ~5,1f%" |
| 826 | 891 | ||
| 827 | #: guix/scripts/substitute-binary.scm:534 | 892 | #: guix/scripts/substitute.scm:552 |
| 828 | #, scheme-format | 893 | #, scheme-format |
| 829 | msgid "(Please consider upgrading Guile to get proper progress report.)~%" | 894 | msgid "~s: unsupported server URI scheme~%" |
| 830 | msgstr "(Overvej venligst at opgradere Guile for at f korrekt statusrapport.)~%" | 895 | msgstr "~s: ikke understttet server-URI-skema~%" |
| 831 | 896 | ||
| 832 | #: guix/scripts/substitute-binary.scm:547 | 897 | #: guix/scripts/substitute.scm:663 |
| 833 | #, scheme-format | 898 | #, scheme-format |
| 834 | msgid "host name lookup error: ~a~%" | 899 | msgid "host name lookup error: ~a~%" |
| 835 | msgstr "opslagsfejl for værtsnavn: ~a~%" | 900 | msgstr "opslagsfejl for værtsnavn: ~a~%" |
| 836 | 901 | ||
| 837 | #: guix/scripts/substitute-binary.scm:556 | 902 | #: guix/scripts/substitute.scm:672 |
| 838 | msgid "" | 903 | msgid "" |
| 839 | "Usage: guix substitute-binary [OPTION]...\n" | 904 | "Usage: guix substitute [OPTION]...\n" |
| 840 | "Internal tool to substitute a pre-built binary to a local build.\n" | 905 | "Internal tool to substitute a pre-built binary to a local build.\n" |
| 841 | msgstr "" | 906 | msgstr "" |
| 842 | "Brug: guix substitute-binary [TILVALG]...\n" | 907 | "Brug: guix substitute [TILVALG] ...\n" |
| 843 | "Internt værktøj til at erstatte en præbygget binær fil med en lokal bygning.\n" | 908 | "Internt værktøj til at erstatte en præbygget binær fil med en lokal bygning.\n" |
| 844 | 909 | ||
| 845 | #: guix/scripts/substitute-binary.scm:558 | 910 | #: guix/scripts/substitute.scm:674 |
| 846 | msgid "" | 911 | msgid "" |
| 847 | "\n" | 912 | "\n" |
| 848 | " --query report on the availability of substitutes for the\n" | 913 | " --query report on the availability of substitutes for the\n" |
| @@ -852,7 +917,7 @@ msgstr "" | |||
| 852 | " --query rapport om tilgængeligheden for substitutter for\n" | 917 | " --query rapport om tilgængeligheden for substitutter for\n" |
| 853 | " lagerfilnavnene sendt til standardind" | 918 | " lagerfilnavnene sendt til standardind" |
| 854 | 919 | ||
| 855 | #: guix/scripts/substitute-binary.scm:561 | 920 | #: guix/scripts/substitute.scm:677 |
| 856 | msgid "" | 921 | msgid "" |
| 857 | "\n" | 922 | "\n" |
| 858 | " --substitute STORE-FILE DESTINATION\n" | 923 | " --substitute STORE-FILE DESTINATION\n" |
| @@ -864,21 +929,21 @@ msgstr "" | |||
| 864 | " hent LAGER-FIL og lagr den som en Nar i filen\n" | 929 | " hent LAGER-FIL og lagr den som en Nar i filen\n" |
| 865 | " DESTINATION" | 930 | " DESTINATION" |
| 866 | 931 | ||
| 867 | #: guix/scripts/substitute-binary.scm:606 | 932 | #: guix/scripts/substitute.scm:712 |
| 868 | msgid "ACL for archive imports seems to be uninitialized, substitutes may be unavailable\n" | 933 | msgid "ACL for archive imports seems to be uninitialized, substitutes may be unavailable\n" |
| 869 | msgstr "ACL for arkivimporter ser ikke ud til at være initialiseret, substitutter kan være utilgængelige\n" | 934 | msgstr "ACL for arkivimporter ser ikke ud til at være initialiseret, substitutter kan være utilgængelige\n" |
| 870 | 935 | ||
| 871 | #: guix/scripts/substitute-binary.scm:640 | 936 | #: guix/scripts/substitute.scm:750 |
| 872 | #, scheme-format | 937 | #, scheme-format |
| 873 | msgid "these substitute URLs will not be used:~{ ~a~}~%" | 938 | msgid "these substitute URLs will not be used:~{ ~a~}~%" |
| 874 | msgstr "disse substitutadresser vil ikke blive brugt:~{ ~a~}~%" | 939 | msgstr "disse substitutadresser vil ikke blive brugt:~{ ~a~}~%" |
| 875 | 940 | ||
| 876 | #: guix/scripts/substitute-binary.scm:666 | 941 | #: guix/scripts/substitute.scm:776 |
| 877 | #, scheme-format | 942 | #, scheme-format |
| 878 | msgid "failed to look up host '~a' (~a), substituter disabled~%" | 943 | msgid "failed to look up host '~a' (~a), substituter disabled~%" |
| 879 | msgstr "kunne ikke slå vært op »~a« (~a), substitutter deaktiveret~%" | 944 | msgstr "kunne ikke slå vært op »~a« (~a), substitutter deaktiveret~%" |
| 880 | 945 | ||
| 881 | #: guix/scripts/substitute-binary.scm:777 | 946 | #: guix/scripts/substitute.scm:883 |
| 882 | #, scheme-format | 947 | #, scheme-format |
| 883 | msgid "~a: unrecognized options~%" | 948 | msgid "~a: unrecognized options~%" |
| 884 | msgstr "~a: ikke genkendte tilvalg~%" | 949 | msgstr "~a: ikke genkendte tilvalg~%" |
| @@ -903,7 +968,7 @@ msgstr "fejl: ikke autoriseret offentlig nøgle: ~a~%" | |||
| 903 | msgid "error: corrupt signature data: ~a~%" | 968 | msgid "error: corrupt signature data: ~a~%" |
| 904 | msgstr "fejl: ødelagt signaturdata: ~a~%" | 969 | msgstr "fejl: ødelagt signaturdata: ~a~%" |
| 905 | 970 | ||
| 906 | #: guix/scripts/authenticate.scm:126 | 971 | #: guix/scripts/authenticate.scm:120 |
| 907 | msgid "" | 972 | msgid "" |
| 908 | "Usage: guix authenticate OPTION...\n" | 973 | "Usage: guix authenticate OPTION...\n" |
| 909 | "Sign or verify the signature on the given file. This tool is meant to\n" | 974 | "Sign or verify the signature on the given file. This tool is meant to\n" |
| @@ -913,56 +978,41 @@ msgstr "" | |||
| 913 | "Underskriv eller verificer signaturen på den givne fil. Dette værktøj skal\n" | 978 | "Underskriv eller verificer signaturen på den givne fil. Dette værktøj skal\n" |
| 914 | "bruges internt af »guix-daemon«.\n" | 979 | "bruges internt af »guix-daemon«.\n" |
| 915 | 980 | ||
| 916 | #: guix/scripts/authenticate.scm:132 | 981 | #: guix/scripts/authenticate.scm:126 |
| 917 | msgid "wrong arguments" | 982 | msgid "wrong arguments" |
| 918 | msgstr "forkerte argumenter" | 983 | msgstr "forkerte argumenter" |
| 919 | 984 | ||
| 920 | #: guix/scripts/system.scm:75 | 985 | #: guix/scripts/system.scm:106 |
| 921 | #, scheme-format | ||
| 922 | msgid "failed to open operating system file '~a': ~a~%" | ||
| 923 | msgstr "kunne ikke åbne operativsystemfil »~a«: ~a~%" | ||
| 924 | |||
| 925 | #: guix/scripts/system.scm:79 | ||
| 926 | #, scheme-format | ||
| 927 | msgid "~a: error: ~a~%" | ||
| 928 | msgstr "~a: fejl: ~a~%" | ||
| 929 | |||
| 930 | #: guix/scripts/system.scm:83 | ||
| 931 | #, scheme-format | ||
| 932 | msgid "failed to load operating system file '~a':~%" | ||
| 933 | msgstr "kunne ikke indlæse operativsystemfil »~a«:~%" | ||
| 934 | |||
| 935 | #: guix/scripts/system.scm:120 | ||
| 936 | #, scheme-format | 986 | #, scheme-format |
| 937 | msgid "failed to register '~a' under '~a'~%" | 987 | msgid "failed to register '~a' under '~a'~%" |
| 938 | msgstr "kunne ikke registrere »~a« under »~a«~%" | 988 | msgstr "kunne ikke registrere »~a« under »~a«~%" |
| 939 | 989 | ||
| 940 | #: guix/scripts/system.scm:152 | 990 | #: guix/scripts/system.scm:138 |
| 941 | #, scheme-format | 991 | #, scheme-format |
| 942 | msgid "failed to install GRUB on device '~a'~%" | 992 | msgid "failed to install GRUB on device '~a'~%" |
| 943 | msgstr "kunne ikke installere GRUB på enhed »~a«~%" | 993 | msgstr "kunne ikke installere GRUB på enhed »~a«~%" |
| 944 | 994 | ||
| 945 | #: guix/scripts/system.scm:169 | 995 | #: guix/scripts/system.scm:155 |
| 946 | #, scheme-format | 996 | #, scheme-format |
| 947 | msgid "initializing the current root file system~%" | 997 | msgid "initializing the current root file system~%" |
| 948 | msgstr "initialiserer det nuværende root-filsystem~%" | 998 | msgstr "initialiserer det nuværende root-filsystem~%" |
| 949 | 999 | ||
| 950 | #: guix/scripts/system.scm:223 | 1000 | #: guix/scripts/system.scm:209 |
| 951 | #, scheme-format | 1001 | #, scheme-format |
| 952 | msgid "activating system...~%" | 1002 | msgid "activating system...~%" |
| 953 | msgstr "aktiverer system ...~%" | 1003 | msgstr "aktiverer system ...~%" |
| 954 | 1004 | ||
| 955 | #: guix/scripts/system.scm:273 | 1005 | #: guix/scripts/system.scm:259 |
| 956 | #, scheme-format | 1006 | #, scheme-format |
| 957 | msgid "unrecognized boot parameters for '~a'~%" | 1007 | msgid "unrecognized boot parameters for '~a'~%" |
| 958 | msgstr "ikke genkendte opstartsparametre for »~a«~%" | 1008 | msgstr "ikke genkendte opstartsparametre for »~a«~%" |
| 959 | 1009 | ||
| 960 | #: guix/scripts/system.scm:369 | 1010 | #: guix/scripts/system.scm:355 |
| 961 | #, scheme-format | 1011 | #, scheme-format |
| 962 | msgid "initializing operating system under '~a'...~%" | 1012 | msgid "initializing operating system under '~a'...~%" |
| 963 | msgstr "initialiserer operativsystem under »~a«...~%" | 1013 | msgstr "initialiserer operativsystem under »~a«...~%" |
| 964 | 1014 | ||
| 965 | #: guix/scripts/system.scm:385 | 1015 | #: guix/scripts/system.scm:371 |
| 966 | msgid "" | 1016 | msgid "" |
| 967 | "Usage: guix system [OPTION] ACTION FILE\n" | 1017 | "Usage: guix system [OPTION] ACTION FILE\n" |
| 968 | "Build the operating system declared in FILE according to ACTION.\n" | 1018 | "Build the operating system declared in FILE according to ACTION.\n" |
| @@ -970,35 +1020,35 @@ msgstr "" | |||
| 970 | "Brug: guix system [TILVALG] HANDLING FIL\n" | 1020 | "Brug: guix system [TILVALG] HANDLING FIL\n" |
| 971 | "Byg operativsystemet deklæret i FIL jævnfør HANDLING.\n" | 1021 | "Byg operativsystemet deklæret i FIL jævnfør HANDLING.\n" |
| 972 | 1022 | ||
| 973 | #: guix/scripts/system.scm:388 | 1023 | #: guix/scripts/system.scm:374 |
| 974 | msgid "The valid values for ACTION are:\n" | 1024 | msgid "The valid values for ACTION are:\n" |
| 975 | msgstr "De gyldige værdier for HANDLING er:\n" | 1025 | msgstr "De gyldige værdier for HANDLING er:\n" |
| 976 | 1026 | ||
| 977 | #: guix/scripts/system.scm:389 | 1027 | #: guix/scripts/system.scm:375 |
| 978 | msgid " - 'reconfigure', switch to a new operating system configuration\n" | 1028 | msgid " - 'reconfigure', switch to a new operating system configuration\n" |
| 979 | msgstr " - »reconfigure«, skift til en ny operativsystemkonfiguration\n" | 1029 | msgstr " - »reconfigure«, skift til en ny operativsystemkonfiguration\n" |
| 980 | 1030 | ||
| 981 | #: guix/scripts/system.scm:391 | 1031 | #: guix/scripts/system.scm:377 |
| 982 | msgid " - 'build', build the operating system without installing anything\n" | 1032 | msgid " - 'build', build the operating system without installing anything\n" |
| 983 | msgstr " - »build«, byg operativsystemet uden at installere noget\n" | 1033 | msgstr " - »build«, byg operativsystemet uden at installere noget\n" |
| 984 | 1034 | ||
| 985 | #: guix/scripts/system.scm:393 | 1035 | #: guix/scripts/system.scm:379 |
| 986 | msgid " - 'vm', build a virtual machine image that shares the host's store\n" | 1036 | msgid " - 'vm', build a virtual machine image that shares the host's store\n" |
| 987 | msgstr " - »vm«, byg et virtuelt maskinaftryk som deler værtens lager\n" | 1037 | msgstr " - »vm«, byg et virtuelt maskinaftryk som deler værtens lager\n" |
| 988 | 1038 | ||
| 989 | #: guix/scripts/system.scm:395 | 1039 | #: guix/scripts/system.scm:381 |
| 990 | msgid " - 'vm-image', build a freestanding virtual machine image\n" | 1040 | msgid " - 'vm-image', build a freestanding virtual machine image\n" |
| 991 | msgstr " - »vm-image«, byg et fritstående virtuelt maskinaftryk\n" | 1041 | msgstr " - »vm-image«, byg et fritstående virtuelt maskinaftryk\n" |
| 992 | 1042 | ||
| 993 | #: guix/scripts/system.scm:397 | 1043 | #: guix/scripts/system.scm:383 |
| 994 | msgid " - 'disk-image', build a disk image, suitable for a USB stick\n" | 1044 | msgid " - 'disk-image', build a disk image, suitable for a USB stick\n" |
| 995 | msgstr " - »disk-image«, byg et diskaftryk, egnet for et USB-drev\n" | 1045 | msgstr " - »disk-image«, byg et diskaftryk, egnet for et USB-drev\n" |
| 996 | 1046 | ||
| 997 | #: guix/scripts/system.scm:399 | 1047 | #: guix/scripts/system.scm:385 |
| 998 | msgid " - 'init', initialize a root file system to run GNU.\n" | 1048 | msgid " - 'init', initialize a root file system to run GNU.\n" |
| 999 | msgstr " - »init«, initialiser et rootfilsystem til at køre GNU.\n" | 1049 | msgstr " - »init«, initialiser et rootfilsystem til at køre GNU.\n" |
| 1000 | 1050 | ||
| 1001 | #: guix/scripts/system.scm:403 | 1051 | #: guix/scripts/system.scm:389 |
| 1002 | msgid "" | 1052 | msgid "" |
| 1003 | "\n" | 1053 | "\n" |
| 1004 | " --image-size=SIZE for 'vm-image', produce an image of SIZE" | 1054 | " --image-size=SIZE for 'vm-image', produce an image of SIZE" |
| @@ -1006,7 +1056,7 @@ msgstr "" | |||
| 1006 | "\n" | 1056 | "\n" |
| 1007 | " --image-size=STR for »vm-image«, lav et aftryk af STR" | 1057 | " --image-size=STR for »vm-image«, lav et aftryk af STR" |
| 1008 | 1058 | ||
| 1009 | #: guix/scripts/system.scm:405 | 1059 | #: guix/scripts/system.scm:391 |
| 1010 | msgid "" | 1060 | msgid "" |
| 1011 | "\n" | 1061 | "\n" |
| 1012 | " --no-grub for 'init', do not install GRUB" | 1062 | " --no-grub for 'init', do not install GRUB" |
| @@ -1014,7 +1064,7 @@ msgstr "" | |||
| 1014 | "\n" | 1064 | "\n" |
| 1015 | " --no-grub for »init«, installer ikke GRUB" | 1065 | " --no-grub for »init«, installer ikke GRUB" |
| 1016 | 1066 | ||
| 1017 | #: guix/scripts/system.scm:407 | 1067 | #: guix/scripts/system.scm:393 |
| 1018 | msgid "" | 1068 | msgid "" |
| 1019 | "\n" | 1069 | "\n" |
| 1020 | " --share=SPEC for 'vm', share host file system according to SPEC" | 1070 | " --share=SPEC for 'vm', share host file system according to SPEC" |
| @@ -1022,7 +1072,7 @@ msgstr "" | |||
| 1022 | "\n" | 1072 | "\n" |
| 1023 | " --share=SPEC for »vm«, del værtsfilsystem jævnfør SPEC" | 1073 | " --share=SPEC for »vm«, del værtsfilsystem jævnfør SPEC" |
| 1024 | 1074 | ||
| 1025 | #: guix/scripts/system.scm:409 | 1075 | #: guix/scripts/system.scm:395 |
| 1026 | msgid "" | 1076 | msgid "" |
| 1027 | "\n" | 1077 | "\n" |
| 1028 | " --expose=SPEC for 'vm', expose host file system according to SPEC" | 1078 | " --expose=SPEC for 'vm', expose host file system according to SPEC" |
| @@ -1030,7 +1080,7 @@ msgstr "" | |||
| 1030 | "\n" | 1080 | "\n" |
| 1031 | " --expose=SPEC for »vm«, fremvis værtsfilsystem jævnfør SPEC" | 1081 | " --expose=SPEC for »vm«, fremvis værtsfilsystem jævnfør SPEC" |
| 1032 | 1082 | ||
| 1033 | #: guix/scripts/system.scm:411 | 1083 | #: guix/scripts/system.scm:397 |
| 1034 | msgid "" | 1084 | msgid "" |
| 1035 | "\n" | 1085 | "\n" |
| 1036 | " --full-boot for 'vm', make a full boot sequence" | 1086 | " --full-boot for 'vm', make a full boot sequence" |
| @@ -1038,36 +1088,36 @@ msgstr "" | |||
| 1038 | "\n" | 1088 | "\n" |
| 1039 | " --full-boot for »vm«, lav en fuld opstartssekvens" | 1089 | " --full-boot for »vm«, lav en fuld opstartssekvens" |
| 1040 | 1090 | ||
| 1041 | #: guix/scripts/system.scm:507 | 1091 | #: guix/scripts/system.scm:484 |
| 1042 | #, scheme-format | 1092 | #, scheme-format |
| 1043 | msgid "~a: unknown action~%" | 1093 | msgid "~a: unknown action~%" |
| 1044 | msgstr "~a: ukendt handling~%" | 1094 | msgstr "~a: ukendt handling~%" |
| 1045 | 1095 | ||
| 1046 | #: guix/scripts/system.scm:524 | 1096 | #: guix/scripts/system.scm:499 |
| 1047 | #, scheme-format | 1097 | #, scheme-format |
| 1048 | msgid "wrong number of arguments for action '~a'~%" | 1098 | msgid "wrong number of arguments for action '~a'~%" |
| 1049 | msgstr "forkert antal argumenter for handling »~a«~%" | 1099 | msgstr "forkert antal argumenter for handling »~a«~%" |
| 1050 | 1100 | ||
| 1051 | #: guix/scripts/system.scm:544 | 1101 | #: guix/scripts/system.scm:522 |
| 1052 | #, scheme-format | 1102 | #, scheme-format |
| 1053 | msgid "no configuration file specified~%" | 1103 | msgid "no configuration file specified~%" |
| 1054 | msgstr "ingen konfigurationsfil angivet~%" | 1104 | msgstr "ingen konfigurationsfil angivet~%" |
| 1055 | 1105 | ||
| 1056 | #: guix/scripts/lint.scm:82 | 1106 | #: guix/scripts/lint.scm:90 |
| 1057 | #, scheme-format | 1107 | #, scheme-format |
| 1058 | msgid "Available checkers:~%" | 1108 | msgid "Available checkers:~%" |
| 1059 | msgstr "Tilgængelige kontrolprogrammer:~%" | 1109 | msgstr "Tilgængelige kontrolprogrammer:~%" |
| 1060 | 1110 | ||
| 1061 | #: guix/scripts/lint.scm:102 | 1111 | #: guix/scripts/lint.scm:110 |
| 1062 | msgid "description should not be empty" | 1112 | msgid "description should not be empty" |
| 1063 | msgstr "beskrivelse skal være udfyldt" | 1113 | msgstr "beskrivelse skal være udfyldt" |
| 1064 | 1114 | ||
| 1065 | #: guix/scripts/lint.scm:109 | 1115 | #: guix/scripts/lint.scm:117 |
| 1066 | msgid "description should start with an upper-case letter or digit" | 1116 | msgid "description should start with an upper-case letter or digit" |
| 1067 | msgstr "beskrivelse skal starte med et stort bogstav eller et tal" | 1117 | msgstr "beskrivelse skal starte med et stort bogstav eller et tal" |
| 1068 | 1118 | ||
| 1069 | # arg, hvad foregår der her | 1119 | # arg, hvad foregår der her |
| 1070 | #: guix/scripts/lint.scm:125 | 1120 | #: guix/scripts/lint.scm:133 |
| 1071 | #, scheme-format | 1121 | #, scheme-format |
| 1072 | msgid "" | 1122 | msgid "" |
| 1073 | "sentences in description should be followed ~\n" | 1123 | "sentences in description should be followed ~\n" |
| @@ -1076,101 +1126,115 @@ msgstr "" | |||
| 1076 | "sætninger i beskrivelsen skal efterfølges ~\n" | 1126 | "sætninger i beskrivelsen skal efterfølges ~\n" |
| 1077 | "af to mellemrum; mulig infraction~p ved ~{~a~^, ~}" | 1127 | "af to mellemrum; mulig infraction~p ved ~{~a~^, ~}" |
| 1078 | 1128 | ||
| 1079 | #: guix/scripts/lint.scm:146 | 1129 | #: guix/scripts/lint.scm:154 |
| 1080 | msgid "pkg-config should probably be a native input" | 1130 | msgid "pkg-config should probably be a native input" |
| 1081 | msgstr "pkg-config skal sandsynligvis være standarddata" | 1131 | msgstr "pkg-config skal sandsynligvis være standarddata" |
| 1082 | 1132 | ||
| 1083 | #: guix/scripts/lint.scm:161 | 1133 | #: guix/scripts/lint.scm:169 |
| 1084 | msgid "synopsis should not be empty" | 1134 | msgid "synopsis should not be empty" |
| 1085 | msgstr "synopsis skal være udfyldt" | 1135 | msgstr "synopsis skal være udfyldt" |
| 1086 | 1136 | ||
| 1087 | #: guix/scripts/lint.scm:169 | 1137 | #: guix/scripts/lint.scm:177 |
| 1088 | msgid "no period allowed at the end of the synopsis" | 1138 | msgid "no period allowed at the end of the synopsis" |
| 1089 | msgstr "ingen periode er tilladt i slutningen af synopsen" | 1139 | msgstr "ingen periode er tilladt i slutningen af synopsen" |
| 1090 | 1140 | ||
| 1091 | #: guix/scripts/lint.scm:181 | 1141 | #: guix/scripts/lint.scm:189 |
| 1092 | msgid "no article allowed at the beginning of the synopsis" | 1142 | msgid "no article allowed at the beginning of the synopsis" |
| 1093 | msgstr "ingen artikel er tilladt i begyndelsen af synopsen" | 1143 | msgstr "ingen artikel er tilladt i begyndelsen af synopsen" |
| 1094 | 1144 | ||
| 1095 | #: guix/scripts/lint.scm:188 | 1145 | #: guix/scripts/lint.scm:196 |
| 1096 | msgid "synopsis should be less than 80 characters long" | 1146 | msgid "synopsis should be less than 80 characters long" |
| 1097 | msgstr "synopsis skal være mindre end 80 tegn lang" | 1147 | msgstr "synopsis skal være mindre end 80 tegn lang" |
| 1098 | 1148 | ||
| 1099 | #: guix/scripts/lint.scm:194 | 1149 | #: guix/scripts/lint.scm:202 |
| 1100 | msgid "synopsis should start with an upper-case letter or digit" | 1150 | msgid "synopsis should start with an upper-case letter or digit" |
| 1101 | msgstr "synopsis skal starte med et stort bogstav eller et tal" | 1151 | msgstr "synopsis skal starte med et stort bogstav eller et tal" |
| 1102 | 1152 | ||
| 1103 | #: guix/scripts/lint.scm:201 | 1153 | #: guix/scripts/lint.scm:209 |
| 1104 | msgid "synopsis should not start with the package name" | 1154 | msgid "synopsis should not start with the package name" |
| 1105 | msgstr "synopsis skal ikke starte med pakkenavnet" | 1155 | msgstr "synopsis skal ikke starte med pakkenavnet" |
| 1106 | 1156 | ||
| 1107 | #: guix/scripts/lint.scm:270 | 1157 | #: guix/scripts/lint.scm:299 guix/scripts/lint.scm:310 |
| 1108 | #, scheme-format | 1158 | #, scheme-format |
| 1109 | msgid "URI ~a not reachable: ~a (~s)" | 1159 | msgid "URI ~a not reachable: ~a (~s)" |
| 1110 | msgstr "URI ~a kan ikke nås: ~a (~s)" | 1160 | msgstr "URI ~a kan ikke nås: ~a (~s)" |
| 1111 | 1161 | ||
| 1112 | #: guix/scripts/lint.scm:278 | 1162 | #: guix/scripts/lint.scm:316 |
| 1113 | #, scheme-format | 1163 | #, scheme-format |
| 1114 | msgid "URI ~a domain not found: ~a" | 1164 | msgid "URI ~a domain not found: ~a" |
| 1115 | msgstr "URI ~a domæne blev ikke fundet: ~a" | 1165 | msgstr "URI ~a domæne blev ikke fundet: ~a" |
| 1116 | 1166 | ||
| 1117 | #: guix/scripts/lint.scm:286 | 1167 | #: guix/scripts/lint.scm:324 |
| 1118 | #, scheme-format | 1168 | #, scheme-format |
| 1119 | msgid "URI ~a unreachable: ~a" | 1169 | msgid "URI ~a unreachable: ~a" |
| 1120 | msgstr "URI ~a kan ikke nås: ~a" | 1170 | msgstr "URI ~a kan ikke nås: ~a" |
| 1121 | 1171 | ||
| 1122 | #: guix/scripts/lint.scm:312 | 1172 | #: guix/scripts/lint.scm:350 |
| 1123 | msgid "invalid value for home page" | 1173 | msgid "invalid value for home page" |
| 1124 | msgstr "ugyldig værdi for hjemmeside" | 1174 | msgstr "ugyldig værdi for hjemmeside" |
| 1125 | 1175 | ||
| 1126 | #: guix/scripts/lint.scm:315 | 1176 | #: guix/scripts/lint.scm:353 |
| 1127 | #, scheme-format | 1177 | #, scheme-format |
| 1128 | msgid "invalid home page URL: ~s" | 1178 | msgid "invalid home page URL: ~s" |
| 1129 | msgstr "ugyldig hjemmesideadresse: ~s" | 1179 | msgstr "ugyldig hjemmesideadresse: ~s" |
| 1130 | 1180 | ||
| 1131 | #: guix/scripts/lint.scm:336 | 1181 | #: guix/scripts/lint.scm:378 |
| 1132 | msgid "file names of patches should start with the package name" | 1182 | msgid "file names of patches should start with the package name" |
| 1133 | msgstr "filnavn for rettelser skal starte med pakkenavnet" | 1183 | msgstr "filnavn for rettelser skal starte med pakkenavnet" |
| 1134 | 1184 | ||
| 1135 | #: guix/scripts/lint.scm:374 | 1185 | #: guix/scripts/lint.scm:416 |
| 1136 | #, scheme-format | 1186 | #, scheme-format |
| 1137 | msgid "~a: ~a: proposed synopsis: ~s~%" | 1187 | msgid "~a: ~a: proposed synopsis: ~s~%" |
| 1138 | msgstr "~a: ~a: foreslået synopsis: ~s~%" | 1188 | msgstr "~a: ~a: foreslået synopsis: ~s~%" |
| 1139 | 1189 | ||
| 1140 | #: guix/scripts/lint.scm:386 | 1190 | #: guix/scripts/lint.scm:428 |
| 1141 | #, scheme-format | 1191 | #, scheme-format |
| 1142 | msgid "~a: ~a: proposed description:~% \"~a\"~%" | 1192 | msgid "~a: ~a: proposed description:~% \"~a\"~%" |
| 1143 | msgstr "~a: ~a: foreslået beskrivelse:~% »~a«~%" | 1193 | msgstr "~a: ~a: foreslået beskrivelse:~% »~a«~%" |
| 1144 | 1194 | ||
| 1145 | #: guix/scripts/lint.scm:415 | 1195 | #: guix/scripts/lint.scm:453 guix/scripts/lint.scm:457 |
| 1196 | #, scheme-format | ||
| 1197 | msgid "failed to create derivation: ~a" | ||
| 1198 | msgstr "kunne ikke oprette afledning: ~a" | ||
| 1199 | |||
| 1200 | #: guix/scripts/lint.scm:463 | ||
| 1201 | #, scheme-format | ||
| 1202 | msgid "failed to create derivation: ~s~%" | ||
| 1203 | msgstr "kunne ikke oprette afledning: ~s~%" | ||
| 1204 | |||
| 1205 | #: guix/scripts/lint.scm:476 | ||
| 1146 | msgid "Validate package descriptions" | 1206 | msgid "Validate package descriptions" |
| 1147 | msgstr "Valider pakkebeskrivelser" | 1207 | msgstr "Valider pakkebeskrivelser" |
| 1148 | 1208 | ||
| 1149 | #: guix/scripts/lint.scm:419 | 1209 | #: guix/scripts/lint.scm:480 |
| 1150 | msgid "Validate synopsis & description of GNU packages" | 1210 | msgid "Validate synopsis & description of GNU packages" |
| 1151 | msgstr "Valider synopsis og beskrivelse for GNU-pakker" | 1211 | msgstr "Valider synopsis og beskrivelse for GNU-pakker" |
| 1152 | 1212 | ||
| 1153 | #: guix/scripts/lint.scm:423 | 1213 | #: guix/scripts/lint.scm:484 |
| 1154 | msgid "Identify inputs that should be native inputs" | 1214 | msgid "Identify inputs that should be native inputs" |
| 1155 | msgstr "Identificer inddata som skal være standarddata" | 1215 | msgstr "Identificer inddata som skal være standarddata" |
| 1156 | 1216 | ||
| 1157 | #: guix/scripts/lint.scm:427 | 1217 | #: guix/scripts/lint.scm:488 |
| 1158 | msgid "Validate file names of patches" | 1218 | msgid "Validate file names and availability of patches" |
| 1159 | msgstr "Valider filnavne for rettelser" | 1219 | msgstr "Valider filnavne og tilgængelighed for rettelser" |
| 1160 | 1220 | ||
| 1161 | #: guix/scripts/lint.scm:431 | 1221 | #: guix/scripts/lint.scm:492 |
| 1162 | msgid "Validate home-page URLs" | 1222 | msgid "Validate home-page URLs" |
| 1163 | msgstr "Valider hjemmesiders adresser" | 1223 | msgstr "Valider hjemmesiders adresser" |
| 1164 | 1224 | ||
| 1165 | #: guix/scripts/lint.scm:435 | 1225 | #: guix/scripts/lint.scm:496 |
| 1166 | msgid "Validate source URLs" | 1226 | msgid "Validate source URLs" |
| 1167 | msgstr "Valider kildeadresser" | 1227 | msgstr "Valider kildeadresser" |
| 1168 | 1228 | ||
| 1169 | #: guix/scripts/lint.scm:439 | 1229 | #: guix/scripts/lint.scm:500 |
| 1230 | msgid "Report failure to compile a package to a derivation" | ||
| 1231 | msgstr "Rapporter mislykket kompilering af en pakke til en afledning" | ||
| 1232 | |||
| 1233 | #: guix/scripts/lint.scm:504 | ||
| 1170 | msgid "Validate package synopses" | 1234 | msgid "Validate package synopses" |
| 1171 | msgstr "Valider pakkesynopser" | 1235 | msgstr "Valider pakkesynopser" |
| 1172 | 1236 | ||
| 1173 | #: guix/scripts/lint.scm:464 | 1237 | #: guix/scripts/lint.scm:529 |
| 1174 | msgid "" | 1238 | msgid "" |
| 1175 | "Usage: guix lint [OPTION]... [PACKAGE]...\n" | 1239 | "Usage: guix lint [OPTION]... [PACKAGE]...\n" |
| 1176 | "Run a set of checkers on the specified package; if none is specified, run the checkers on all packages.\n" | 1240 | "Run a set of checkers on the specified package; if none is specified, run the checkers on all packages.\n" |
| @@ -1178,7 +1242,7 @@ msgstr "" | |||
| 1178 | "Brug: guix lint [TILVALG]... [PAKKE]...\n" | 1242 | "Brug: guix lint [TILVALG]... [PAKKE]...\n" |
| 1179 | "Kør et sæt af kontroller på den specificerede pakke; hvis ingen er specificeret, så kør kontrollerne på alle pakker.\n" | 1243 | "Kør et sæt af kontroller på den specificerede pakke; hvis ingen er specificeret, så kør kontrollerne på alle pakker.\n" |
| 1180 | 1244 | ||
| 1181 | #: guix/scripts/lint.scm:466 | 1245 | #: guix/scripts/lint.scm:531 |
| 1182 | msgid "" | 1246 | msgid "" |
| 1183 | "\n" | 1247 | "\n" |
| 1184 | " -c, --checkers=CHECKER1,CHECKER2...\n" | 1248 | " -c, --checkers=CHECKER1,CHECKER2...\n" |
| @@ -1188,7 +1252,7 @@ msgstr "" | |||
| 1188 | " -c, --checkers=KONTROL1,KONTROL2...\n" | 1252 | " -c, --checkers=KONTROL1,KONTROL2...\n" |
| 1189 | " kør kun de specificerede kontroller" | 1253 | " kør kun de specificerede kontroller" |
| 1190 | 1254 | ||
| 1191 | #: guix/scripts/lint.scm:471 | 1255 | #: guix/scripts/lint.scm:536 |
| 1192 | msgid "" | 1256 | msgid "" |
| 1193 | "\n" | 1257 | "\n" |
| 1194 | " -l, --list-checkers display the list of available lint checkers" | 1258 | " -l, --list-checkers display the list of available lint checkers" |
| @@ -1196,49 +1260,104 @@ msgstr "" | |||
| 1196 | "\n" | 1260 | "\n" |
| 1197 | " -l, --list-checkers vis listen med tilgængelige lint-kontroller" | 1261 | " -l, --list-checkers vis listen med tilgængelige lint-kontroller" |
| 1198 | 1262 | ||
| 1199 | #: guix/scripts/lint.scm:491 | 1263 | #: guix/scripts/lint.scm:556 |
| 1200 | #, scheme-format | 1264 | #, scheme-format |
| 1201 | msgid "~a: invalid checker~%" | 1265 | msgid "~a: invalid checker~%" |
| 1202 | msgstr "~a: ugyldig kontrol~%" | 1266 | msgstr "~a: ugyldig kontrol~%" |
| 1203 | 1267 | ||
| 1204 | #: guix/gnu-maintenance.scm:438 | 1268 | #: guix/scripts/publish.scm:49 |
| 1269 | #, scheme-format | ||
| 1270 | msgid "" | ||
| 1271 | "Usage: guix publish [OPTION]...\n" | ||
| 1272 | "Publish ~a over HTTP.\n" | ||
| 1273 | msgstr "" | ||
| 1274 | "Brug: guix publish [TILVALG] ...\n" | ||
| 1275 | "Udgiv ~a over HTTP.\n" | ||
| 1276 | |||
| 1277 | #: guix/scripts/publish.scm:51 | ||
| 1278 | msgid "" | ||
| 1279 | "\n" | ||
| 1280 | " -p, --port=PORT listen on PORT" | ||
| 1281 | msgstr "" | ||
| 1282 | "\n" | ||
| 1283 | " -p, --port=PORT lyt på PORT" | ||
| 1284 | |||
| 1285 | #: guix/scripts/publish.scm:53 | ||
| 1286 | msgid "" | ||
| 1287 | "\n" | ||
| 1288 | " -r, --repl[=PORT] spawn REPL server on PORT" | ||
| 1289 | msgstr "" | ||
| 1290 | "\n" | ||
| 1291 | " -r, --repl[=PORT] udsend REPL-server on PORT" | ||
| 1292 | |||
| 1293 | #: guix/scripts/publish.scm:235 | ||
| 1294 | #, scheme-format | ||
| 1295 | msgid "~A: extraneuous argument~%" | ||
| 1296 | msgstr "~A: uvedkommende argument~%" | ||
| 1297 | |||
| 1298 | #: guix/scripts/publish.scm:239 | ||
| 1299 | #, scheme-format | ||
| 1300 | msgid "publishing ~a on port ~d~%" | ||
| 1301 | msgstr "udgiver ~a på port ~d~%" | ||
| 1302 | |||
| 1303 | #: guix/gnu-maintenance.scm:447 | ||
| 1205 | #, scheme-format | 1304 | #, scheme-format |
| 1206 | msgid "signature verification failed for `~a'~%" | 1305 | msgid "signature verification failed for `~a'~%" |
| 1207 | msgstr "signaturverifikation mislykkedes for »~a«~%" | 1306 | msgstr "signaturverifikation mislykkedes for »~a«~%" |
| 1208 | 1307 | ||
| 1209 | #: guix/gnu-maintenance.scm:440 | 1308 | #: guix/gnu-maintenance.scm:449 |
| 1210 | #, scheme-format | 1309 | #, scheme-format |
| 1211 | msgid "(could be because the public key is not in your keyring)~%" | 1310 | msgid "(could be because the public key is not in your keyring)~%" |
| 1212 | msgstr "(kunne være fordi den offentlige nøgle ikke er i din nøglering)~%" | 1311 | msgstr "(kunne være fordi den offentlige nøgle ikke er i din nøglering)~%" |
| 1213 | 1312 | ||
| 1214 | #: guix/gnu-maintenance.scm:515 | 1313 | #: guix/gnu-maintenance.scm:524 |
| 1215 | #, scheme-format | 1314 | #, scheme-format |
| 1216 | msgid "~a: could not locate source file" | 1315 | msgid "~a: could not locate source file" |
| 1217 | msgstr "~a: kunne ikke lokalisere kildefil" | 1316 | msgstr "~a: kunne ikke lokalisere kildefil" |
| 1218 | 1317 | ||
| 1219 | #: guix/gnu-maintenance.scm:520 | 1318 | #: guix/gnu-maintenance.scm:529 |
| 1220 | #, scheme-format | 1319 | #, scheme-format |
| 1221 | msgid "~a: ~a: no `version' field in source; skipping~%" | 1320 | msgid "~a: ~a: no `version' field in source; skipping~%" |
| 1222 | msgstr "~a: ~a: intet »versionsfelt« i kilde; udelader~%" | 1321 | msgstr "~a: ~a: intet »versionsfelt« i kilde; udelader~%" |
| 1223 | 1322 | ||
| 1224 | #: guix/ui.scm:137 | 1323 | #: guix/ui.scm:142 guix/ui.scm:159 |
| 1324 | #, scheme-format | ||
| 1325 | msgid "failed to load '~a': ~a~%" | ||
| 1326 | msgstr "kunne ikke indlæse »~a«: ~a~%" | ||
| 1327 | |||
| 1328 | #: guix/ui.scm:145 | ||
| 1329 | #, scheme-format | ||
| 1330 | msgid "~a: error: ~a~%" | ||
| 1331 | msgstr "~a: fejl: ~a~%" | ||
| 1332 | |||
| 1333 | #: guix/ui.scm:149 guix/ui.scm:165 | ||
| 1334 | #, scheme-format | ||
| 1335 | msgid "failed to load '~a':~%" | ||
| 1336 | msgstr "kunne ikke indlæse »~a«:~%" | ||
| 1337 | |||
| 1338 | #: guix/ui.scm:162 | ||
| 1339 | #, scheme-format | ||
| 1340 | msgid "~a: warning: ~a~%" | ||
| 1341 | msgstr "~a: advarsel: ~a~%" | ||
| 1342 | |||
| 1343 | #: guix/ui.scm:174 | ||
| 1225 | #, scheme-format | 1344 | #, scheme-format |
| 1226 | msgid "failed to install locale: ~a~%" | 1345 | msgid "failed to install locale: ~a~%" |
| 1227 | msgstr "kunne ikke installere sprog: ~a~%" | 1346 | msgstr "kunne ikke installere sprog: ~a~%" |
| 1228 | 1347 | ||
| 1229 | #: guix/ui.scm:156 | 1348 | #: guix/ui.scm:193 |
| 1230 | msgid "" | 1349 | msgid "" |
| 1231 | "Copyright (C) 2014 the Guix authors\n" | 1350 | "Copyright (C) 2015 the Guix authors\n" |
| 1232 | "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n" | 1351 | "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n" |
| 1233 | "This is free software: you are free to change and redistribute it.\n" | 1352 | "This is free software: you are free to change and redistribute it.\n" |
| 1234 | "There is NO WARRANTY, to the extent permitted by law.\n" | 1353 | "There is NO WARRANTY, to the extent permitted by law.\n" |
| 1235 | msgstr "" | 1354 | msgstr "" |
| 1236 | "Ophavsret 2014 Guix-forfatterne\n" | 1355 | "Ophavsret 2015 Guix-forfatterne\n" |
| 1237 | "Licens GPLv3+: GNU GPL version 3 eller senere <http://gnu.org/licenses/gpl.html>\n" | 1356 | "Licens GPLv3+: GNU GPL version 3 eller senere <http://gnu.org/licenses/gpl.html>\n" |
| 1238 | "Dette er et frit program; du kan frit ændre og videredistribuere programmet.\n" | 1357 | "Dette er et frit program; du kan frit ændre og videredistribuere programmet.\n" |
| 1239 | "Der er INGEN GARANTI, inden for lovens rammer.\n" | 1358 | "Der er INGEN GARANTI, inden for lovens rammer.\n" |
| 1240 | 1359 | ||
| 1241 | #: guix/ui.scm:164 | 1360 | #: guix/ui.scm:201 |
| 1242 | #, scheme-format | 1361 | #, scheme-format |
| 1243 | msgid "" | 1362 | msgid "" |
| 1244 | "\n" | 1363 | "\n" |
| @@ -1247,7 +1366,7 @@ msgstr "" | |||
| 1247 | "\n" | 1366 | "\n" |
| 1248 | "Rapporter fejl til: ~a." | 1367 | "Rapporter fejl til: ~a." |
| 1249 | 1368 | ||
| 1250 | #: guix/ui.scm:166 | 1369 | #: guix/ui.scm:203 |
| 1251 | #, scheme-format | 1370 | #, scheme-format |
| 1252 | msgid "" | 1371 | msgid "" |
| 1253 | "\n" | 1372 | "\n" |
| @@ -1256,7 +1375,7 @@ msgstr "" | |||
| 1256 | "\n" | 1375 | "\n" |
| 1257 | "~a hjemmeside: <~a>" | 1376 | "~a hjemmeside: <~a>" |
| 1258 | 1377 | ||
| 1259 | #: guix/ui.scm:168 | 1378 | #: guix/ui.scm:205 |
| 1260 | msgid "" | 1379 | msgid "" |
| 1261 | "\n" | 1380 | "\n" |
| 1262 | "General help using GNU software: <http://www.gnu.org/gethelp/>" | 1381 | "General help using GNU software: <http://www.gnu.org/gethelp/>" |
| @@ -1264,170 +1383,194 @@ msgstr "" | |||
| 1264 | "\n" | 1383 | "\n" |
| 1265 | "Generel hjælp til brugen af GNU-programmer: <http://www.gnu.org/gethelp/>" | 1384 | "Generel hjælp til brugen af GNU-programmer: <http://www.gnu.org/gethelp/>" |
| 1266 | 1385 | ||
| 1267 | #: guix/ui.scm:175 | 1386 | #: guix/ui.scm:227 |
| 1268 | #, scheme-format | 1387 | #, scheme-format |
| 1269 | msgid "~a: invalid number~%" | 1388 | msgid "~a: invalid number~%" |
| 1270 | msgstr "~a: ugyldigt nummer~%" | 1389 | msgstr "~a: ugyldigt nummer~%" |
| 1271 | 1390 | ||
| 1272 | #: guix/ui.scm:192 | 1391 | #: guix/ui.scm:244 |
| 1273 | #, scheme-format | 1392 | #, scheme-format |
| 1274 | msgid "invalid number: ~a~%" | 1393 | msgid "invalid number: ~a~%" |
| 1275 | msgstr "ugyldigt nummer: ~a~%" | 1394 | msgstr "ugyldigt nummer: ~a~%" |
| 1276 | 1395 | ||
| 1277 | #: guix/ui.scm:215 | 1396 | #: guix/ui.scm:267 |
| 1278 | #, scheme-format | 1397 | #, scheme-format |
| 1279 | msgid "unknown unit: ~a~%" | 1398 | msgid "unknown unit: ~a~%" |
| 1280 | msgstr "ukendt enhed: ~a~%" | 1399 | msgstr "ukendt enhed: ~a~%" |
| 1281 | 1400 | ||
| 1282 | #: guix/ui.scm:226 | 1401 | #: guix/ui.scm:278 |
| 1283 | #, scheme-format | 1402 | #, scheme-format |
| 1284 | msgid "~a:~a:~a: package `~a' has an invalid input: ~s~%" | 1403 | msgid "~a:~a:~a: package `~a' has an invalid input: ~s~%" |
| 1285 | msgstr "~a:~a:~a: pakken »~a« har ugyldige inddata: ~s~%" | 1404 | msgstr "~a:~a:~a: pakken »~a« har ugyldige inddata: ~s~%" |
| 1286 | 1405 | ||
| 1287 | #: guix/ui.scm:233 | 1406 | #: guix/ui.scm:285 |
| 1288 | #, scheme-format | 1407 | #, scheme-format |
| 1289 | msgid "~a: ~a: build system `~a' does not support cross builds~%" | 1408 | msgid "~a: ~a: build system `~a' does not support cross builds~%" |
| 1290 | msgstr "~a: ~a: byggesystem »~a« understøtter ikke krydsbygninger~%" | 1409 | msgstr "~a: ~a: byggesystem »~a« understøtter ikke krydsbygninger~%" |
| 1291 | 1410 | ||
| 1292 | #: guix/ui.scm:238 | 1411 | #: guix/ui.scm:290 |
| 1293 | #, scheme-format | 1412 | #, scheme-format |
| 1294 | msgid "profile '~a' does not exist~%" | 1413 | msgid "profile '~a' does not exist~%" |
| 1295 | msgstr "profilen »~a« findes ikke~%" | 1414 | msgstr "profilen »~a« findes ikke~%" |
| 1296 | 1415 | ||
| 1297 | #: guix/ui.scm:241 | 1416 | #: guix/ui.scm:293 |
| 1298 | #, scheme-format | 1417 | #, scheme-format |
| 1299 | msgid "generation ~a of profile '~a' does not exist~%" | 1418 | msgid "generation ~a of profile '~a' does not exist~%" |
| 1300 | msgstr "oprettelse ~a af profilen »~a« findes ikke~%" | 1419 | msgstr "oprettelse ~a af profilen »~a« findes ikke~%" |
| 1301 | 1420 | ||
| 1302 | #: guix/ui.scm:245 | 1421 | #: guix/ui.scm:300 |
| 1422 | #, scheme-format | ||
| 1423 | msgid "corrupt input while restoring '~a' from ~s~%" | ||
| 1424 | msgstr "ødelagte inddata under gendannelse af »~a« fra ~s~%" | ||
| 1425 | |||
| 1426 | #: guix/ui.scm:302 | ||
| 1427 | #, scheme-format | ||
| 1428 | msgid "corrupt input while restoring archive from ~s~%" | ||
| 1429 | msgstr "ødelagte inddata under gendannelse af arkiv fra ~s~%" | ||
| 1430 | |||
| 1431 | #: guix/ui.scm:305 | ||
| 1303 | #, scheme-format | 1432 | #, scheme-format |
| 1304 | msgid "failed to connect to `~a': ~a~%" | 1433 | msgid "failed to connect to `~a': ~a~%" |
| 1305 | msgstr "kunne ikke forbinde til »~a«: ~a~%" | 1434 | msgstr "kunne ikke forbinde til »~a«: ~a~%" |
| 1306 | 1435 | ||
| 1307 | #: guix/ui.scm:250 | 1436 | #: guix/ui.scm:310 |
| 1308 | #, scheme-format | 1437 | #, scheme-format |
| 1309 | msgid "build failed: ~a~%" | 1438 | msgid "build failed: ~a~%" |
| 1310 | msgstr "bygning mislykkedes: ~a~%" | 1439 | msgstr "bygning mislykkedes: ~a~%" |
| 1311 | 1440 | ||
| 1312 | #: guix/ui.scm:253 | 1441 | #: guix/ui.scm:313 |
| 1313 | #, scheme-format | 1442 | #, scheme-format |
| 1314 | msgid "reference to invalid output '~a' of derivation '~a'~%" | 1443 | msgid "reference to invalid output '~a' of derivation '~a'~%" |
| 1315 | msgstr "reference til ugyldige uddata »~a« for afledning »~a«~%" | 1444 | msgstr "reference til ugyldige uddata »~a« for afledning »~a«~%" |
| 1316 | 1445 | ||
| 1317 | #: guix/ui.scm:264 | 1446 | #: guix/ui.scm:324 |
| 1318 | #, scheme-format | 1447 | #, scheme-format |
| 1319 | msgid "~a: ~a~%" | 1448 | msgid "~a: ~a~%" |
| 1320 | msgstr "~a: ~a~%" | 1449 | msgstr "~a: ~a~%" |
| 1321 | 1450 | ||
| 1322 | #: guix/ui.scm:283 | 1451 | #: guix/ui.scm:343 |
| 1323 | #, scheme-format | 1452 | #, scheme-format |
| 1324 | msgid "failed to read expression ~s: ~s~%" | 1453 | msgid "failed to read expression ~s: ~s~%" |
| 1325 | msgstr "kunne ikke læse udtryk ~s: ~s~%" | 1454 | msgstr "kunne ikke læse udtryk ~s: ~s~%" |
| 1326 | 1455 | ||
| 1327 | #: guix/ui.scm:289 | 1456 | #: guix/ui.scm:349 |
| 1328 | #, scheme-format | 1457 | #, scheme-format |
| 1329 | msgid "failed to evaluate expression `~a': ~s~%" | 1458 | msgid "failed to evaluate expression `~a': ~s~%" |
| 1330 | msgstr "kunne ikke evaluere udtryk »~a«: ~s~%" | 1459 | msgstr "kunne ikke evaluere udtryk »~a«: ~s~%" |
| 1331 | 1460 | ||
| 1332 | #: guix/ui.scm:298 | 1461 | #: guix/ui.scm:358 |
| 1333 | #, scheme-format | 1462 | #, scheme-format |
| 1334 | msgid "expression ~s does not evaluate to a package~%" | 1463 | msgid "expression ~s does not evaluate to a package~%" |
| 1335 | msgstr "udtryk ~s evaluerer ikke til en pakke~%" | 1464 | msgstr "udtryk ~s evaluerer ikke til en pakke~%" |
| 1336 | 1465 | ||
| 1337 | #: guix/ui.scm:350 | 1466 | #: guix/ui.scm:410 |
| 1338 | #, scheme-format | 1467 | #, scheme-format |
| 1339 | msgid "~:[The following derivation would be built:~%~{ ~a~%~}~;~]" | 1468 | msgid "~:[The following derivation would be built:~%~{ ~a~%~}~;~]" |
| 1340 | msgid_plural "~:[The following derivations would be built:~%~{ ~a~%~}~;~]" | 1469 | msgid_plural "~:[The following derivations would be built:~%~{ ~a~%~}~;~]" |
| 1341 | msgstr[0] "~:[Den følgende afledning ville blive bygget:~%~{ ~a~%~}~;~]" | 1470 | msgstr[0] "~:[Den følgende afledning ville blive bygget:~%~{ ~a~%~}~;~]" |
| 1342 | msgstr[1] "~:[De følgende afledninger ville blive bygget:~%~{ ~a~%~}~;~]" | 1471 | msgstr[1] "~:[De følgende afledninger ville blive bygget:~%~{ ~a~%~}~;~]" |
| 1343 | 1472 | ||
| 1344 | #: guix/ui.scm:355 | 1473 | #: guix/ui.scm:415 |
| 1345 | #, scheme-format | 1474 | #, scheme-format |
| 1346 | msgid "~:[The following file would be downloaded:~%~{ ~a~%~}~;~]" | 1475 | msgid "~:[The following file would be downloaded:~%~{ ~a~%~}~;~]" |
| 1347 | msgid_plural "~:[The following files would be downloaded:~%~{ ~a~%~}~;~]" | 1476 | msgid_plural "~:[The following files would be downloaded:~%~{ ~a~%~}~;~]" |
| 1348 | msgstr[0] "~:[Den følgende fil ville blive hentet:~%~{ ~a~%~}~;~]" | 1477 | msgstr[0] "~:[Den følgende fil ville blive hentet:~%~{ ~a~%~}~;~]" |
| 1349 | msgstr[1] "~:[De følgende filer ville blive hentet:~%~{ ~a~%~}~;~]" | 1478 | msgstr[1] "~:[De følgende filer ville blive hentet:~%~{ ~a~%~}~;~]" |
| 1350 | 1479 | ||
| 1351 | #: guix/ui.scm:361 | 1480 | #: guix/ui.scm:421 |
| 1352 | #, scheme-format | 1481 | #, scheme-format |
| 1353 | msgid "~:[The following derivation will be built:~%~{ ~a~%~}~;~]" | 1482 | msgid "~:[The following derivation will be built:~%~{ ~a~%~}~;~]" |
| 1354 | msgid_plural "~:[The following derivations will be built:~%~{ ~a~%~}~;~]" | 1483 | msgid_plural "~:[The following derivations will be built:~%~{ ~a~%~}~;~]" |
| 1355 | msgstr[0] "~:[Den følgende afledning vil blive bygget:~%~{ ~a~%~}~;~]" | 1484 | msgstr[0] "~:[Den følgende afledning vil blive bygget:~%~{ ~a~%~}~;~]" |
| 1356 | msgstr[1] "~:[De følgende afledninger vil blive bygget:~%~{ ~a~%~}~;~]" | 1485 | msgstr[1] "~:[De følgende afledninger vil blive bygget:~%~{ ~a~%~}~;~]" |
| 1357 | 1486 | ||
| 1358 | #: guix/ui.scm:366 | 1487 | #: guix/ui.scm:426 |
| 1359 | #, scheme-format | 1488 | #, scheme-format |
| 1360 | msgid "~:[The following file will be downloaded:~%~{ ~a~%~}~;~]" | 1489 | msgid "~:[The following file will be downloaded:~%~{ ~a~%~}~;~]" |
| 1361 | msgid_plural "~:[The following files will be downloaded:~%~{ ~a~%~}~;~]" | 1490 | msgid_plural "~:[The following files will be downloaded:~%~{ ~a~%~}~;~]" |
| 1362 | msgstr[0] "~:[Den følgende fil vil blive hentet:~%~{ ~a~%~}~;~]" | 1491 | msgstr[0] "~:[Den følgende fil vil blive hentet:~%~{ ~a~%~}~;~]" |
| 1363 | msgstr[1] "~:[De følgende filer vil blive hentet:~%~{ ~a~%~}~;~]" | 1492 | msgstr[1] "~:[De følgende filer vil blive hentet:~%~{ ~a~%~}~;~]" |
| 1364 | 1493 | ||
| 1365 | #: guix/ui.scm:418 | 1494 | #: guix/ui.scm:478 |
| 1366 | #, scheme-format | 1495 | #, scheme-format |
| 1367 | msgid "The following package would be removed:~%~{~a~%~}~%" | 1496 | msgid "The following package would be removed:~%~{~a~%~}~%" |
| 1368 | msgid_plural "The following packages would be removed:~%~{~a~%~}~%" | 1497 | msgid_plural "The following packages would be removed:~%~{~a~%~}~%" |
| 1369 | msgstr[0] "Den følgende pakke ville blive fjernet:~%~{~a~%~}~%" | 1498 | msgstr[0] "Den følgende pakke ville blive fjernet:~%~{~a~%~}~%" |
| 1370 | msgstr[1] "De følgende pakker ville blive fjernet:~%~{~a~%~}~%" | 1499 | msgstr[1] "De følgende pakker ville blive fjernet:~%~{~a~%~}~%" |
| 1371 | 1500 | ||
| 1372 | #: guix/ui.scm:423 | 1501 | #: guix/ui.scm:483 |
| 1373 | #, scheme-format | 1502 | #, scheme-format |
| 1374 | msgid "The following package will be removed:~%~{~a~%~}~%" | 1503 | msgid "The following package will be removed:~%~{~a~%~}~%" |
| 1375 | msgid_plural "The following packages will be removed:~%~{~a~%~}~%" | 1504 | msgid_plural "The following packages will be removed:~%~{~a~%~}~%" |
| 1376 | msgstr[0] "Den følgende pakke vil blive fjernet:~%~{~a~%~}~%" | 1505 | msgstr[0] "Den følgende pakke vil blive fjernet:~%~{~a~%~}~%" |
| 1377 | msgstr[1] "De følgende pakker vil blive fjernet:~%~{~a~%~}~%" | 1506 | msgstr[1] "De følgende pakker vil blive fjernet:~%~{~a~%~}~%" |
| 1378 | 1507 | ||
| 1379 | #: guix/ui.scm:436 | 1508 | #: guix/ui.scm:496 |
| 1509 | #, scheme-format | ||
| 1510 | msgid "The following package would be downgraded:~%~{~a~%~}~%" | ||
| 1511 | msgid_plural "The following packages would be downgraded:~%~{~a~%~}~%" | ||
| 1512 | msgstr[0] "Den følgende pakke ville blive nedgraderet:~%~{~a~%~}~%" | ||
| 1513 | msgstr[1] "De følgende pakker ville blive nedgraderet:~%~{~a~%~}~%" | ||
| 1514 | |||
| 1515 | #: guix/ui.scm:501 | ||
| 1516 | #, scheme-format | ||
| 1517 | msgid "The following package will be downgraded:~%~{~a~%~}~%" | ||
| 1518 | msgid_plural "The following packages will be downgraded:~%~{~a~%~}~%" | ||
| 1519 | msgstr[0] "Den følgende pakke vil blive nedgraderet:~%~{~a~%~}~%" | ||
| 1520 | msgstr[1] "De følgende pakker vil blive nedgraderet:~%~{~a~%~}~%" | ||
| 1521 | |||
| 1522 | #: guix/ui.scm:514 | ||
| 1380 | #, scheme-format | 1523 | #, scheme-format |
| 1381 | msgid "The following package would be upgraded:~%~{~a~%~}~%" | 1524 | msgid "The following package would be upgraded:~%~{~a~%~}~%" |
| 1382 | msgid_plural "The following packages would be upgraded:~%~{~a~%~}~%" | 1525 | msgid_plural "The following packages would be upgraded:~%~{~a~%~}~%" |
| 1383 | msgstr[0] "Den følgende pakke ville blive opgraderet:~%~{~a~%~}~%" | 1526 | msgstr[0] "Den følgende pakke ville blive opgraderet:~%~{~a~%~}~%" |
| 1384 | msgstr[1] "De følgende pakker ville blive opgraderet:~%~{~a~%~}~%" | 1527 | msgstr[1] "De følgende pakker ville blive opgraderet:~%~{~a~%~}~%" |
| 1385 | 1528 | ||
| 1386 | #: guix/ui.scm:441 | 1529 | #: guix/ui.scm:519 |
| 1387 | #, scheme-format | 1530 | #, scheme-format |
| 1388 | msgid "The following package will be upgraded:~%~{~a~%~}~%" | 1531 | msgid "The following package will be upgraded:~%~{~a~%~}~%" |
| 1389 | msgid_plural "The following packages will be upgraded:~%~{~a~%~}~%" | 1532 | msgid_plural "The following packages will be upgraded:~%~{~a~%~}~%" |
| 1390 | msgstr[0] "Den følgende pakke vil blive opgraderet:~%~{~a~%~}~%" | 1533 | msgstr[0] "Den følgende pakke vil blive opgraderet:~%~{~a~%~}~%" |
| 1391 | msgstr[1] "De følgende pakker vil blive opgraderet:~%~{~a~%~}~%" | 1534 | msgstr[1] "De følgende pakker vil blive opgraderet:~%~{~a~%~}~%" |
| 1392 | 1535 | ||
| 1393 | #: guix/ui.scm:452 | 1536 | #: guix/ui.scm:530 |
| 1394 | #, scheme-format | 1537 | #, scheme-format |
| 1395 | msgid "The following package would be installed:~%~{~a~%~}~%" | 1538 | msgid "The following package would be installed:~%~{~a~%~}~%" |
| 1396 | msgid_plural "The following packages would be installed:~%~{~a~%~}~%" | 1539 | msgid_plural "The following packages would be installed:~%~{~a~%~}~%" |
| 1397 | msgstr[0] "Den følgende pakke ville blive installeret:~%~{~a~%~}~%" | 1540 | msgstr[0] "Den følgende pakke ville blive installeret:~%~{~a~%~}~%" |
| 1398 | msgstr[1] "De følgende pakker ville blive installeret:~%~{~a~%~}~%" | 1541 | msgstr[1] "De følgende pakker ville blive installeret:~%~{~a~%~}~%" |
| 1399 | 1542 | ||
| 1400 | #: guix/ui.scm:457 | 1543 | #: guix/ui.scm:535 |
| 1401 | #, scheme-format | 1544 | #, scheme-format |
| 1402 | msgid "The following package will be installed:~%~{~a~%~}~%" | 1545 | msgid "The following package will be installed:~%~{~a~%~}~%" |
| 1403 | msgid_plural "The following packages will be installed:~%~{~a~%~}~%" | 1546 | msgid_plural "The following packages will be installed:~%~{~a~%~}~%" |
| 1404 | msgstr[0] "Den følgende pakke vil blive installeret:~%~{~a~%~}~%" | 1547 | msgstr[0] "Den følgende pakke vil blive installeret:~%~{~a~%~}~%" |
| 1405 | msgstr[1] "De følgende pakker vil blive installeret:~%~{~a~%~}~%" | 1548 | msgstr[1] "De følgende pakker vil blive installeret:~%~{~a~%~}~%" |
| 1406 | 1549 | ||
| 1407 | #: guix/ui.scm:474 | 1550 | #: guix/ui.scm:552 |
| 1408 | msgid "<unknown location>" | 1551 | msgid "<unknown location>" |
| 1409 | msgstr "<ukendt sted>" | 1552 | msgstr "<ukendt sted>" |
| 1410 | 1553 | ||
| 1411 | #: guix/ui.scm:500 | 1554 | #: guix/ui.scm:578 |
| 1412 | #, scheme-format | 1555 | #, scheme-format |
| 1413 | msgid "failed to create configuration directory `~a': ~a~%" | 1556 | msgid "failed to create configuration directory `~a': ~a~%" |
| 1414 | msgstr "kunne ikke oprette konfiguratinsmappe »~a«: ~a~%" | 1557 | msgstr "kunne ikke oprette konfiguratinsmappe »~a«: ~a~%" |
| 1415 | 1558 | ||
| 1416 | #: guix/ui.scm:600 guix/ui.scm:614 | 1559 | #: guix/ui.scm:680 guix/ui.scm:694 |
| 1417 | msgid "unknown" | 1560 | msgid "unknown" |
| 1418 | msgstr "ukendt" | 1561 | msgstr "ukendt" |
| 1419 | 1562 | ||
| 1420 | #: guix/ui.scm:723 | 1563 | #: guix/ui.scm:803 |
| 1421 | #, scheme-format | 1564 | #, scheme-format |
| 1422 | msgid "invalid argument: ~a~%" | 1565 | msgid "invalid argument: ~a~%" |
| 1423 | msgstr "ugyldigt argument: ~a~%" | 1566 | msgstr "ugyldigt argument: ~a~%" |
| 1424 | 1567 | ||
| 1425 | #: guix/ui.scm:732 | 1568 | #: guix/ui.scm:842 |
| 1426 | #, scheme-format | 1569 | #, scheme-format |
| 1427 | msgid "Try `guix --help' for more information.~%" | 1570 | msgid "Try `guix --help' for more information.~%" |
| 1428 | msgstr "Prøv »guix --help« for yderligere information.~%" | 1571 | msgstr "Prøv »guix --help« for yderligere information.~%" |
| 1429 | 1572 | ||
| 1430 | #: guix/ui.scm:762 | 1573 | #: guix/ui.scm:869 |
| 1431 | msgid "" | 1574 | msgid "" |
| 1432 | "Usage: guix COMMAND ARGS...\n" | 1575 | "Usage: guix COMMAND ARGS...\n" |
| 1433 | "Run COMMAND with ARGS.\n" | 1576 | "Run COMMAND with ARGS.\n" |
| @@ -1435,41 +1578,31 @@ msgstr "" | |||
| 1435 | "Brug: guix KOMMANDO ARG...\n" | 1578 | "Brug: guix KOMMANDO ARG...\n" |
| 1436 | "Kør KOMMANDO med ARG.\n" | 1579 | "Kør KOMMANDO med ARG.\n" |
| 1437 | 1580 | ||
| 1438 | #: guix/ui.scm:765 | 1581 | #: guix/ui.scm:872 |
| 1439 | msgid "COMMAND must be one of the sub-commands listed below:\n" | 1582 | msgid "COMMAND must be one of the sub-commands listed below:\n" |
| 1440 | msgstr "KOMMANDO skal være en af underkommandoerne vist nedenfor:\n" | 1583 | msgstr "KOMMANDO skal være en af underkommandoerne vist nedenfor:\n" |
| 1441 | 1584 | ||
| 1442 | #: guix/ui.scm:785 | 1585 | #: guix/ui.scm:892 |
| 1443 | #, scheme-format | 1586 | #, scheme-format |
| 1444 | msgid "guix: ~a: command not found~%" | 1587 | msgid "guix: ~a: command not found~%" |
| 1445 | msgstr "guix: ~a: kommando blev ikke fundet~%" | 1588 | msgstr "guix: ~a: kommando blev ikke fundet~%" |
| 1446 | 1589 | ||
| 1447 | #: guix/ui.scm:803 | 1590 | #: guix/ui.scm:910 |
| 1448 | #, scheme-format | 1591 | #, scheme-format |
| 1449 | msgid "guix: missing command name~%" | 1592 | msgid "guix: missing command name~%" |
| 1450 | msgstr "guix: mangler kommandonavn~%" | 1593 | msgstr "guix: mangler kommandonavn~%" |
| 1451 | 1594 | ||
| 1452 | #: guix/ui.scm:811 | 1595 | #: guix/ui.scm:918 |
| 1453 | #, scheme-format | 1596 | #, scheme-format |
| 1454 | msgid "guix: unrecognized option '~a'~%" | 1597 | msgid "guix: unrecognized option '~a'~%" |
| 1455 | msgstr "guix: ikke genkendt tilvalg »~a«~%" | 1598 | msgstr "guix: ikke genkendt tilvalg »~a«~%" |
| 1456 | 1599 | ||
| 1457 | #: guix/http-client.scm:217 | 1600 | #: guix/http-client.scm:211 |
| 1458 | #, scheme-format | ||
| 1459 | msgid "using Guile ~a, which does not support ~s encoding~%" | ||
| 1460 | msgstr "bruger Guile ~a, som ikke understøtter ~s-kodning~%" | ||
| 1461 | |||
| 1462 | #: guix/http-client.scm:220 | ||
| 1463 | #, scheme-format | ||
| 1464 | msgid "download failed; use a newer Guile~%" | ||
| 1465 | msgstr "overførsel mislykkedes; brug en nyere Guile~%" | ||
| 1466 | |||
| 1467 | #: guix/http-client.scm:232 | ||
| 1468 | #, scheme-format | 1601 | #, scheme-format |
| 1469 | msgid "following redirection to `~a'...~%" | 1602 | msgid "following redirection to `~a'...~%" |
| 1470 | msgstr "følger omdirigering til »~a«...~%" | 1603 | msgstr "følger omdirigering til »~a«...~%" |
| 1471 | 1604 | ||
| 1472 | #: guix/http-client.scm:241 | 1605 | #: guix/http-client.scm:220 |
| 1473 | msgid "download failed" | 1606 | msgid "download failed" |
| 1474 | msgstr "overførsel mislykkedes" | 1607 | msgstr "overførsel mislykkedes" |
| 1475 | 1608 | ||
| @@ -1514,3 +1647,21 @@ msgstr "importeret fil mangler en signatur" | |||
| 1514 | #: guix/nar.scm:268 | 1647 | #: guix/nar.scm:268 |
| 1515 | msgid "invalid inter-file archive mark" | 1648 | msgid "invalid inter-file archive mark" |
| 1516 | msgstr "ugyldig arkivmærke for mellemfil" | 1649 | msgstr "ugyldig arkivmærke for mellemfil" |
| 1650 | |||
| 1651 | #~ msgid "Downloading, please wait...~%" | ||
| 1652 | #~ msgstr "Henter, vent venligst ...~%" | ||
| 1653 | |||
| 1654 | #~ msgid "(Please consider upgrading Guile to get proper progress report.)~%" | ||
| 1655 | #~ msgstr "(Overvej venligst at opgradere Guile for at få korrekt statusrapport.)~%" | ||
| 1656 | |||
| 1657 | #~ msgid "failed to open operating system file '~a': ~a~%" | ||
| 1658 | #~ msgstr "kunne ikke åbne operativsystemfil »~a«: ~a~%" | ||
| 1659 | |||
| 1660 | #~ msgid "failed to load operating system file '~a':~%" | ||
| 1661 | #~ msgstr "kunne ikke indlæse operativsystemfil »~a«:~%" | ||
| 1662 | |||
| 1663 | #~ msgid "using Guile ~a, which does not support ~s encoding~%" | ||
| 1664 | #~ msgstr "bruger Guile ~a, som ikke understøtter ~s-kodning~%" | ||
| 1665 | |||
| 1666 | #~ msgid "download failed; use a newer Guile~%" | ||
| 1667 | #~ msgstr "overførsel mislykkedes; brug en nyere Guile~%" | ||
diff --git a/po/packages/POTFILES.in b/po/packages/POTFILES.in index 0e7bc4c0d3f..b1da6d20237 100644 --- a/po/packages/POTFILES.in +++ b/po/packages/POTFILES.in | |||
| @@ -6,24 +6,52 @@ gnu/packages/aspell.scm | |||
| 6 | gnu/packages/backup.scm | 6 | gnu/packages/backup.scm |
| 7 | gnu/packages/base.scm | 7 | gnu/packages/base.scm |
| 8 | gnu/packages/bittorrent.scm | 8 | gnu/packages/bittorrent.scm |
| 9 | gnu/packages/certs.scm | ||
| 10 | gnu/packages/compression.scm | ||
| 9 | gnu/packages/databases.scm | 11 | gnu/packages/databases.scm |
| 12 | gnu/packages/debug.scm | ||
| 13 | gnu/packages/dejagnu.scm | ||
| 14 | gnu/packages/feh.scm | ||
| 10 | gnu/packages/games.scm | 15 | gnu/packages/games.scm |
| 11 | gnu/packages/gcc.scm | 16 | gnu/packages/gcc.scm |
| 17 | gnu/packages/geeqie.scm | ||
| 12 | gnu/packages/gettext.scm | 18 | gnu/packages/gettext.scm |
| 13 | gnu/packages/gnuzilla.scm | 19 | gnu/packages/gnuzilla.scm |
| 14 | gnu/packages/gtk.scm | 20 | gnu/packages/gtk.scm |
| 15 | gnu/packages/guile.scm | 21 | gnu/packages/guile.scm |
| 16 | gnu/packages/image.scm | ||
| 17 | gnu/packages/imagemagick.scm | 22 | gnu/packages/imagemagick.scm |
| 23 | gnu/packages/image.scm | ||
| 18 | gnu/packages/inkscape.scm | 24 | gnu/packages/inkscape.scm |
| 25 | gnu/packages/jemalloc.scm | ||
| 26 | gnu/packages/key-mon.scm | ||
| 27 | gnu/packages/less.scm | ||
| 28 | gnu/packages/lesstif.scm | ||
| 19 | gnu/packages/linux.scm | 29 | gnu/packages/linux.scm |
| 20 | gnu/packages/lout.scm | 30 | gnu/packages/lout.scm |
| 31 | gnu/packages/messaging.scm | ||
| 21 | gnu/packages/mpd.scm | 32 | gnu/packages/mpd.scm |
| 33 | gnu/packages/netpbm.scm | ||
| 34 | gnu/packages/nettle.scm | ||
| 35 | gnu/packages/networking.scm | ||
| 22 | gnu/packages/pdf.scm | 36 | gnu/packages/pdf.scm |
| 37 | gnu/packages/pem.scm | ||
| 38 | gnu/packages/perl.scm | ||
| 23 | gnu/packages/photo.scm | 39 | gnu/packages/photo.scm |
| 40 | gnu/packages/qemu.scm | ||
| 24 | gnu/packages/ratpoison.scm | 41 | gnu/packages/ratpoison.scm |
| 42 | gnu/packages/readline.scm | ||
| 25 | gnu/packages/scanner.scm | 43 | gnu/packages/scanner.scm |
| 26 | gnu/packages/scheme.scm | 44 | gnu/packages/scheme.scm |
| 45 | gnu/packages/search.scm | ||
| 46 | gnu/packages/serveez.scm | ||
| 47 | gnu/packages/telephony.scm | ||
| 48 | gnu/packages/texinfo.scm | ||
| 49 | gnu/packages/texlive.scm | ||
| 50 | gnu/packages/textutils.scm | ||
| 51 | gnu/packages/version-control.scm | ||
| 52 | gnu/packages/webkit.scm | ||
| 53 | gnu/packages/web.scm | ||
| 54 | gnu/packages/weechat.scm | ||
| 27 | gnu/packages/wordnet.scm | 55 | gnu/packages/wordnet.scm |
| 28 | gnu/packages/xiph.scm | 56 | gnu/packages/xiph.scm |
| 29 | gnu/packages/zip.scm | 57 | gnu/packages/zip.scm |
diff --git a/tests/base32.scm b/tests/base32.scm index 81d242355a2..dcd926f4b8b 100644 --- a/tests/base32.scm +++ b/tests/base32.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -21,6 +21,7 @@ | |||
| 21 | #:use-module (guix base32) | 21 | #:use-module (guix base32) |
| 22 | #:use-module (guix utils) | 22 | #:use-module (guix utils) |
| 23 | #:use-module (srfi srfi-1) | 23 | #:use-module (srfi srfi-1) |
| 24 | #:use-module (srfi srfi-34) | ||
| 24 | #:use-module (srfi srfi-64) | 25 | #:use-module (srfi srfi-64) |
| 25 | #:use-module (ice-9 rdelim) | 26 | #:use-module (ice-9 rdelim) |
| 26 | #:use-module (ice-9 popen) | 27 | #:use-module (ice-9 popen) |
| @@ -77,6 +78,13 @@ | |||
| 77 | ;; Examples from RFC 4648. | 78 | ;; Examples from RFC 4648. |
| 78 | (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar")))) | 79 | (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar")))) |
| 79 | 80 | ||
| 81 | (test-equal "&invalid-base32-character" | ||
| 82 | #\e | ||
| 83 | (guard (c ((invalid-base32-character? c) | ||
| 84 | (invalid-base32-character-value c))) | ||
| 85 | (nix-base32-string->bytevector | ||
| 86 | (string-append (make-string 51 #\a) "e")))) | ||
| 87 | |||
| 80 | ;; The following test requires `nix-hash' in $PATH. | 88 | ;; The following test requires `nix-hash' in $PATH. |
| 81 | (unless %have-nix-hash? | 89 | (unless %have-nix-hash? |
| 82 | (test-skip 1)) | 90 | (test-skip 1)) |
diff --git a/tests/derivations.scm b/tests/derivations.scm index a8cccac34a4..df5f07d1172 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm | |||
| @@ -499,12 +499,16 @@ | |||
| 499 | (string=? path (derivation-file-name (%guile-for-build))))) | 499 | (string=? path (derivation-file-name (%guile-for-build))))) |
| 500 | (derivation-prerequisites drv)))) | 500 | (derivation-prerequisites drv)))) |
| 501 | 501 | ||
| 502 | (test-assert "derivation-prerequisites and derivation-input-is-valid?" | 502 | (test-assert "derivation-prerequisites and valid-derivation-input?" |
| 503 | (let* ((a (build-expression->derivation %store "a" '(mkdir %output))) | 503 | (let* ((a (build-expression->derivation %store "a" '(mkdir %output))) |
| 504 | (b (build-expression->derivation %store "b" `(list ,(random-text)))) | 504 | (b (build-expression->derivation %store "b" `(list ,(random-text)))) |
| 505 | (c (build-expression->derivation %store "c" `(mkdir %output) | 505 | (c (build-expression->derivation %store "c" `(mkdir %output) |
| 506 | #:inputs `(("a" ,a) ("b" ,b))))) | 506 | #:inputs `(("a" ,a) ("b" ,b))))) |
| 507 | (build-derivations %store (list a)) | 507 | ;; Make sure both A and %BOOTSTRAP-GUILE are built (the latter could have |
| 508 | ;; be removed by tests/guix-gc.sh.) | ||
| 509 | (build-derivations %store | ||
| 510 | (list a (package-derivation %store %bootstrap-guile))) | ||
| 511 | |||
| 508 | (match (derivation-prerequisites c | 512 | (match (derivation-prerequisites c |
| 509 | (cut valid-derivation-input? %store | 513 | (cut valid-derivation-input? %store |
| 510 | <>)) | 514 | <>)) |
diff --git a/tests/gexp.scm b/tests/gexp.scm index f81ef39860a..7e14073fd4f 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm | |||
| @@ -109,6 +109,16 @@ | |||
| 109 | (eq? x local))) | 109 | (eq? x local))) |
| 110 | (equal? `(display ,intd) (gexp->sexp* exp))))) | 110 | (equal? `(display ,intd) (gexp->sexp* exp))))) |
| 111 | 111 | ||
| 112 | (test-assert "one plain file" | ||
| 113 | (let* ((file (plain-file "hi" "Hello, world!")) | ||
| 114 | (exp (gexp (display (ungexp file)))) | ||
| 115 | (expected (add-text-to-store %store "hi" "Hello, world!"))) | ||
| 116 | (and (gexp? exp) | ||
| 117 | (match (gexp-inputs exp) | ||
| 118 | (((x "out")) | ||
| 119 | (eq? x file))) | ||
| 120 | (equal? `(display ,expected) (gexp->sexp* exp))))) | ||
| 121 | |||
| 112 | (test-assert "same input twice" | 122 | (test-assert "same input twice" |
| 113 | (let ((exp (gexp (begin | 123 | (let ((exp (gexp (begin |
| 114 | (display (ungexp coreutils)) | 124 | (display (ungexp coreutils)) |
diff --git a/tests/guix-archive.sh b/tests/guix-archive.sh index d4259b86778..8eacf89338d 100644 --- a/tests/guix-archive.sh +++ b/tests/guix-archive.sh | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # GNU Guix --- Functional package management for GNU | 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | # Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | # | 3 | # |
| 4 | # This file is part of GNU Guix. | 4 | # This file is part of GNU Guix. |
| 5 | # | 5 | # |
| @@ -41,7 +41,6 @@ cmp "$archive" "$archive_alt" | |||
| 41 | 41 | ||
| 42 | # Check the exit value and stderr upon import. | 42 | # Check the exit value and stderr upon import. |
| 43 | guix archive --import < "$archive" | 43 | guix archive --import < "$archive" |
| 44 | guix archive --import < "$archive" 2>&1 | grep "import.*guile-bootstrap" | ||
| 45 | 44 | ||
| 46 | if guix archive something-that-does-not-exist | 45 | if guix archive something-that-does-not-exist |
| 47 | then false; else true; fi | 46 | then false; else true; fi |
diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 836c45e776c..a72ce0911de 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh | |||
| @@ -36,6 +36,88 @@ guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' | \ | |||
| 36 | guix build hello -d | \ | 36 | guix build hello -d | \ |
| 37 | grep -e '-hello-[0-9\.]\+\.drv$' | 37 | grep -e '-hello-[0-9\.]\+\.drv$' |
| 38 | 38 | ||
| 39 | # Check --sources option with its arguments | ||
| 40 | module_dir="t-guix-build-$$" | ||
| 41 | mkdir "$module_dir" | ||
| 42 | trap "rm -rf $module_dir" EXIT | ||
| 43 | |||
| 44 | cat > "$module_dir/foo.scm"<<EOF | ||
| 45 | (define-module (foo) | ||
| 46 | #:use-module (guix packages) | ||
| 47 | #:use-module (guix download) | ||
| 48 | #:use-module (guix build-system trivial)) | ||
| 49 | |||
| 50 | (define-public foo | ||
| 51 | (package | ||
| 52 | (name "foo") | ||
| 53 | (version "42") | ||
| 54 | (source (origin | ||
| 55 | (method url-fetch) | ||
| 56 | (uri "http://www.example.com/foo.tar.gz") | ||
| 57 | (sha256 | ||
| 58 | (base32 | ||
| 59 | "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")))) | ||
| 60 | (build-system trivial-build-system) | ||
| 61 | (inputs | ||
| 62 | (quasiquote (("bar" ,bar)))) | ||
| 63 | (home-page "www.example.com") | ||
| 64 | (synopsis "Dummy package") | ||
| 65 | (description "foo is a dummy package for testing.") | ||
| 66 | (license #f))) | ||
| 67 | |||
| 68 | (define-public bar | ||
| 69 | (package | ||
| 70 | (name "bar") | ||
| 71 | (version "9001") | ||
| 72 | (source (origin | ||
| 73 | (method url-fetch) | ||
| 74 | (uri "http://www.example.com/bar.tar.gz") | ||
| 75 | (sha256 | ||
| 76 | (base32 | ||
| 77 | "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy")))) | ||
| 78 | (build-system trivial-build-system) | ||
| 79 | (inputs | ||
| 80 | (quasiquote | ||
| 81 | (("data" ,(origin | ||
| 82 | (method url-fetch) | ||
| 83 | (uri "http://www.example.com/bar.dat") | ||
| 84 | (sha256 | ||
| 85 | (base32 | ||
| 86 | "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"))))))) | ||
| 87 | (home-page "www.example.com") | ||
| 88 | (synopsis "Dummy package") | ||
| 89 | (description "bar is a dummy package for testing.") | ||
| 90 | (license #f))) | ||
| 91 | EOF | ||
| 92 | |||
| 93 | GUIX_PACKAGE_PATH="$module_dir" | ||
| 94 | export GUIX_PACKAGE_PATH | ||
| 95 | |||
| 96 | # foo.tar.gz | ||
| 97 | guix build -d -S foo | ||
| 98 | guix build -d -S foo | grep -e 'foo\.tar\.gz' | ||
| 99 | |||
| 100 | guix build -d --sources=package foo | ||
| 101 | guix build -d --sources=package foo | grep -e 'foo\.tar\.gz' | ||
| 102 | |||
| 103 | # bar.tar.gz and bar.dat | ||
| 104 | guix build -d --sources bar | ||
| 105 | test `guix build -d --sources bar \ | ||
| 106 | | grep -e 'bar\.tar\.gz' -e 'bar\.dat' \ | ||
| 107 | | wc -l` -eq 2 | ||
| 108 | |||
| 109 | # bar.tar.gz and bar.dat | ||
| 110 | guix build -d --sources=all bar | ||
| 111 | test `guix build -d --sources bar \ | ||
| 112 | | grep -e 'bar\.tar\.gz' -e 'bar\.dat' \ | ||
| 113 | | wc -l` -eq 2 | ||
| 114 | |||
| 115 | # Should include foo.tar.gz, bar.tar.gz, and bar.dat | ||
| 116 | guix build -d --sources=transitive foo | ||
| 117 | test `guix build -d --sources=transitive foo \ | ||
| 118 | | grep -e 'foo\.tar\.gz' -e 'bar\.tar\.gz' -e 'bar\.dat' \ | ||
| 119 | | wc -l` -eq 3 | ||
| 120 | |||
| 39 | # Should all return valid log files. | 121 | # Should all return valid log files. |
| 40 | drv="`guix build -d -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`" | 122 | drv="`guix build -d -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`" |
| 41 | out="`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`" | 123 | out="`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`" |
diff --git a/tests/guix-gc.sh b/tests/guix-gc.sh index eac9d82e898..c1eb66cef53 100644 --- a/tests/guix-gc.sh +++ b/tests/guix-gc.sh | |||
| @@ -64,3 +64,23 @@ guix gc -C 1KiB | |||
| 64 | # Check trivial error cases. | 64 | # Check trivial error cases. |
| 65 | if guix gc --delete /dev/null; | 65 | if guix gc --delete /dev/null; |
| 66 | then false; else true; fi | 66 | then false; else true; fi |
| 67 | |||
| 68 | # Bug #19757 | ||
| 69 | out="`guix build guile-bootstrap`" | ||
| 70 | test -d "$out" | ||
| 71 | |||
| 72 | guix gc --delete "$out" | ||
| 73 | |||
| 74 | ! test -d "$out" | ||
| 75 | |||
| 76 | out="`guix build guile-bootstrap`" | ||
| 77 | test -d "$out" | ||
| 78 | |||
| 79 | guix gc --delete "$out/" | ||
| 80 | |||
| 81 | ! test -d "$out" | ||
| 82 | |||
| 83 | out="`guix build guile-bootstrap`" | ||
| 84 | test -d "$out" | ||
| 85 | |||
| 86 | guix gc --delete "$out/bin/guile" | ||
diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh index cf3233bee27..14222cfd25d 100644 --- a/tests/guix-package-net.sh +++ b/tests/guix-package-net.sh | |||
| @@ -147,7 +147,7 @@ test "`readlink_base "$profile"`" = "$profile-2-link" | |||
| 147 | 147 | ||
| 148 | # Make sure LIBRARY_PATH gets listed by `--search-paths'. | 148 | # Make sure LIBRARY_PATH gets listed by `--search-paths'. |
| 149 | guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap | 149 | guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap |
| 150 | guix package --search-paths -p "$profile" | grep LIBRARY_PATH | 150 | guix package -p "$profile" --search-paths | grep LIBRARY_PATH |
| 151 | 151 | ||
| 152 | # Roll back so we can delete #3 below. | 152 | # Roll back so we can delete #3 below. |
| 153 | guix package -p "$profile" --switch-generation=2 | 153 | guix package -p "$profile" --switch-generation=2 |
diff --git a/tests/guix-package.sh b/tests/guix-package.sh index a732110d5c7..b361b1ba00a 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh | |||
| @@ -52,8 +52,13 @@ test -L "$profile" && test -L "$profile-1-link" | |||
| 52 | test -f "$profile/bin/guile" | 52 | test -f "$profile/bin/guile" |
| 53 | 53 | ||
| 54 | # No search path env. var. here. | 54 | # No search path env. var. here. |
| 55 | guix package --search-paths -p "$profile" | 55 | guix package -p "$profile" --search-paths |
| 56 | test "`guix package --search-paths -p "$profile" | wc -l`" = 0 | 56 | guix package -p "$profile" --search-paths | grep '^export PATH=' |
| 57 | test "`guix package -p "$profile" --search-paths | wc -l`" = 1 # $PATH | ||
| 58 | ( set -e; set -x; \ | ||
| 59 | eval `guix package --search-paths=prefix -p "$PWD/$profile"`; \ | ||
| 60 | test "`type -P guile`" = "$PWD/$profile/bin/guile" ; \ | ||
| 61 | type -P rm ) | ||
| 57 | 62 | ||
| 58 | # Exit with 1 when a generation does not exist. | 63 | # Exit with 1 when a generation does not exist. |
| 59 | if guix package -p "$profile" --delete-generations=42; | 64 | if guix package -p "$profile" --delete-generations=42; |
| @@ -237,3 +242,31 @@ export GUIX_BUILD_OPTIONS | |||
| 237 | available2="`guix package -A | sort`" | 242 | available2="`guix package -A | sort`" |
| 238 | test "$available2" = "$available" | 243 | test "$available2" = "$available" |
| 239 | guix package -I | 244 | guix package -I |
| 245 | |||
| 246 | unset GUIX_BUILD_OPTIONS | ||
| 247 | |||
| 248 | # Applying a manifest file. | ||
| 249 | cat > "$module_dir/manifest.scm"<<EOF | ||
| 250 | (use-package-modules bootstrap) | ||
| 251 | |||
| 252 | (packages->manifest (list %bootstrap-guile)) | ||
| 253 | EOF | ||
| 254 | guix package --bootstrap -m "$module_dir/manifest.scm" | ||
| 255 | guix package -I | grep guile | ||
| 256 | test `guix package -I | wc -l` -eq 1 | ||
| 257 | |||
| 258 | # Error reporting. | ||
| 259 | cat > "$module_dir/manifest.scm"<<EOF | ||
| 260 | (use-package-modules bootstrap) | ||
| 261 | (packages->manifest | ||
| 262 | (list %bootstrap-guile | ||
| 263 | wonderful-package-that-does-not-exist)) | ||
| 264 | EOF | ||
| 265 | if guix package --bootstrap -n -m "$module_dir/manifest.scm" \ | ||
| 266 | 2> "$module_dir/stderr" | ||
| 267 | then false | ||
| 268 | else | ||
| 269 | cat "$module_dir/stderr" | ||
| 270 | grep "manifest.scm:[1-3]:.*[Uu]nbound variable.*wonderful-package" \ | ||
| 271 | "$module_dir/stderr" | ||
| 272 | fi | ||
diff --git a/tests/guix-register.sh b/tests/guix-register.sh index 7084ac6b8c6..360cf55979a 100644 --- a/tests/guix-register.sh +++ b/tests/guix-register.sh | |||
| @@ -56,15 +56,14 @@ guile -c " | |||
| 56 | (exit (= (stat:ino (stat \"$new_file\")) | 56 | (exit (= (stat:ino (stat \"$new_file\")) |
| 57 | (stat:ino (stat \"$new_file2\"))))" | 57 | (stat:ino (stat \"$new_file2\"))))" |
| 58 | 58 | ||
| 59 | # Make sure both are valid, and delete them. | 59 | # Make sure both are valid. |
| 60 | guile -c " | 60 | guile -c " |
| 61 | (use-modules (guix store)) | 61 | (use-modules (guix store)) |
| 62 | (define s (open-connection)) | 62 | (define s (open-connection)) |
| 63 | (exit (and (valid-path? s \"$new_file\") | 63 | (exit (and (valid-path? s \"$new_file\") |
| 64 | (valid-path? s \"$new_file2\") | 64 | (valid-path? s \"$new_file2\") |
| 65 | (null? (references s \"$new_file\")) | 65 | (null? (references s \"$new_file\")) |
| 66 | (null? (references s \"$new_file2\")) | 66 | (null? (references s \"$new_file2\"))))" |
| 67 | (pair? (delete-paths s (list \"$new_file\" \"$new_file2\")))))" | ||
| 68 | 67 | ||
| 69 | 68 | ||
| 70 | # | 69 | # |
| @@ -98,6 +97,33 @@ guix-register --prefix "$new_store" "$closure" | |||
| 98 | guix-register -p "$new_store" \ | 97 | guix-register -p "$new_store" \ |
| 99 | --state-directory "$new_store/chbouib" "$closure" | 98 | --state-directory "$new_store/chbouib" "$closure" |
| 100 | 99 | ||
| 100 | # Register duplicate files. | ||
| 101 | cp "$new_file" "$new_file2" "$new_store_dir" | ||
| 102 | guix-register -p "$new_store" <<EOF | ||
| 103 | $new_file | ||
| 104 | |||
| 105 | 0 | ||
| 106 | EOF | ||
| 107 | guix-register -p "$new_store" <<EOF | ||
| 108 | $new_file2 | ||
| 109 | |||
| 110 | 0 | ||
| 111 | EOF | ||
| 112 | |||
| 113 | copied_duplicate1="$new_store_dir/`basename $new_file`" | ||
| 114 | copied_duplicate2="$new_store_dir/`basename $new_file2`" | ||
| 115 | |||
| 116 | # Make sure there is indeed deduplication under $new_store and that there are | ||
| 117 | # no cross-store hard links. | ||
| 118 | guile -c " | ||
| 119 | (exit (and (= (stat:ino (stat \"$copied_duplicate1\")) | ||
| 120 | (stat:ino (stat \"$copied_duplicate2\"))) | ||
| 121 | (not (= (stat:ino (stat \"$new_file\")) | ||
| 122 | (stat:ino (stat \"$copied_duplicate1\"))))))" | ||
| 123 | |||
| 124 | # Delete them. | ||
| 125 | guix gc -d "$new_file" "$new_file2" | ||
| 126 | |||
| 101 | # Now make sure this is recognized as valid. | 127 | # Now make sure this is recognized as valid. |
| 102 | 128 | ||
| 103 | ls -R "$new_store" | 129 | ls -R "$new_store" |
| @@ -107,12 +133,13 @@ do | |||
| 107 | NIX_STATE_DIR="$new_store$state_dir" | 133 | NIX_STATE_DIR="$new_store$state_dir" |
| 108 | NIX_LOG_DIR="$new_store$state_dir/log/guix" | 134 | NIX_LOG_DIR="$new_store$state_dir/log/guix" |
| 109 | NIX_DB_DIR="$new_store$state_dir/db" | 135 | NIX_DB_DIR="$new_store$state_dir/db" |
| 136 | GUIX_DAEMON_SOCKET="$NIX_STATE_DIR/daemon-socket/socket" | ||
| 110 | 137 | ||
| 111 | export NIX_IGNORE_SYMLINK_STORE NIX_STORE_DIR NIX_STATE_DIR \ | 138 | export NIX_IGNORE_SYMLINK_STORE NIX_STORE_DIR NIX_STATE_DIR \ |
| 112 | NIX_LOG_DIR NIX_DB_DIR | 139 | NIX_LOG_DIR NIX_DB_DIR GUIX_DAEMON_SOCKET |
| 113 | 140 | ||
| 114 | # Check whether we overflow the limitation on local socket name lengths. | 141 | # Check whether we overflow the limitation on local socket name lengths. |
| 115 | if [ `echo "$NIX_STATE_DIR/daemon-socket/socket" | wc -c` -ge 108 ] | 142 | if [ `echo "$GUIX_DAEMON_SOCKET" | wc -c` -ge 108 ] |
| 116 | then | 143 | then |
| 117 | # Mark the test as skipped even though we already did some work so | 144 | # Mark the test as skipped even though we already did some work so |
| 118 | # that the remainder is not silently skipped. | 145 | # that the remainder is not silently skipped. |
| @@ -130,9 +157,12 @@ do | |||
| 130 | # that name in a 'valid-path?' query because 'assertStorePath' would kill | 157 | # that name in a 'valid-path?' query because 'assertStorePath' would kill |
| 131 | # us because of the wrong prefix. So we just list dead paths instead. | 158 | # us because of the wrong prefix. So we just list dead paths instead. |
| 132 | guile -c " | 159 | guile -c " |
| 133 | (use-modules (guix store)) | 160 | (use-modules (guix store) (srfi srfi-1)) |
| 134 | (define s (open-connection)) | 161 | (define s (open-connection \"$GUIX_DAEMON_SOCKET\")) |
| 135 | (exit (equal? (list \"$copied\") (dead-paths s)))" | 162 | (exit (lset= string=? |
| 163 | (pk 1 (list \"$copied\" \"$copied_duplicate1\" | ||
| 164 | \"$copied_duplicate2\")) | ||
| 165 | (pk 2 (dead-paths s))))" | ||
| 136 | 166 | ||
| 137 | # Kill the daemon so we can access the database below (otherwise we may | 167 | # Kill the daemon so we can access the database below (otherwise we may |
| 138 | # get "database is locked" errors.) | 168 | # get "database is locked" errors.) |
diff --git a/tests/guix-system.sh b/tests/guix-system.sh index 1b77d1a0db4..4289db23909 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh | |||
| @@ -45,6 +45,32 @@ else | |||
| 45 | fi | 45 | fi |
| 46 | 46 | ||
| 47 | 47 | ||
| 48 | # Reporting of unbound variables. | ||
| 49 | |||
| 50 | cat > "$tmpfile" <<EOF | ||
| 51 | (use-modules (gnu)) ; 1 | ||
| 52 | (use-service-modules networking) ; 2 | ||
| 53 | |||
| 54 | (operating-system ; 4 | ||
| 55 | (host-name "antelope") ; 5 | ||
| 56 | (timezone "Europe/Paris") ; 6 | ||
| 57 | (locale "en_US.UTF-8") ; 7 | ||
| 58 | |||
| 59 | (bootloader (GRUB-config (device "/dev/sdX"))) ; 9 | ||
| 60 | (file-systems (cons (file-system | ||
| 61 | (device "root") | ||
| 62 | (title 'label) | ||
| 63 | (mount-point "/") | ||
| 64 | (type "ext4")) | ||
| 65 | %base-file-systems))) | ||
| 66 | EOF | ||
| 67 | |||
| 68 | if guix system build "$tmpfile" -n 2> "$errorfile" | ||
| 69 | then false | ||
| 70 | else | ||
| 71 | grep "$tmpfile:9:.*[Uu]nbound variable.*GRUB-config" "$errorfile" | ||
| 72 | fi | ||
| 73 | |||
| 48 | # Reporting of duplicate service identifiers. | 74 | # Reporting of duplicate service identifiers. |
| 49 | 75 | ||
| 50 | cat > "$tmpfile" <<EOF | 76 | cat > "$tmpfile" <<EOF |
| @@ -76,3 +102,42 @@ then | |||
| 76 | else | 102 | else |
| 77 | grep "service 'networking'.*more than once" "$errorfile" | 103 | grep "service 'networking'.*more than once" "$errorfile" |
| 78 | fi | 104 | fi |
| 105 | |||
| 106 | make_user_config () | ||
| 107 | { | ||
| 108 | cat > "$tmpfile" <<EOF | ||
| 109 | (use-modules (gnu)) | ||
| 110 | (use-service-modules networking) | ||
| 111 | |||
| 112 | (operating-system | ||
| 113 | (host-name "antelope") | ||
| 114 | (timezone "Europe/Paris") | ||
| 115 | (locale "en_US.UTF-8") | ||
| 116 | |||
| 117 | (bootloader (grub-configuration (device "/dev/sdX"))) | ||
| 118 | (file-systems (cons (file-system | ||
| 119 | (device "root") | ||
| 120 | (title 'label) | ||
| 121 | (mount-point "/") | ||
| 122 | (type "ext4")) | ||
| 123 | %base-file-systems)) | ||
| 124 | (users (list (user-account | ||
| 125 | (name "dave") | ||
| 126 | (home-directory "/home/dave") | ||
| 127 | (group "$1") | ||
| 128 | (supplementary-groups '("$2")))))) | ||
| 129 | EOF | ||
| 130 | } | ||
| 131 | |||
| 132 | make_user_config "users" "wheel" | ||
| 133 | guix system build "$tmpfile" -n # succeeds | ||
| 134 | |||
| 135 | make_user_config "group-that-does-not-exist" "users" | ||
| 136 | if guix system build "$tmpfile" -n 2> "$errorfile" | ||
| 137 | then false | ||
| 138 | else grep "primary group.*group-that-does-not-exist.*undeclared" "$errorfile"; fi | ||
| 139 | |||
| 140 | make_user_config "users" "group-that-does-not-exist" | ||
| 141 | if guix system build "$tmpfile" -n 2> "$errorfile" | ||
| 142 | then false | ||
| 143 | else grep "supplementary group.*group-that-does-not-exist.*undeclared" "$errorfile"; fi | ||
diff --git a/tests/hackage.scm b/tests/hackage.scm index 23b854caa49..229bee35ea6 100644 --- a/tests/hackage.scm +++ b/tests/hackage.scm | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | 18 | ||
| 19 | (define-module (test-hackage) | 19 | (define-module (test-hackage) |
| 20 | #:use-module (guix import cabal) | ||
| 20 | #:use-module (guix import hackage) | 21 | #:use-module (guix import hackage) |
| 21 | #:use-module (guix tests) | 22 | #:use-module (guix tests) |
| 22 | #:use-module (srfi srfi-64) | 23 | #:use-module (srfi srfi-64) |
| @@ -35,44 +36,44 @@ executable cabal | |||
| 35 | mtl >= 2.0 && < 3 | 36 | mtl >= 2.0 && < 3 |
| 36 | ") | 37 | ") |
| 37 | 38 | ||
| 38 | ;; Use TABs to indent lines and to separate keys from value. | ||
| 39 | (define test-cabal-2 | 39 | (define test-cabal-2 |
| 40 | "name: foo | ||
| 41 | version: 1.0.0 | ||
| 42 | homepage: http://test.org | ||
| 43 | synopsis: synopsis | ||
| 44 | description: description | ||
| 45 | license: BSD3 | ||
| 46 | executable cabal | ||
| 47 | build-depends: HTTP >= 4000.2.5 && < 4000.3, | ||
| 48 | mtl >= 2.0 && < 3 | ||
| 49 | ") | ||
| 50 | |||
| 51 | ;; Use indentation with comma as found, e.g., in 'haddock-api'. | ||
| 52 | (define test-cabal-3 | ||
| 53 | "name: foo | 40 | "name: foo |
| 54 | version: 1.0.0 | 41 | version: 1.0.0 |
| 55 | homepage: http://test.org | 42 | homepage: http://test.org |
| 56 | synopsis: synopsis | 43 | synopsis: synopsis |
| 57 | description: description | 44 | description: description |
| 58 | license: BSD3 | 45 | license: BSD3 |
| 59 | executable cabal | 46 | executable cabal { |
| 60 | build-depends: | 47 | build-depends: |
| 61 | HTTP >= 4000.2.5 && < 4000.3 | 48 | HTTP >= 4000.2.5 && < 4000.3, |
| 62 | , mtl >= 2.0 && < 3 | 49 | mtl >= 2.0 && < 3 |
| 50 | } | ||
| 63 | ") | 51 | ") |
| 64 | 52 | ||
| 65 | (define test-cond-1 | 53 | ;; A fragment of a real Cabal file with minor modification to check precedence |
| 66 | "(os(darwin) || !(flag(debug))) && flag(cips)") | 54 | ;; of 'and' over 'or'. |
| 67 | 55 | (define test-read-cabal-1 | |
| 68 | (define read-cabal | 56 | "name: test-me |
| 69 | (@@ (guix import hackage) read-cabal)) | 57 | library |
| 70 | 58 | -- Choose which library versions to use. | |
| 71 | (define eval-cabal-keywords | 59 | if flag(base4point8) |
| 72 | (@@ (guix import hackage) eval-cabal-keywords)) | 60 | Build-depends: base >= 4.8 && < 5 |
| 73 | 61 | else | |
| 74 | (define conditional->sexp-like | 62 | if flag(base4) |
| 75 | (@@ (guix import hackage) conditional->sexp-like)) | 63 | Build-depends: base >= 4 && < 4.8 |
| 64 | else | ||
| 65 | if flag(base3) | ||
| 66 | Build-depends: base >= 3 && < 4 | ||
| 67 | else | ||
| 68 | Build-depends: base < 3 | ||
| 69 | if flag(base4point8) || flag(base4) && flag(base3) | ||
| 70 | Build-depends: random | ||
| 71 | Build-depends: containers | ||
| 72 | |||
| 73 | -- Modules that are always built. | ||
| 74 | Exposed-Modules: | ||
| 75 | Test.QuickCheck.Exception | ||
| 76 | ") | ||
| 76 | 77 | ||
| 77 | (test-begin "hackage") | 78 | (test-begin "hackage") |
| 78 | 79 | ||
| @@ -115,18 +116,25 @@ executable cabal | |||
| 115 | (test-assert "hackage->guix-package test 2" | 116 | (test-assert "hackage->guix-package test 2" |
| 116 | (eval-test-with-cabal test-cabal-2)) | 117 | (eval-test-with-cabal test-cabal-2)) |
| 117 | 118 | ||
| 118 | (test-assert "hackage->guix-package test 3" | 119 | (test-assert "read-cabal test 1" |
| 119 | (eval-test-with-cabal test-cabal-3)) | 120 | (match (call-with-input-string test-read-cabal-1 read-cabal) |
| 120 | 121 | ((("name" ("test-me")) | |
| 121 | (test-assert "conditional->sexp-like" | 122 | ('section 'library |
| 122 | (match | 123 | (('if ('flag "base4point8") |
| 123 | (eval-cabal-keywords | 124 | (("build-depends" ("base >= 4.8 && < 5"))) |
| 124 | (conditional->sexp-like test-cond-1) | 125 | (('if ('flag "base4") |
| 125 | '(("debug" . "False"))) | 126 | (("build-depends" ("base >= 4 && < 4.8"))) |
| 126 | (('and ('or ('string-match "darwin" ('%current-system)) ('not '#f)) '#t) | 127 | (('if ('flag "base3") |
| 128 | (("build-depends" ("base >= 3 && < 4"))) | ||
| 129 | (("build-depends" ("base < 3")))))))) | ||
| 130 | ('if ('or ('flag "base4point8") | ||
| 131 | ('and ('flag "base4") ('flag "base3"))) | ||
| 132 | (("build-depends" ("random"))) | ||
| 133 | ()) | ||
| 134 | ("build-depends" ("containers")) | ||
| 135 | ("exposed-modules" ("Test.QuickCheck.Exception"))))) | ||
| 127 | #t) | 136 | #t) |
| 128 | (x | 137 | (x (pk 'fail x #f)))) |
| 129 | (pk 'fail x #f)))) | ||
| 130 | 138 | ||
| 131 | (test-end "hackage") | 139 | (test-end "hackage") |
| 132 | 140 | ||
diff --git a/tests/monads.scm b/tests/monads.scm index 57a8e667970..d3ef065f24d 100644 --- a/tests/monads.scm +++ b/tests/monads.scm | |||
| @@ -103,6 +103,19 @@ | |||
| 103 | %monads | 103 | %monads |
| 104 | %monad-run)) | 104 | %monad-run)) |
| 105 | 105 | ||
| 106 | (test-assert ">>= with more than two arguments" | ||
| 107 | (every (lambda (monad run) | ||
| 108 | (let ((1+ (lift1 1+ monad)) | ||
| 109 | (2* (lift1 (cut * 2 <>) monad))) | ||
| 110 | (with-monad monad | ||
| 111 | (let ((number (random 777))) | ||
| 112 | (= (run (>>= (return number) | ||
| 113 | 1+ 1+ 1+ | ||
| 114 | 2* 2* 2*)) | ||
| 115 | (* 8 (+ number 3))))))) | ||
| 116 | %monads | ||
| 117 | %monad-run)) | ||
| 118 | |||
| 106 | (test-assert "mbegin" | 119 | (test-assert "mbegin" |
| 107 | (every (lambda (monad run) | 120 | (every (lambda (monad run) |
| 108 | (with-monad monad | 121 | (with-monad monad |
| @@ -163,7 +176,7 @@ | |||
| 163 | (test-assert "mapm" | 176 | (test-assert "mapm" |
| 164 | (every (lambda (monad run) | 177 | (every (lambda (monad run) |
| 165 | (with-monad monad | 178 | (with-monad monad |
| 166 | (equal? (run (mapm monad (lift1 1+ monad) (map return (iota 10)))) | 179 | (equal? (run (mapm monad (lift1 1+ monad) (iota 10))) |
| 167 | (map 1+ (iota 10))))) | 180 | (map 1+ (iota 10))))) |
| 168 | %monads | 181 | %monads |
| 169 | %monad-run)) | 182 | %monad-run)) |
| @@ -202,11 +215,12 @@ | |||
| 202 | (test-assert "anym" | 215 | (test-assert "anym" |
| 203 | (every (lambda (monad run) | 216 | (every (lambda (monad run) |
| 204 | (eq? (run (with-monad monad | 217 | (eq? (run (with-monad monad |
| 205 | (let ((lst (list (return 1) (return 2) (return 3)))) | 218 | (anym monad |
| 206 | (anym monad | 219 | (lift1 (lambda (x) |
| 207 | (lambda (x) | 220 | (and (odd? x) 'odd!)) |
| 208 | (and (odd? x) 'odd!)) | 221 | monad) |
| 209 | lst)))) | 222 | (append (make-list 1000 0) |
| 223 | (list 1 2))))) | ||
| 210 | 'odd!)) | 224 | 'odd!)) |
| 211 | %monads | 225 | %monads |
| 212 | %monad-run)) | 226 | %monad-run)) |
diff --git a/tests/packages.scm b/tests/packages.scm index 4e528136591..511ad78b6c8 100644 --- a/tests/packages.scm +++ b/tests/packages.scm | |||
| @@ -155,6 +155,36 @@ | |||
| 155 | (package-transitive-supported-systems d) | 155 | (package-transitive-supported-systems d) |
| 156 | (package-transitive-supported-systems e)))) | 156 | (package-transitive-supported-systems e)))) |
| 157 | 157 | ||
| 158 | (let* ((o (dummy-origin)) | ||
| 159 | (u (dummy-origin)) | ||
| 160 | (i (dummy-origin)) | ||
| 161 | (a (dummy-package "a")) | ||
| 162 | (b (dummy-package "b" | ||
| 163 | (inputs `(("a" ,a) ("i" ,i))))) | ||
| 164 | (c (package (inherit b) (source o))) | ||
| 165 | (d (dummy-package "d" | ||
| 166 | (build-system trivial-build-system) | ||
| 167 | (source u) (inputs `(("c" ,c)))))) | ||
| 168 | (test-assert "package-direct-sources, no source" | ||
| 169 | (null? (package-direct-sources a))) | ||
| 170 | (test-equal "package-direct-sources, #f source" | ||
| 171 | (list i) | ||
| 172 | (package-direct-sources b)) | ||
| 173 | (test-equal "package-direct-sources, not input source" | ||
| 174 | (list u) | ||
| 175 | (package-direct-sources d)) | ||
| 176 | (test-assert "package-direct-sources" | ||
| 177 | (let ((s (package-direct-sources c))) | ||
| 178 | (and (= (length (pk 's-sources s)) 2) | ||
| 179 | (member o s) | ||
| 180 | (member i s)))) | ||
| 181 | (test-assert "package-transitive-sources" | ||
| 182 | (let ((s (package-transitive-sources d))) | ||
| 183 | (and (= (length (pk 'd-sources s)) 3) | ||
| 184 | (member o s) | ||
| 185 | (member i s) | ||
| 186 | (member u s))))) | ||
| 187 | |||
| 158 | (test-equal "package-transitive-supported-systems, implicit inputs" | 188 | (test-equal "package-transitive-supported-systems, implicit inputs" |
| 159 | %supported-systems | 189 | %supported-systems |
| 160 | 190 | ||
diff --git a/tests/profiles.scm b/tests/profiles.scm index 54fbaea8640..cc9a822ceea 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm | |||
| @@ -24,10 +24,14 @@ | |||
| 24 | #:use-module (guix monads) | 24 | #:use-module (guix monads) |
| 25 | #:use-module (guix packages) | 25 | #:use-module (guix packages) |
| 26 | #:use-module (guix derivations) | 26 | #:use-module (guix derivations) |
| 27 | #:use-module (guix build-system trivial) | ||
| 27 | #:use-module (gnu packages bootstrap) | 28 | #:use-module (gnu packages bootstrap) |
| 28 | #:use-module ((gnu packages base) #:prefix packages:) | 29 | #:use-module ((gnu packages base) #:prefix packages:) |
| 30 | #:use-module ((gnu packages guile) #:prefix packages:) | ||
| 29 | #:use-module (ice-9 match) | 31 | #:use-module (ice-9 match) |
| 30 | #:use-module (ice-9 regex) | 32 | #:use-module (ice-9 regex) |
| 33 | #:use-module (ice-9 popen) | ||
| 34 | #:use-module (rnrs io ports) | ||
| 31 | #:use-module (srfi srfi-11) | 35 | #:use-module (srfi srfi-11) |
| 32 | #:use-module (srfi srfi-64)) | 36 | #:use-module (srfi srfi-64)) |
| 33 | 37 | ||
| @@ -198,6 +202,109 @@ | |||
| 198 | #:hooks '()))) | 202 | #:hooks '()))) |
| 199 | (return (derivation-inputs drv)))) | 203 | (return (derivation-inputs drv)))) |
| 200 | 204 | ||
| 205 | (test-assertm "profile-manifest, search-paths" | ||
| 206 | (mlet* %store-monad | ||
| 207 | ((guile -> (package | ||
| 208 | (inherit %bootstrap-guile) | ||
| 209 | (native-search-paths | ||
| 210 | (package-native-search-paths packages:guile-2.0)))) | ||
| 211 | (entry -> (package->manifest-entry guile)) | ||
| 212 | (drv (profile-derivation (manifest (list entry)) | ||
| 213 | #:hooks '())) | ||
| 214 | (profile -> (derivation->output-path drv))) | ||
| 215 | (mbegin %store-monad | ||
| 216 | (built-derivations (list drv)) | ||
| 217 | |||
| 218 | ;; Read the manifest back and make sure search paths are preserved. | ||
| 219 | (let ((manifest (profile-manifest profile))) | ||
| 220 | (match (manifest-entries manifest) | ||
| 221 | ((result) | ||
| 222 | (return (equal? (manifest-entry-search-paths result) | ||
| 223 | (manifest-entry-search-paths entry) | ||
| 224 | (package-native-search-paths | ||
| 225 | packages:guile-2.0))))))))) | ||
| 226 | |||
| 227 | (test-assertm "etc/profile" | ||
| 228 | ;; Make sure we get an 'etc/profile' file that at least defines $PATH. | ||
| 229 | (mlet* %store-monad | ||
| 230 | ((guile -> (package | ||
| 231 | (inherit %bootstrap-guile) | ||
| 232 | (native-search-paths | ||
| 233 | (package-native-search-paths packages:guile-2.0)))) | ||
| 234 | (entry -> (package->manifest-entry guile)) | ||
| 235 | (drv (profile-derivation (manifest (list entry)) | ||
| 236 | #:hooks '())) | ||
| 237 | (profile -> (derivation->output-path drv))) | ||
| 238 | (mbegin %store-monad | ||
| 239 | (built-derivations (list drv)) | ||
| 240 | (let* ((pipe (open-input-pipe | ||
| 241 | (string-append "unset GUIX_PROFILE; " | ||
| 242 | ;; 'source' is a Bashism; use '.' (dot). | ||
| 243 | ". " profile "/etc/profile; " | ||
| 244 | ;; Don't try to parse set(1) output because | ||
| 245 | ;; it differs among shells; just use echo. | ||
| 246 | "echo $PATH"))) | ||
| 247 | (path (get-string-all pipe))) | ||
| 248 | (return | ||
| 249 | (and (zero? (close-pipe pipe)) | ||
| 250 | (string-contains path (string-append profile "/bin")))))))) | ||
| 251 | |||
| 252 | (test-assertm "etc/profile when etc/ already exists" | ||
| 253 | ;; Here 'union-build' makes the profile's etc/ a symlink to the package's | ||
| 254 | ;; etc/ directory, which makes it read-only. Make sure the profile build | ||
| 255 | ;; handles that. | ||
| 256 | (mlet* %store-monad | ||
| 257 | ((thing -> (dummy-package "dummy" | ||
| 258 | (build-system trivial-build-system) | ||
| 259 | (arguments | ||
| 260 | `(#:guile ,%bootstrap-guile | ||
| 261 | #:builder | ||
| 262 | (let ((out (assoc-ref %outputs "out"))) | ||
| 263 | (mkdir out) | ||
| 264 | (mkdir (string-append out "/etc")) | ||
| 265 | (call-with-output-file (string-append out "/etc/foo") | ||
| 266 | (lambda (port) | ||
| 267 | (display "foo!" port)))))))) | ||
| 268 | (entry -> (package->manifest-entry thing)) | ||
| 269 | (drv (profile-derivation (manifest (list entry)) | ||
| 270 | #:hooks '())) | ||
| 271 | (profile -> (derivation->output-path drv))) | ||
| 272 | (mbegin %store-monad | ||
| 273 | (built-derivations (list drv)) | ||
| 274 | (return (and (file-exists? (string-append profile "/etc/profile")) | ||
| 275 | (string=? (call-with-input-file | ||
| 276 | (string-append profile "/etc/foo") | ||
| 277 | get-string-all) | ||
| 278 | "foo!")))))) | ||
| 279 | |||
| 280 | (test-assertm "etc/profile when etc/ is a symlink" | ||
| 281 | ;; When etc/ is a symlink, the unsymlink code in 0.8.2 would fail | ||
| 282 | ;; gracelessly because 'scandir' would return #f. | ||
| 283 | (mlet* %store-monad | ||
| 284 | ((thing -> (dummy-package "dummy" | ||
| 285 | (build-system trivial-build-system) | ||
| 286 | (arguments | ||
| 287 | `(#:guile ,%bootstrap-guile | ||
| 288 | #:builder | ||
| 289 | (let ((out (assoc-ref %outputs "out"))) | ||
| 290 | (mkdir out) | ||
| 291 | (mkdir (string-append out "/foo")) | ||
| 292 | (symlink "foo" (string-append out "/etc")) | ||
| 293 | (call-with-output-file (string-append out "/etc/bar") | ||
| 294 | (lambda (port) | ||
| 295 | (display "foo!" port)))))))) | ||
| 296 | (entry -> (package->manifest-entry thing)) | ||
| 297 | (drv (profile-derivation (manifest (list entry)) | ||
| 298 | #:hooks '())) | ||
| 299 | (profile -> (derivation->output-path drv))) | ||
| 300 | (mbegin %store-monad | ||
| 301 | (built-derivations (list drv)) | ||
| 302 | (return (and (file-exists? (string-append profile "/etc/profile")) | ||
| 303 | (string=? (call-with-input-file | ||
| 304 | (string-append profile "/etc/bar") | ||
| 305 | get-string-all) | ||
| 306 | "foo!")))))) | ||
| 307 | |||
| 201 | (test-end "profiles") | 308 | (test-end "profiles") |
| 202 | 309 | ||
| 203 | 310 | ||
diff --git a/tests/store.scm b/tests/store.scm index eeceed45c18..faa924fce99 100644 --- a/tests/store.scm +++ b/tests/store.scm | |||
| @@ -600,6 +600,60 @@ | |||
| 600 | (null? (valid-derivers %store file)) | 600 | (null? (valid-derivers %store file)) |
| 601 | (null? (referrers %store file)))))) | 601 | (null? (referrers %store file)))))) |
| 602 | 602 | ||
| 603 | (test-assert "verify-store" | ||
| 604 | (let* ((text (random-text)) | ||
| 605 | (file1 (add-text-to-store %store "foo" text)) | ||
| 606 | (file2 (add-text-to-store %store "bar" (random-text) | ||
| 607 | (list file1)))) | ||
| 608 | (and (pk 'verify1 (verify-store %store)) ;hopefully OK ; | ||
| 609 | (begin | ||
| 610 | (delete-file file1) | ||
| 611 | (not (pk 'verify2 (verify-store %store)))) ;bad! ; | ||
| 612 | (begin | ||
| 613 | ;; Using 'add-text-to-store' here wouldn't work: It would succeed ; | ||
| 614 | ;; without actually creating the file. ; | ||
| 615 | (call-with-output-file file1 | ||
| 616 | (lambda (port) | ||
| 617 | (display text port))) | ||
| 618 | (pk 'verify3 (verify-store %store)))))) ;OK again | ||
| 619 | |||
| 620 | (test-assert "verify-store + check-contents" | ||
| 621 | ;; XXX: This test is I/O intensive. | ||
| 622 | (with-store s | ||
| 623 | (let* ((text (random-text)) | ||
| 624 | (drv (build-expression->derivation | ||
| 625 | s "corrupt" | ||
| 626 | `(let ((out (assoc-ref %outputs "out"))) | ||
| 627 | (call-with-output-file out | ||
| 628 | (lambda (port) | ||
| 629 | (display ,text port))) | ||
| 630 | #t) | ||
| 631 | #:guile-for-build | ||
| 632 | (package-derivation s %bootstrap-guile (%current-system)))) | ||
| 633 | (file (derivation->output-path drv))) | ||
| 634 | (with-derivation-substitute drv text | ||
| 635 | (and (build-derivations s (list drv)) | ||
| 636 | (verify-store s #:check-contents? #t) ;should be OK | ||
| 637 | (begin | ||
| 638 | (chmod file #o644) | ||
| 639 | (call-with-output-file file | ||
| 640 | (lambda (port) | ||
| 641 | (display "corrupt!" port))) | ||
| 642 | #t) | ||
| 643 | |||
| 644 | ;; Make sure the corruption is detected. We don't test repairing | ||
| 645 | ;; because only "trusted" users are allowed to do it, but we | ||
| 646 | ;; don't expose that notion of trusted users that nix-daemon | ||
| 647 | ;; supports because it seems dubious and redundant with what the | ||
| 648 | ;; OS provides (in Nix "trusted" users have additional | ||
| 649 | ;; privileges, such as overriding the set of substitute URLs, but | ||
| 650 | ;; we instead want to allow anyone to modify them, provided | ||
| 651 | ;; substitutes are signed by a root-approved key.) | ||
| 652 | (not (verify-store s #:check-contents? #t)) | ||
| 653 | |||
| 654 | ;; Delete the corrupt item to leave the store in a clean state. | ||
| 655 | (delete-paths s (list file))))))) | ||
| 656 | |||
| 603 | (test-equal "store-lower" | 657 | (test-equal "store-lower" |
| 604 | "Lowered." | 658 | "Lowered." |
| 605 | (let* ((add (store-lower text-file)) | 659 | (let* ((add (store-lower text-file)) |
diff --git a/tests/utils.scm b/tests/utils.scm index a662c9a8d38..115868c857a 100644 --- a/tests/utils.scm +++ b/tests/utils.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> | 3 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -21,6 +21,7 @@ | |||
| 21 | #:use-module ((guix config) #:select (%gzip)) | 21 | #:use-module ((guix config) #:select (%gzip)) |
| 22 | #:use-module (guix utils) | 22 | #:use-module (guix utils) |
| 23 | #:use-module ((guix store) #:select (%store-prefix store-path-package-name)) | 23 | #:use-module ((guix store) #:select (%store-prefix store-path-package-name)) |
| 24 | #:use-module ((guix search-paths) #:select (string-tokenize*)) | ||
| 24 | #:use-module (srfi srfi-1) | 25 | #:use-module (srfi srfi-1) |
| 25 | #:use-module (srfi srfi-11) | 26 | #:use-module (srfi srfi-11) |
| 26 | #:use-module (srfi srfi-64) | 27 | #:use-module (srfi srfi-64) |
