···55---
66# User's Guide to Vim Plugins/Addons/Bundles/Scripts in Nixpkgs
7788-You'll get a vim(-your-suffix) in PATH also loading the plugins you want.
88+Both Neovim and Vim can be configured to include your favorite plugins
99+and additional libraries.
1010+911Loading can be deferred; see examples.
10121111-Vim packages, VAM (=vim-addon-manager) and Pathogen are supported to load
1212-packages.
1313+At the moment we support three different methods for managing plugins:
1414+1515+- Vim packages (*recommend*)
1616+- VAM (=vim-addon-manager)
1717+- Pathogen
13181419## Custom configuration
1520···2530}
2631```
27322828-## Vim packages
3333+For Neovim the `configure` argument can be overridden to achieve the same:
3434+3535+```
3636+neovim.override {
3737+ configure = {
3838+ customRC = ''
3939+ # here your custom configuration goes!
4040+ '';
4141+ };
4242+}
4343+```
4444+4545+## Managing plugins with Vim packages
29463047To store you plugins in Vim packages the following example can be used:
3148···3855 opt = [ phpCompletion elm-vim ];
3956 # To automatically load a plugin when opening a filetype, add vimrc lines like:
4057 # autocmd FileType php :packadd phpCompletion
4141- }
4242-};
5858+ };
5959+}
4360```
44614545-## VAM
6262+For Neovim the syntax is
46634747-### dependencies by Vim plugins
6464+```
6565+neovim.override {
6666+ configure = {
6767+ customRC = ''
6868+ # here your custom configuration goes!
6969+ '';
7070+ packages.myVimPackage = with pkgs.vimPlugins; {
7171+ # see examples below how to use custom packages
7272+ start = [ ];
7373+ opt = [ ];
7474+ };
7575+ };
7676+}
7777+```
7878+7979+The resulting package can be added to `packageOverrides` in `~/.nixpkgs/config.nix` to make it installable:
8080+8181+```
8282+{
8383+ packageOverrides = pkgs: with pkgs; {
8484+ myVim = vim_configurable.customize {
8585+ name = "vim-with-plugins";
8686+ # add here code from the example section
8787+ };
8888+ myNeovim = neovim.override {
8989+ configure = {
9090+ # add here code from the example section
9191+ };
9292+ };
9393+ };
9494+}
9595+```
9696+9797+After that you can install your special grafted `myVim` or `myNeovim` packages.
9898+9999+## Managing plugins with VAM
100100+101101+### Handling dependencies of Vim plugins
4810249103VAM introduced .json files supporting dependencies without versioning
50104assuming that "using latest version" is ok most of the time.
···124178 { "filetype_regex" = ''\%(vim)$$''; "names" = [ ''reload'' ''vim-dev-plugin'' ]; }
125179 ]
126180181181+182182+## Adding new plugins to nixpkgs
183183+184184+In `pkgs/misc/vim-plugins/vim-plugin-names` we store the plugin names
185185+for all vim plugins we automatically generate plugins for.
186186+The format of this file `github username/github repository`:
187187+For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`.
188188+After adding your plugin to this file run the `./update.py` in the same folder.
189189+This will updated a file called `generated.nix` and make your plugin accessible in the
190190+`vimPlugins` attribute set (`vimPlugins.nerdtree` in our example).
191191+If additional steps to the build process of the plugin are required, add an
192192+override to the `pkgs/misc/vim-plugins/default.nix` in the same directory.
127193128194## Important repositories
129195
+51
doc/package-notes.xml
···671671 plugins = with availablePlugins; [ python perl ];
672672 }
673673}</programlisting>
674674+ If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal>
675675+ attribute, <literal>availablePlugins</literal> will be used automatically.
674676 </para>
675677676678 <para>
···703705 });
704706}; }
705707</programlisting>
708708+ </para>
709709+ <para>
710710+ WeeChat allows to set defaults on startup using the <literal>--run-command</literal>.
711711+ The <literal>configure</literal> method can be used to pass commands to the program:
712712+<programlisting>weechat.override {
713713+ configure = { availablePlugins, ... }: {
714714+ init = ''
715715+ /set foo bar
716716+ /server add freenode chat.freenode.org
717717+ '';
718718+ };
719719+}</programlisting>
720720+ Further values can be added to the list of commands when running
721721+ <literal>weechat --run-command "your-commands"</literal>.
722722+ </para>
723723+ <para>
724724+ Additionally it's possible to specify scripts to be loaded when starting <literal>weechat</literal>.
725725+ These will be loaded before the commands from <literal>init</literal>:
726726+<programlisting>weechat.override {
727727+ configure = { availablePlugins, ... }: {
728728+ scripts = with pkgs.weechatScripts; [
729729+ weechat-xmpp weechat-matrix-bridge wee-slack
730730+ ];
731731+ init = ''
732732+ /set plugins.var.python.jabber.key "val"
733733+ '':
734734+ };
735735+}</programlisting>
736736+ </para>
737737+ <para>
738738+ In <literal>nixpkgs</literal> there's a subpackage which contains derivations for
739739+ WeeChat scripts. Such derivations expect a <literal>passthru.scripts</literal> attribute
740740+ which contains a list of all scripts inside the store path. Furthermore all scripts
741741+ have to live in <literal>$out/share</literal>. An exemplary derivation looks like this:
742742+<programlisting>{ stdenv, fetchurl }:
743743+744744+stdenv.mkDerivation {
745745+ name = "exemplary-weechat-script";
746746+ src = fetchurl {
747747+ url = "https://scripts.tld/your-scripts.tar.gz";
748748+ sha256 = "...";
749749+ };
750750+ passthru.scripts = [ "foo.py" "bar.lua" ];
751751+ installPhase = ''
752752+ mkdir $out/share
753753+ cp foo.py $out/share
754754+ cp bar.lua $out/share
755755+ '';
756756+}</programlisting>
706757 </para>
707758 </section>
708759 <section xml:id="sec-citrix">
+44
lib/asserts.nix
···11+{ lib }:
22+33+rec {
44+55+ /* Print a trace message if pred is false.
66+ Intended to be used to augment asserts with helpful error messages.
77+88+ Example:
99+ assertMsg false "nope"
1010+ => false
1111+ stderr> trace: nope
1212+1313+ assert (assertMsg ("foo" == "bar") "foo is not bar, silly"); ""
1414+ stderr> trace: foo is not bar, silly
1515+ stderr> assert failed at …
1616+1717+ Type:
1818+ assertMsg :: Bool -> String -> Bool
1919+ */
2020+ # TODO(Profpatsch): add tests that check stderr
2121+ assertMsg = pred: msg:
2222+ if pred
2323+ then true
2424+ else builtins.trace msg false;
2525+2626+ /* Specialized `assertMsg` for checking if val is one of the elements
2727+ of a list. Useful for checking enums.
2828+2929+ Example:
3030+ let sslLibrary = "libressl"
3131+ in assertOneOf "sslLibrary" sslLibrary [ "openssl" "bearssl" ]
3232+ => false
3333+ stderr> trace: sslLibrary must be one of "openssl", "bearssl", but is: "libressl"
3434+3535+ Type:
3636+ assertOneOf :: String -> ComparableVal -> List ComparableVal -> Bool
3737+ */
3838+ assertOneOf = name: val: xs: assertMsg
3939+ (lib.elem val xs)
4040+ "${name} must be one of ${
4141+ lib.generators.toPretty {} xs}, but is: ${
4242+ lib.generators.toPretty {} val}";
4343+4444+}
···509509 => 3
510510 */
511511 last = list:
512512- assert list != []; elemAt list (length list - 1);
512512+ assert lib.assertMsg (list != []) "lists.last: list must not be empty!";
513513+ elemAt list (length list - 1);
513514514515 /* Return all elements but the last
515516···517518 init [ 1 2 3 ]
518519 => [ 1 2 ]
519520 */
520520- init = list: assert list != []; take (length list - 1) list;
521521+ init = list:
522522+ assert lib.assertMsg (list != []) "lists.init: list must not be empty!";
523523+ take (length list - 1) list;
521524522525523526 /* return the image of the cross product of some lists by a function
+7-5
lib/strings.nix
···410410 components = splitString "/" url;
411411 filename = lib.last components;
412412 name = builtins.head (splitString sep filename);
413413- in assert name != filename; name;
413413+ in assert name != filename; name;
414414415415 /* Create an --{enable,disable}-<feat> string that can be passed to
416416 standard GNU Autoconf scripts.
···468468 strw = lib.stringLength str;
469469 reqWidth = width - (lib.stringLength filler);
470470 in
471471- assert strw <= width;
471471+ assert lib.assertMsg (strw <= width)
472472+ "fixedWidthString: requested string length (${
473473+ toString width}) must not be shorter than actual length (${
474474+ toString strw})";
472475 if strw == width then str else filler + fixedWidthString reqWidth filler str;
473476474477 /* Format a number adding leading zeroes up to fixed width.
···501504 isStorePath = x:
502505 isCoercibleToString x
503506 && builtins.substring 0 1 (toString x) == "/"
504504- && dirOf (builtins.toPath x) == builtins.storeDir;
507507+ && dirOf x == builtins.storeDir;
505508506509 /* Convert string to int
507510 Obviously, it is a bit hacky to use fromJSON that way.
···537540 */
538541 readPathsFromFile = rootPath: file:
539542 let
540540- root = toString rootPath;
541543 lines = lib.splitString "\n" (builtins.readFile file);
542544 removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line));
543545 relativePaths = removeComments lines;
544544- absolutePaths = builtins.map (path: builtins.toPath (root + "/" + path)) relativePaths;
546546+ absolutePaths = builtins.map (path: rootPath + "/${path}") relativePaths;
545547 in
546548 absolutePaths;
547549
···171171 builtins.fromJSON (builtins.readFile path);
172172173173174174- ## Warnings and asserts
174174+ ## Warnings
175175176176 /* See https://github.com/NixOS/nix/issues/749. Eventually we'd like these
177177 to expand to Nix builtins that carry metadata so that Nix can filter out
+6-2
lib/types.nix
···119119 let
120120 betweenDesc = lowest: highest:
121121 "${toString lowest} and ${toString highest} (both inclusive)";
122122- between = lowest: highest: assert lowest <= highest;
122122+ between = lowest: highest:
123123+ assert lib.assertMsg (lowest <= highest)
124124+ "ints.between: lowest must be smaller than highest";
123125 addCheck int (x: x >= lowest && x <= highest) // {
124126 name = "intBetween";
125127 description = "integer between ${betweenDesc lowest highest}";
···439441 # Either value of type `finalType` or `coercedType`, the latter is
440442 # converted to `finalType` using `coerceFunc`.
441443 coercedTo = coercedType: coerceFunc: finalType:
442442- assert coercedType.getSubModules == null;
444444+ assert lib.assertMsg (coercedType.getSubModules == null)
445445+ "coercedTo: coercedType must not have submodules (it’s a ${
446446+ coercedType.description})";
443447 mkOptionType rec {
444448 name = "coercedTo";
445449 description = "${finalType.description} or ${coercedType.description} convertible to it";
···5252 </listitem>
5353 </itemizedlist>
5454 To see what channels are available, go to
5555- <link
5656-xlink:href="https://nixos.org/channels"/>. (Note that the URIs of the
5555+ <link xlink:href="https://nixos.org/channels"/>. (Note that the URIs of the
5756 various channels redirect to a directory that contains the channel’s latest
5858- version and includes ISO images and VirtualBox appliances.)
5757+ version and includes ISO images and VirtualBox appliances.) Please note that
5858+ during the release process, channels that are not yet released will be
5959+ present here as well. See the Getting NixOS page
6060+ <link xlink:href="https://nixos.org/nixos/download.html"/> to find the newest
6161+ supported stable release.
5962 </para>
6063 <para>
6164 When you first install NixOS, you’re automatically subscribed to the NixOS
+15
nixos/doc/manual/release-notes/rl-1809.xml
···283283 from your config without any issues.
284284 </para>
285285 </listitem>
286286+ <listitem>
287287+ <para>
288288+ <literal>stdenv.system</literal> and <literal>system</literal> in nixpkgs now refer to the host platform instead of the build platform.
289289+ For native builds this is not change, let alone a breaking one.
290290+ For cross builds, it is a breaking change, and <literal>stdenv.buildPlatform.system</literal> can be used instead for the old behavior.
291291+ They should be using that anyways for clarity.
292292+ </para>
293293+ </listitem>
286294 </itemizedlist>
287295 </section>
288296···534542 paragraphs if the text contains two consecutive newlines, so it's no
535543 longer necessary to use <code></para><para></code> to start
536544 a new paragraph.
545545+ </para>
546546+ </listitem>
547547+ <listitem>
548548+ <para>
549549+ Top-level <literal>buildPlatform</literal>, <literal>hostPlatform</literal>, and <literal>targetPlatform</literal> in Nixpkgs are deprecated.
550550+ Please use their equivalents in <literal>stdenv</literal> instead:
551551+ <literal>stdenv.buildPlatform</literal>, <literal>stdenv.hostPlatform</literal>, and <literal>stdenv.targetPlatform</literal>.
537552 </para>
538553 </listitem>
539554 </itemizedlist>
+6-2
nixos/lib/eval-config.nix
···28282929let extraArgs_ = extraArgs; pkgs_ = pkgs;
3030 extraModules = let e = builtins.getEnv "NIXOS_EXTRA_MODULE_PATH";
3131- in if e == "" then [] else [(import (builtins.toPath e))];
3131+ in if e == "" then [] else [(import e)];
3232in
33333434let
···3636 _file = ./eval-config.nix;
3737 key = _file;
3838 config = {
3939- nixpkgs.localSystem = lib.mkDefault { inherit system; };
3939+ # Explicit `nixpkgs.system` or `nixpkgs.localSystem` should override
4040+ # this. Since the latter defaults to the former, the former should
4141+ # default to the argument. That way this new default could propagate all
4242+ # they way through, but has the last priority behind everything else.
4343+ nixpkgs.system = lib.mkDefault system;
4044 _module.args.pkgs = lib.mkIf (pkgs_ != null) (lib.mkForce pkgs_);
4145 };
4246 };
+15-6
nixos/modules/config/shells-environment.nix
···163163 /bin/sh
164164 '';
165165166166+ # For resetting environment with `. /etc/set-environment` when needed
167167+ # and discoverability (see motivation of #30418).
168168+ environment.etc."set-environment".source = config.system.build.setEnvironment;
169169+166170 system.build.setEnvironment = pkgs.writeText "set-environment"
167167- ''
168168- ${exportedEnvVars}
171171+ ''
172172+ # DO NOT EDIT -- this file has been generated automatically.
173173+174174+ # Prevent this file from being sourced by child shells.
175175+ export __NIXOS_SET_ENVIRONMENT_DONE=1
176176+177177+ ${exportedEnvVars}
169178170170- ${cfg.extraInit}
179179+ ${cfg.extraInit}
171180172172- # ~/bin if it exists overrides other bin directories.
173173- export PATH="$HOME/bin:$PATH"
174174- '';
181181+ # ~/bin if it exists overrides other bin directories.
182182+ export PATH="$HOME/bin:$PATH"
183183+ '';
175184176185 system.activationScripts.binsh = stringAfter [ "stdio" ]
177186 ''
+7-7
nixos/modules/config/xdg/mime.nix
···77 type = types.bool;
88 default = true;
99 description = ''
1010- Whether to install files to support the
1010+ Whether to install files to support the
1111 <link xlink:href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html">XDG Shared MIME-info specification</link> and the
1212 <link xlink:href="https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html">XDG MIME Applications specification</link>.
1313 '';
···1717 config = mkIf config.xdg.mime.enable {
1818 environment.pathsToLink = [ "/share/mime" ];
19192020- environment.systemPackages = [
2121- # this package also installs some useful data, as well as its utilities
2222- pkgs.shared-mime-info
2020+ environment.systemPackages = [
2121+ # this package also installs some useful data, as well as its utilities
2222+ pkgs.shared-mime-info
2323 ];
24242525 environment.extraSetup = ''
2626- if [ -w $out/share/mime ]; then
2727- XDG_DATA_DIRS=$out/share ${pkgs.shared-mime-info}/bin/update-mime-database -V $out/share/mime > /dev/null
2626+ if [ -w $out/share/mime ] && [ -d $out/share/mime/packages ]; then
2727+ XDG_DATA_DIRS=$out/share ${pkgs.shared-mime-info}/bin/update-mime-database -V $out/share/mime > /dev/null
2828 fi
29293030 if [ -w $out/share/applications ]; then
3131- ${pkgs.desktop-file-utils}/bin/update-desktop-database $out/share/applications
3131+ ${pkgs.desktop-file-utils}/bin/update-desktop-database $out/share/applications
3232 fi
3333 '';
3434 };
···2727 '';
2828 type = types.bool;
2929 };
3030-3030+3131 vendor.config.enable = mkOption {
3232 type = types.bool;
3333 default = true;
···4343 Whether fish should use completion files provided by other packages.
4444 '';
4545 };
4646-4646+4747 vendor.functions.enable = mkOption {
4848 type = types.bool;
4949 default = true;
···107107 # This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently
108108 # unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish
109109 set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $__fish_datadir/functions
110110-110110+111111 # source the NixOS environment config
112112- fenv source ${config.system.build.setEnvironment}
112112+ if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]
113113+ fenv source ${config.system.build.setEnvironment}
114114+ end
113115114116 # clear fish_function_path so that it will be correctly set when we return to $__fish_datadir/config.fish
115117 set -e fish_function_path
···123125 set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
124126 fenv source /etc/fish/foreign-env/shellInit > /dev/null
125127 set -e fish_function_path[1]
126126-128128+127129 ${cfg.shellInit}
128130129131 # and leave a note so we don't source this config section again from
···137139 set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
138140 fenv source /etc/fish/foreign-env/loginShellInit > /dev/null
139141 set -e fish_function_path[1]
140140-142142+141143 ${cfg.loginShellInit}
142144143145 # and leave a note so we don't source this config section again from
···149151 status --is-interactive; and not set -q __fish_nixos_interactive_config_sourced
150152 and begin
151153 ${fishAliases}
152152-153154154155 set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
155156 fenv source /etc/fish/foreign-env/interactiveShellInit > /dev/null
156157 set -e fish_function_path[1]
157157-158158+158159 ${cfg.promptInit}
159160 ${cfg.interactiveShellInit}
160161···170171 ++ optional cfg.vendor.config.enable "/share/fish/vendor_conf.d"
171172 ++ optional cfg.vendor.completions.enable "/share/fish/vendor_completions.d"
172173 ++ optional cfg.vendor.functions.enable "/share/fish/vendor_functions.d";
173173-174174+174175 environment.systemPackages = [ pkgs.fish ];
175176176177 environment.shells = [
+8-6
nixos/modules/programs/zsh/zsh.nix
···7070 promptInit = mkOption {
7171 default = ''
7272 if [ "$TERM" != dumb ]; then
7373- autoload -U promptinit && promptinit && prompt walters
7373+ autoload -U promptinit && promptinit && prompt walters
7474 fi
7575 '';
7676 description = ''
···116116 if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi
117117 export __ETC_ZSHENV_SOURCED=1
118118119119- ${config.system.build.setEnvironment.text}
119119+ if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
120120+ . ${config.system.build.setEnvironment}
121121+ fi
120122121123 ${cfge.shellInit}
122124···124126125127 # Read system-wide modifications.
126128 if test -f /etc/zshenv.local; then
127127- . /etc/zshenv.local
129129+ . /etc/zshenv.local
128130 fi
129131 '';
130132···143145144146 # Read system-wide modifications.
145147 if test -f /etc/zprofile.local; then
146146- . /etc/zprofile.local
148148+ . /etc/zprofile.local
147149 fi
148150 '';
149151···169171170172 # Tell zsh how to find installed completions
171173 for p in ''${(z)NIX_PROFILES}; do
172172- fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions)
174174+ fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions)
173175 done
174176175177 ${optionalString cfg.enableGlobalCompInit "autoload -U compinit && compinit"}
···184186185187 # Read system-wide modifications.
186188 if test -f /etc/zshrc.local; then
187187- . /etc/zshrc.local
189189+ . /etc/zshrc.local
188190 fi
189191 '';
190192
···11+<chapter xmlns="http://docbook.org/ns/docbook"
22+ xmlns:xlink="http://www.w3.org/1999/xlink"
33+ xmlns:xi="http://www.w3.org/2001/XInclude"
44+ version="5.0"
55+ xml:id="module-services-weechat">
66+77+<title>WeeChat</title>
88+<para><link xlink:href="https://weechat.org/">WeeChat</link> is a fast and extensible IRC client.</para>
99+1010+<section><title>Basic Usage</title>
1111+<para>
1212+By default, the module creates a
1313+<literal><link xlink:href="https://www.freedesktop.org/wiki/Software/systemd/">systemd</link></literal> unit
1414+which runs the chat client in a detached
1515+<literal><link xlink:href="https://www.gnu.org/software/screen/">screen</link></literal> session.
1616+1717+</para>
1818+1919+<para>
2020+This can be done by enabling the <literal>weechat</literal> service:
2121+2222+<programlisting>
2323+{ ... }:
2424+2525+{
2626+ <link linkend="opt-services.weechat.enable">services.weechat.enable</link> = true;
2727+}
2828+</programlisting>
2929+</para>
3030+<para>
3131+The service is managed by a dedicated user
3232+named <literal>weechat</literal> in the state directory
3333+<literal>/var/lib/weechat</literal>.
3434+</para>
3535+</section>
3636+<section><title>Re-attaching to WeeChat</title>
3737+<para>
3838+WeeChat runs in a screen session owned by a dedicated user. To explicitly
3939+allow your another user to attach to this session, the <literal>screenrc</literal> needs to be tweaked
4040+by adding <link xlink:href="https://www.gnu.org/software/screen/manual/html_node/Multiuser.html#Multiuser">multiuser</link> support:
4141+4242+<programlisting>
4343+{
4444+ <link linkend="opt-programs.screen.screenrc">programs.screen.screenrc</link> = ''
4545+ multiuser on
4646+ acladd normal_user
4747+ '';
4848+}
4949+</programlisting>
5050+5151+Now, the session can be re-attached like this:
5252+5353+<programlisting>
5454+screen -r weechat-screen
5555+</programlisting>
5656+</para>
5757+<para>
5858+<emphasis>The session name can be changed using <link linkend="opt-services.weechat.sessionName">services.weechat.sessionName.</link></emphasis>
5959+</para>
6060+</section>
6161+</chapter>
+1-1
nixos/modules/services/monitoring/grafana.nix
···235235 but without GF_ prefix
236236 '';
237237 default = {};
238238- type = types.attrsOf types.str;
238238+ type = with types; attrsOf (either str path);
239239 };
240240 };
241241
+18-4
nixos/modules/services/monitoring/riemann.nix
···17171818 launcher = writeScriptBin "riemann" ''
1919 #!/bin/sh
2020- exec ${jdk}/bin/java ${concatStringsSep "\n" cfg.extraJavaOpts} \
2020+ exec ${jdk}/bin/java ${concatStringsSep " " cfg.extraJavaOpts} \
2121 -cp ${classpath} \
2222- riemann.bin ${writeText "riemann-config.clj" riemannConfig}
2222+ riemann.bin ${cfg.configFile}
2323 '';
24242525in {
···3737 config = mkOption {
3838 type = types.lines;
3939 description = ''
4040- Contents of the Riemann configuration file.
4040+ Contents of the Riemann configuration file. For more complicated
4141+ config you should use configFile.
4142 '';
4243 };
4344 configFiles = mkOption {
···4748 Extra files containing Riemann configuration. These files will be
4849 loaded at runtime by Riemann (with Clojure's
4950 <literal>load-file</literal> function) at the end of the
5050- configuration.
5151+ configuration if you use the config option, this is ignored if you
5252+ use configFile.
5353+ '';
5454+ };
5555+ configFile = mkOption {
5656+ type = types.str;
5757+ description = ''
5858+ A Riemann config file. Any files in the same directory as this file
5959+ will be added to the classpath by Riemann.
5160 '';
5261 };
5362 extraClasspathEntries = mkOption {
···7786 group = "riemann";
7887 };
79888989+ services.riemann.configFile = mkDefault (
9090+ writeText "riemann-config.clj" riemannConfig
9191+ );
9292+8093 systemd.services.riemann = {
8194 wantedBy = [ "multi-user.target" ];
8295 path = [ inetutils ];
···8497 User = "riemann";
8598 ExecStart = "${launcher}/bin/riemann";
8699 };
100100+ serviceConfig.LimitNOFILE = 65536;
87101 };
8810289103 };
···11+#! @shell@ -e
22+33+# skip this if there are no modems at all
44+if ! stat -t "@spoolAreaPath@"/etc/config.* >/dev/null 2>&1
55+then
66+ exit 0
77+fi
88+99+echo "faxq started, waiting for modem(s) to initialize..."
1010+1111+for i in `seq @timeoutSec@0 -1 0` # gracefully timeout
1212+do
1313+ sleep 0.1
1414+ # done if status files exist, but don't mention initialization
1515+ if \
1616+ stat -t "@spoolAreaPath@"/status/* >/dev/null 2>&1 \
1717+ && \
1818+ ! grep --silent --ignore-case 'initializing server' \
1919+ "@spoolAreaPath@"/status/*
2020+ then
2121+ echo "modem(s) apparently ready"
2222+ exit 0
2323+ fi
2424+ # if i reached 0, modems probably failed to initialize
2525+ if test $i -eq 0
2626+ then
2727+ echo "warning: modem initialization timed out"
2828+ fi
2929+done
···11+{ config, lib, pkgs, ... }:
22+33+let
44+55+ inherit (lib.options) literalExample mkEnableOption mkOption;
66+ inherit (lib.types) bool enum int lines loaOf nullOr path str submodule;
77+ inherit (lib.modules) mkDefault mkIf mkMerge;
88+99+ commonDescr = ''
1010+ Values can be either strings or integers
1111+ (which will be added to the config file verbatimly)
1212+ or lists thereof
1313+ (which will be translated to multiple
1414+ lines with the same configuration key).
1515+ Boolean values are translated to "Yes" or "No".
1616+ The default contains some reasonable
1717+ configuration to yield an operational system.
1818+ '';
1919+2020+ str1 = lib.types.addCheck str (s: s!=""); # non-empty string
2121+ int1 = lib.types.addCheck int (i: i>0); # positive integer
2222+2323+ configAttrType =
2424+ # Options in HylaFAX configuration files can be
2525+ # booleans, strings, integers, or list thereof
2626+ # representing multiple config directives with the same key.
2727+ # This type definition resolves all
2828+ # those types into a list of strings.
2929+ let
3030+ inherit (lib.types) attrsOf coercedTo listOf;
3131+ innerType = coercedTo bool (x: if x then "Yes" else "No")
3232+ (coercedTo int (toString) str);
3333+ in
3434+ attrsOf (coercedTo innerType lib.singleton (listOf innerType));
3535+3636+ cfg = config.services.hylafax;
3737+3838+ modemConfigOptions = { name, config, ... }: {
3939+ options = {
4040+ name = mkOption {
4141+ type = str1;
4242+ example = "ttyS1";
4343+ description = ''
4444+ Name of modem device,
4545+ will be searched for in <filename>/dev</filename>.
4646+ '';
4747+ };
4848+ type = mkOption {
4949+ type = str1;
5050+ example = "cirrus";
5151+ description = ''
5252+ Name of modem configuration file,
5353+ will be searched for in <filename>config</filename>
5454+ in the spooling area directory.
5555+ '';
5656+ };
5757+ config = mkOption {
5858+ type = configAttrType;
5959+ example = {
6060+ AreaCode = "49";
6161+ LocalCode = "30";
6262+ FAXNumber = "123456";
6363+ LocalIdentifier = "LostInBerlin";
6464+ };
6565+ description = ''
6666+ Attribute set of values for the given modem.
6767+ ${commonDescr}
6868+ Options defined here override options in
6969+ <option>commonModemConfig</option> for this modem.
7070+ '';
7171+ };
7272+ };
7373+ config.name = mkDefault name;
7474+ config.config.Include = [ "config/${config.type}" ];
7575+ };
7676+7777+ defaultConfig =
7878+ let
7979+ inherit (config.security) wrapperDir;
8080+ inherit (config.services.mail.sendmailSetuidWrapper) program;
8181+ mkIfDefault = cond: value: mkIf cond (mkDefault value);
8282+ noWrapper = config.services.mail.sendmailSetuidWrapper==null;
8383+ # If a sendmail setuid wrapper exists,
8484+ # we add the path to the default configuration file.
8585+ # Otherwise, we use `false` to provoke
8686+ # an error if hylafax tries to use it.
8787+ c.sendmailPath = mkMerge [
8888+ (mkIfDefault noWrapper ''${pkgs.coreutils}/bin/false'')
8989+ (mkIfDefault (!noWrapper) ''${wrapperDir}/${program}'')
9090+ ];
9191+ importDefaultConfig = file:
9292+ lib.attrsets.mapAttrs
9393+ (lib.trivial.const mkDefault)
9494+ (import file { inherit pkgs; });
9595+ c.commonModemConfig = importDefaultConfig ./modem-default.nix;
9696+ c.faxqConfig = importDefaultConfig ./faxq-default.nix;
9797+ c.hfaxdConfig = importDefaultConfig ./hfaxd-default.nix;
9898+ in
9999+ c;
100100+101101+ localConfig =
102102+ let
103103+ c.hfaxdConfig.UserAccessFile = cfg.userAccessFile;
104104+ c.faxqConfig = lib.attrsets.mapAttrs
105105+ (lib.trivial.const (v: mkIf (v!=null) v))
106106+ {
107107+ AreaCode = cfg.areaCode;
108108+ CountryCode = cfg.countryCode;
109109+ LongDistancePrefix = cfg.longDistancePrefix;
110110+ InternationalPrefix = cfg.internationalPrefix;
111111+ };
112112+ c.commonModemConfig = c.faxqConfig;
113113+ in
114114+ c;
115115+116116+in
117117+118118+119119+{
120120+121121+122122+ options.services.hylafax = {
123123+124124+ enable = mkEnableOption ''HylaFAX server'';
125125+126126+ autostart = mkOption {
127127+ type = bool;
128128+ default = true;
129129+ example = false;
130130+ description = ''
131131+ Autostart the HylaFAX queue manager at system start.
132132+ If this is <literal>false</literal>, the queue manager
133133+ will still be started if there are pending
134134+ jobs or if a user tries to connect to it.
135135+ '';
136136+ };
137137+138138+ countryCode = mkOption {
139139+ type = nullOr str1;
140140+ default = null;
141141+ example = "49";
142142+ description = ''Country code for server and all modems.'';
143143+ };
144144+145145+ areaCode = mkOption {
146146+ type = nullOr str1;
147147+ default = null;
148148+ example = "30";
149149+ description = ''Area code for server and all modems.'';
150150+ };
151151+152152+ longDistancePrefix = mkOption {
153153+ type = nullOr str;
154154+ default = null;
155155+ example = "0";
156156+ description = ''Long distance prefix for server and all modems.'';
157157+ };
158158+159159+ internationalPrefix = mkOption {
160160+ type = nullOr str;
161161+ default = null;
162162+ example = "00";
163163+ description = ''International prefix for server and all modems.'';
164164+ };
165165+166166+ spoolAreaPath = mkOption {
167167+ type = path;
168168+ default = "/var/spool/fax";
169169+ description = ''
170170+ The spooling area will be created/maintained
171171+ at the location given here.
172172+ '';
173173+ };
174174+175175+ userAccessFile = mkOption {
176176+ type = path;
177177+ default = "/etc/hosts.hfaxd";
178178+ description = ''
179179+ The <filename>hosts.hfaxd</filename>
180180+ file entry in the spooling area
181181+ will be symlinked to the location given here.
182182+ This file must exist and be
183183+ readable only by the <literal>uucp</literal> user.
184184+ See hosts.hfaxd(5) for details.
185185+ This configuration permits access for all users:
186186+ <literal>
187187+ environment.etc."hosts.hfaxd" = {
188188+ mode = "0600";
189189+ user = "uucp";
190190+ text = ".*";
191191+ };
192192+ </literal>
193193+ Note that host-based access can be controlled with
194194+ <option>config.systemd.sockets.hylafax-hfaxd.listenStreams</option>;
195195+ by default, only 127.0.0.1 is permitted to connect.
196196+ '';
197197+ };
198198+199199+ sendmailPath = mkOption {
200200+ type = path;
201201+ example = literalExample "''${pkgs.postfix}/bin/sendmail";
202202+ # '' ; # fix vim
203203+ description = ''
204204+ Path to <filename>sendmail</filename> program.
205205+ The default uses the local sendmail wrapper
206206+ (see <option>config.services.mail.sendmailSetuidWrapper</option>),
207207+ otherwise the <filename>false</filename>
208208+ binary to cause an error if used.
209209+ '';
210210+ };
211211+212212+ hfaxdConfig = mkOption {
213213+ type = configAttrType;
214214+ example.RecvqProtection = "0400";
215215+ description = ''
216216+ Attribute set of lines for the global
217217+ hfaxd config file <filename>etc/hfaxd.conf</filename>.
218218+ ${commonDescr}
219219+ '';
220220+ };
221221+222222+ faxqConfig = mkOption {
223223+ type = configAttrType;
224224+ example = {
225225+ InternationalPrefix = "00";
226226+ LongDistancePrefix = "0";
227227+ };
228228+ description = ''
229229+ Attribute set of lines for the global
230230+ faxq config file <filename>etc/config</filename>.
231231+ ${commonDescr}
232232+ '';
233233+ };
234234+235235+ commonModemConfig = mkOption {
236236+ type = configAttrType;
237237+ example = {
238238+ InternationalPrefix = "00";
239239+ LongDistancePrefix = "0";
240240+ };
241241+ description = ''
242242+ Attribute set of default values for
243243+ modem config files <filename>etc/config.*</filename>.
244244+ ${commonDescr}
245245+ Think twice before changing
246246+ paths of fax-processing scripts.
247247+ '';
248248+ };
249249+250250+ modems = mkOption {
251251+ type = loaOf (submodule [ modemConfigOptions ]);
252252+ default = {};
253253+ example.ttyS1 = {
254254+ type = "cirrus";
255255+ config = {
256256+ FAXNumber = "123456";
257257+ LocalIdentifier = "Smith";
258258+ };
259259+ };
260260+ description = ''
261261+ Description of installed modems.
262262+ At least on modem must be defined
263263+ to enable the HylaFAX server.
264264+ '';
265265+ };
266266+267267+ spoolExtraInit = mkOption {
268268+ type = lines;
269269+ default = "";
270270+ example = ''chmod 0755 . # everyone may read my faxes'';
271271+ description = ''
272272+ Additional shell code that is executed within the
273273+ spooling area directory right after its setup.
274274+ '';
275275+ };
276276+277277+ faxcron.enable.spoolInit = mkEnableOption ''
278278+ Purge old files from the spooling area with
279279+ <filename>faxcron</filename>
280280+ each time the spooling area is initialized.
281281+ '';
282282+ faxcron.enable.frequency = mkOption {
283283+ type = nullOr str1;
284284+ default = null;
285285+ example = "daily";
286286+ description = ''
287287+ Purge old files from the spooling area with
288288+ <filename>faxcron</filename> with the given frequency
289289+ (see systemd.time(7)).
290290+ '';
291291+ };
292292+ faxcron.infoDays = mkOption {
293293+ type = int1;
294294+ default = 30;
295295+ description = ''
296296+ Set the expiration time for data in the
297297+ remote machine information directory in days.
298298+ '';
299299+ };
300300+ faxcron.logDays = mkOption {
301301+ type = int1;
302302+ default = 30;
303303+ description = ''
304304+ Set the expiration time for
305305+ session trace log files in days.
306306+ '';
307307+ };
308308+ faxcron.rcvDays = mkOption {
309309+ type = int1;
310310+ default = 7;
311311+ description = ''
312312+ Set the expiration time for files in
313313+ the received facsimile queue in days.
314314+ '';
315315+ };
316316+317317+ faxqclean.enable.spoolInit = mkEnableOption ''
318318+ Purge old files from the spooling area with
319319+ <filename>faxqclean</filename>
320320+ each time the spooling area is initialized.
321321+ '';
322322+ faxqclean.enable.frequency = mkOption {
323323+ type = nullOr str1;
324324+ default = null;
325325+ example = "daily";
326326+ description = ''
327327+ Purge old files from the spooling area with
328328+ <filename>faxcron</filename> with the given frequency
329329+ (see systemd.time(7)).
330330+ '';
331331+ };
332332+ faxqclean.archiving = mkOption {
333333+ type = enum [ "never" "as-flagged" "always" ];
334334+ default = "as-flagged";
335335+ example = "always";
336336+ description = ''
337337+ Enable or suppress job archiving:
338338+ <literal>never</literal> disables job archiving,
339339+ <literal>as-flagged</literal> archives jobs that
340340+ have been flagged for archiving by sendfax,
341341+ <literal>always</literal> forces archiving of all jobs.
342342+ See also sendfax(1) and faxqclean(8).
343343+ '';
344344+ };
345345+ faxqclean.doneqMinutes = mkOption {
346346+ type = int1;
347347+ default = 15;
348348+ example = literalExample ''24*60'';
349349+ description = ''
350350+ Set the job
351351+ age threshold (in minutes) that controls how long
352352+ jobs may reside in the doneq directory.
353353+ '';
354354+ };
355355+ faxqclean.docqMinutes = mkOption {
356356+ type = int1;
357357+ default = 60;
358358+ example = literalExample ''24*60'';
359359+ description = ''
360360+ Set the document
361361+ age threshold (in minutes) that controls how long
362362+ unreferenced files may reside in the docq directory.
363363+ '';
364364+ };
365365+366366+ };
367367+368368+369369+ config.services.hylafax =
370370+ mkIf
371371+ (config.services.hylafax.enable)
372372+ (mkMerge [ defaultConfig localConfig ])
373373+ ;
374374+375375+}
···11+#! @shell@ -e
22+33+# The following lines create/update the HylaFAX spool directory:
44+# Subdirectories/files with persistent data are kept,
55+# other directories/files are removed/recreated,
66+# mostly from the template spool
77+# directory in the HylaFAX package.
88+99+# This block explains how the spool area is
1010+# derived from the spool template in the HylaFAX package:
1111+#
1212+# + capital letter: directory; file otherwise
1313+# + P/p: persistent directory
1414+# + F/f: directory with symlinks per entry
1515+# + T/t: temporary data
1616+# + S/s: single symlink into package
1717+# |
1818+# | + u: change ownership to uucp:uucp
1919+# | + U: ..also change access mode to user-only
2020+# | |
2121+# archive P U
2222+# bin S
2323+# client T u (client connection info)
2424+# config S
2525+# COPYRIGHT s
2626+# dev T u (maybe some FIFOs)
2727+# docq P U
2828+# doneq P U
2929+# etc F contains customized config files!
3030+# etc/hosts.hfaxd f
3131+# etc/xferfaxlog f
3232+# info P u (database of called devices)
3333+# log P u (communication logs)
3434+# pollq P U
3535+# recvq P u
3636+# sendq P U
3737+# status T u (modem status info files)
3838+# tmp T U
3939+4040+4141+shopt -s dotglob # if bash sees "*", it also includes dot files
4242+lnsym () { ln --symbol "$@" ; }
4343+lnsymfrc () { ln --symbolic --force "$@" ; }
4444+cprd () { cp --remove-destination "$@" ; }
4545+update () { install --owner=@faxuser@ --group=@faxgroup@ "$@" ; }
4646+4747+4848+## create/update spooling area
4949+5050+update --mode=0750 -d "@spoolAreaPath@"
5151+cd "@spoolAreaPath@"
5252+5353+persist=(archive docq doneq info log pollq recvq sendq)
5454+5555+# remove entries that don't belong here
5656+touch dummy # ensure "*" resolves to something
5757+for k in *
5858+do
5959+ keep=0
6060+ for j in "${persist[@]}" xferfaxlog clientlog faxcron.lastrun
6161+ do
6262+ if test "$k" == "$j"
6363+ then
6464+ keep=1
6565+ break
6666+ fi
6767+ done
6868+ if test "$keep" == "0"
6969+ then
7070+ rm --recursive "$k"
7171+ fi
7272+done
7373+7474+# create persistent data directories (unless they exist already)
7575+update --mode=0700 -d "${persist[@]}"
7676+chmod 0755 info log recvq
7777+7878+# create ``xferfaxlog``, ``faxcron.lastrun``, ``clientlog``
7979+touch clientlog faxcron.lastrun xferfaxlog
8080+chown @faxuser@:@faxgroup@ clientlog faxcron.lastrun xferfaxlog
8181+8282+# create symlinks for frozen directories/files
8383+lnsym --target-directory=. "@hylafax@"/spool/{COPYRIGHT,bin,config}
8484+8585+# create empty temporary directories
8686+update --mode=0700 -d client dev status
8787+update -d tmp
8888+8989+9090+## create and fill etc
9191+9292+install -d "@spoolAreaPath@/etc"
9393+cd "@spoolAreaPath@/etc"
9494+9595+# create symlinks to all files in template's etc
9696+lnsym --target-directory=. "@hylafax@/spool/etc"/*
9797+9898+# set LOCKDIR in setup.cache
9999+sed --regexp-extended 's|^(UUCP_LOCKDIR=).*$|\1'"'@lockPath@'|g" --in-place setup.cache
100100+101101+# etc/{xferfaxlog,lastrun} are stored in the spool root
102102+lnsymfrc --target-directory=. ../xferfaxlog
103103+lnsymfrc --no-target-directory ../faxcron.lastrun lastrun
104104+105105+# etc/hosts.hfaxd is provided by the NixOS configuration
106106+lnsymfrc --no-target-directory "@userAccessFile@" hosts.hfaxd
107107+108108+# etc/config and etc/config.${DEVID} must be copied:
109109+# hfaxd reads these file after locking itself up in a chroot
110110+cprd --no-target-directory "@globalConfigPath@" config
111111+cprd --target-directory=. "@modemConfigPath@"/*
···341341 You should try to make this ID unique among your machines. You can
342342 generate a random 32-bit ID using the following commands:
343343344344- <literal>cksum /etc/machine-id | while read c rest; do printf "%x" $c; done</literal>
344344+ <literal>head -c 8 /etc/machine-id</literal>
345345346346 (this derives it from the machine-id that systemd generates) or
347347
···99 };
10101111 testScript = ''
1212- startAll;
1212+ $machine->waitForUnit("multi-user.target");
13131414+ # multi-user.target wants novacomd.service, but let's make sure
1415 $machine->waitForUnit("novacomd.service");
15161617 # Check status and try connecting with novacom
1718 $machine->succeed("systemctl status novacomd.service >&2");
1919+ # to prevent non-deterministic failure,
2020+ # make sure the daemon is really listening
2121+ $machine->waitForOpenPort(6968);
1822 $machine->succeed("novacom -l");
19232024 # Stop the daemon, double-check novacom fails if daemon isn't working
···23272428 # And back again for good measure
2529 $machine->startJob("novacomd");
3030+ # make sure the daemon is really listening
3131+ $machine->waitForOpenPort(6968);
2632 $machine->succeed("novacom -l");
2733 '';
2834})
+7-1
nixos/tests/opensmtpd.nix
···102102 testScript = ''
103103 startAll;
104104105105- $client->waitForUnit("network.target");
105105+ $client->waitForUnit("network-online.target");
106106 $smtp1->waitForUnit('opensmtpd');
107107 $smtp2->waitForUnit('opensmtpd');
108108 $smtp2->waitForUnit('dovecot2');
109109+110110+ # To prevent sporadic failures during daemon startup, make sure
111111+ # services are listening on their ports before sending requests
112112+ $smtp1->waitForOpenPort(25);
113113+ $smtp2->waitForOpenPort(25);
114114+ $smtp2->waitForOpenPort(143);
109115110116 $client->succeed('send-a-test-mail');
111117 $smtp1->waitUntilFails('smtpctl show queue | egrep .');
···30303131 /* for compatibility with passing extraPythonPackages as a list; added 2018-07-11 */
3232 compatFun = funOrList: (if builtins.isList funOrList then
3333- (_: builtins.trace "passing a list as extraPythonPackages to the neovim wrapper is deprecated, pass a function as to python.withPackages instead" funOrList)
3333+ (_: lib.warn "passing a list as extraPythonPackages to the neovim wrapper is deprecated, pass a function as to python.withPackages instead" funOrList)
3434 else funOrList);
3535 extraPythonPackagesFun = compatFun extraPythonPackages;
3636 extraPython3PackagesFun = compatFun extraPython3Packages;
···11-WGET_ARGS=( https://download.kde.org/stable/applications/18.08.0/ -A '*.tar.xz' )
11+WGET_ARGS=( https://download.kde.org/stable/applications/18.08.1/ -A '*.tar.xz' )
···2020 meta = with stdenv.lib; {
2121 description = "Terminal Mandelbrot fractal viewer";
2222 homepage = https://github.com/Tenchi2xh/Almonds;
2323- # No license has been specified
2424- license = licenses.unfree;
2323+ license = licenses.mit;
2524 maintainers = with maintainers; [ infinisil ];
2625 };
2726}
+21-12
pkgs/applications/science/math/mxnet/default.nix
···11-{ stdenv, lib, fetchgit, cmake
22-, opencv, gtest, openblas, liblapack
11+{ stdenv, lib, fetchurl, bash, cmake
22+, opencv, gtest, openblas, liblapack, perl
33, cudaSupport ? false, cudatoolkit, nvidia_x11
44, cudnnSupport ? false, cudnn
55}:
···8899stdenv.mkDerivation rec {
1010 name = "mxnet-${version}";
1111- version = "1.1.0";
1111+ version = "1.2.1";
12121313- # Submodules needed
1414- src = fetchgit {
1515- url = "https://github.com/apache/incubator-mxnet";
1616- rev = "refs/tags/${version}";
1717- sha256 = "1qgns0c70a1gfyil96h17ms736nwdkp9kv496gvs9pkzqzvr6cpz";
1313+ # Fetching from git does not work at the time (1.2.1) due to an
1414+ # incorrect hash in one of the submodules. The provided tarballs
1515+ # contain all necessary sources.
1616+ src = fetchurl {
1717+ url = "https://github.com/apache/incubator-mxnet/releases/download/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
1818+ sha256 = "053zbdgs4j8l79ipdz461zc7wyfbfcflmi5bw7lj2q08zm1glnb2";
1819 };
19202020- nativeBuildInputs = [ cmake ];
2121+ nativeBuildInputs = [ cmake perl ];
21222223 buildInputs = [ opencv gtest openblas liblapack ]
2324 ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
···3031 ] else [ "-DUSE_CUDA=OFF" ])
3132 ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
32333333- installPhase = ''
3434- install -Dm755 libmxnet.so $out/lib/libmxnet.so
3535- cp -r ../include $out
3434+ postPatch = ''
3535+ substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
3636+ --replace "/bin/bash" "${bash}/bin/bash"
3737+3838+ # Build against the system version of OpenMP.
3939+ # https://github.com/apache/incubator-mxnet/pull/12160
4040+ rm -rf 3rdparty/openmp
4141+ '';
4242+4343+ postInstall = ''
4444+ rm "$out"/lib/*.a
3645 '';
37463847 enableParallelBuilding = true;
+1
pkgs/applications/science/math/pynac/default.nix
···4141 of the full GiNaC, and it is *only* meant to be used as a Python library.
4242 '';
4343 homepage = http://pynac.org;
4444+ license = licenses.gpl3;
4445 maintainers = with maintainers; [ timokau ];
4546 platforms = platforms.linux;
4647 };
···11diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst
22-index 79b4205fd3..9a89bd2136 100644
22+index 2347a1190d..f5b0fe71a4 100644
33--- a/src/doc/en/faq/faq-usage.rst
44+++ b/src/doc/en/faq/faq-usage.rst
55@@ -338,7 +338,7 @@ ints. For example::
···174174 This creates a random 5x5 matrix ``A``, and solves `Ax=b` where
175175 ``b=[0.0,1.0,2.0,3.0,4.0]``. There are many other routines in the :mod:`numpy.linalg`
176176diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
177177-index df85cce43d..34ea164be0 100644
177177+index 60f37f7557..4ac3dedf1d 100644
178178--- a/src/sage/calculus/riemann.pyx
179179+++ b/src/sage/calculus/riemann.pyx
180180@@ -1191,30 +1191,30 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
···248248249249 TESTS::
250250diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
251251-index 61b1003002..4baee9cbbd 100644
251251+index 0a9bd61267..d2193cc2d6 100644
252252--- a/src/sage/combinat/fully_packed_loop.py
253253+++ b/src/sage/combinat/fully_packed_loop.py
254254@@ -72,11 +72,11 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
···269269 ['blue', 'blue', 'red', 'blue', 'red', 'red', 'red', 'blue']
270270 """
271271diff --git a/src/sage/finance/time_series.pyx b/src/sage/finance/time_series.pyx
272272-index c37700d14e..49b7298d0b 100644
272272+index 28779365df..3ab0282861 100644
273273--- a/src/sage/finance/time_series.pyx
274274+++ b/src/sage/finance/time_series.pyx
275275-@@ -109,8 +109,8 @@ cdef class TimeSeries:
275275+@@ -111,8 +111,8 @@ cdef class TimeSeries:
276276277277 sage: import numpy
278278 sage: v = numpy.array([[1,2], [3,4]], dtype=float); v
···283283 sage: finance.TimeSeries(v)
284284 [1.0000, 2.0000, 3.0000, 4.0000]
285285 sage: finance.TimeSeries(v[:,0])
286286-@@ -2098,14 +2098,14 @@ cdef class TimeSeries:
286286+@@ -2100,14 +2100,14 @@ cdef class TimeSeries:
287287288288 sage: w[0] = 20
289289 sage: w
···301301 sage: v
302302 [20.0000, -3.0000, 4.5000, -2.0000]
303303diff --git a/src/sage/functions/hyperbolic.py b/src/sage/functions/hyperbolic.py
304304-index 931a4b41e4..bf33fc483d 100644
304304+index aff552f450..7a6df931e7 100644
305305--- a/src/sage/functions/hyperbolic.py
306306+++ b/src/sage/functions/hyperbolic.py
307307@@ -214,7 +214,7 @@ class Function_coth(GinacFunction):
···341341 return arctanh(1.0 / x)
342342343343diff --git a/src/sage/functions/orthogonal_polys.py b/src/sage/functions/orthogonal_polys.py
344344-index 017c85a96f..33fbb499c5 100644
344344+index ed6365bef4..99b8b04dad 100644
345345--- a/src/sage/functions/orthogonal_polys.py
346346+++ b/src/sage/functions/orthogonal_polys.py
347347@@ -810,12 +810,12 @@ class Func_chebyshev_T(ChebyshevFunction):
···379379 array([ 0.2 , -0.96])
380380 """
381381diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py
382382-index 679384c907..d63b295a4c 100644
382382+index 1883daa3e6..9885222817 100644
383383--- a/src/sage/functions/other.py
384384+++ b/src/sage/functions/other.py
385385-@@ -390,7 +390,7 @@ class Function_ceil(BuiltinFunction):
385385+@@ -389,7 +389,7 @@ class Function_ceil(BuiltinFunction):
386386 sage: import numpy
387387 sage: a = numpy.linspace(0,2,6)
388388 sage: ceil(a)
···391391392392 Test pickling::
393393394394-@@ -539,7 +539,7 @@ class Function_floor(BuiltinFunction):
394394+@@ -553,7 +553,7 @@ class Function_floor(BuiltinFunction):
395395 sage: import numpy
396396 sage: a = numpy.linspace(0,2,6)
397397 sage: floor(a)
···400400 sage: floor(x)._sympy_()
401401 floor(x)
402402403403-@@ -840,7 +840,7 @@ def sqrt(x, *args, **kwds):
403403+@@ -869,7 +869,7 @@ def sqrt(x, *args, **kwds):
404404 sage: import numpy
405405 sage: a = numpy.arange(2,5)
406406 sage: sqrt(a)
···409409 """
410410 if isinstance(x, float):
411411 return math.sqrt(x)
412412+diff --git a/src/sage/functions/spike_function.py b/src/sage/functions/spike_function.py
413413+index 1e021de3fe..56635ca98f 100644
414414+--- a/src/sage/functions/spike_function.py
415415++++ b/src/sage/functions/spike_function.py
416416+@@ -157,7 +157,7 @@ class SpikeFunction:
417417+ sage: S = spike_function([(-3,4),(-1,1),(2,3)]); S
418418+ A spike function with spikes at [-3.0, -1.0, 2.0]
419419+ sage: P = S.plot_fft_abs(8)
420420+- sage: p = P[0]; p.ydata
421421++ sage: p = P[0]; p.ydata # abs tol 1e-8
422422+ [5.0, 5.0, 3.367958691924177, 3.367958691924177, 4.123105625617661, 4.123105625617661, 4.759921664218055, 4.759921664218055]
423423+ """
424424+ w = self.vector(samples = samples, xmin=xmin, xmax=xmax)
425425+@@ -176,8 +176,8 @@ class SpikeFunction:
426426+ sage: S = spike_function([(-3,4),(-1,1),(2,3)]); S
427427+ A spike function with spikes at [-3.0, -1.0, 2.0]
428428+ sage: P = S.plot_fft_arg(8)
429429+- sage: p = P[0]; p.ydata
430430+- [0.0, 0.0, -0.211524990023434..., -0.211524990023434..., 0.244978663126864..., 0.244978663126864..., -0.149106180027477..., -0.149106180027477...]
431431++ sage: p = P[0]; p.ydata # abs tol 1e-8
432432++ [0.0, 0.0, -0.211524990023434, -0.211524990023434, 0.244978663126864, 0.244978663126864, -0.149106180027477, -0.149106180027477]
433433+ """
434434+ w = self.vector(samples = samples, xmin=xmin, xmax=xmax)
435435+ xmin, xmax = self._ranges(xmin, xmax)
412436diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py
413413-index e7e7a311cd..e7ff78a9de 100644
437437+index 501e7ff6b6..5f760912f0 100644
414438--- a/src/sage/functions/trig.py
415439+++ b/src/sage/functions/trig.py
416416-@@ -731,7 +731,7 @@ class Function_arccot(GinacFunction):
440440+@@ -724,7 +724,7 @@ class Function_arccot(GinacFunction):
417441 sage: import numpy
418442 sage: a = numpy.arange(2, 5)
419443 sage: arccot(a)
···422446 """
423447 return math.pi/2 - arctan(x)
424448425425-@@ -787,7 +787,7 @@ class Function_arccsc(GinacFunction):
449449+@@ -780,7 +780,7 @@ class Function_arccsc(GinacFunction):
426450 sage: import numpy
427451 sage: a = numpy.arange(2, 5)
428452 sage: arccsc(a)
···431455 """
432456 return arcsin(1.0/x)
433457434434-@@ -845,7 +845,7 @@ class Function_arcsec(GinacFunction):
458458+@@ -838,7 +838,7 @@ class Function_arcsec(GinacFunction):
435459 sage: import numpy
436460 sage: a = numpy.arange(2, 5)
437461 sage: arcsec(a)
···440464 """
441465 return arccos(1.0/x)
442466443443-@@ -920,13 +920,13 @@ class Function_arctan2(GinacFunction):
467467+@@ -913,13 +913,13 @@ class Function_arctan2(GinacFunction):
444468 sage: a = numpy.linspace(1, 3, 3)
445469 sage: b = numpy.linspace(3, 6, 3)
446470 sage: atan2(a, b)
···458482 TESTS::
459483460484diff --git a/src/sage/matrix/constructor.pyx b/src/sage/matrix/constructor.pyx
461461-index 19a1d37df0..5780dfae1c 100644
485485+index 12136f1773..491bf22e62 100644
462486--- a/src/sage/matrix/constructor.pyx
463487+++ b/src/sage/matrix/constructor.pyx
464464-@@ -494,8 +494,8 @@ class MatrixFactory(object):
488488+@@ -503,8 +503,8 @@ def matrix(*args, **kwds):
465489 [7 8 9]
466490 Full MatrixSpace of 3 by 3 dense matrices over Integer Ring
467491 sage: n = matrix(QQ, 2, 2, [1, 1/2, 1/3, 1/4]).numpy(); n
···473497 [ 1 1/2]
474498 [1/3 1/4]
475499diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx
476476-index 48e0a8a97f..1be5d35b19 100644
500500+index 66e54a79a4..0498334f4b 100644
477501--- a/src/sage/matrix/matrix_double_dense.pyx
478502+++ b/src/sage/matrix/matrix_double_dense.pyx
479479-@@ -2546,7 +2546,7 @@ cdef class Matrix_double_dense(Matrix_dense):
503503+@@ -606,6 +606,9 @@ cdef class Matrix_double_dense(Matrix_dense):
504504+ [ 3.0 + 9.0*I 4.0 + 16.0*I 5.0 + 25.0*I]
505505+ [6.0 + 36.0*I 7.0 + 49.0*I 8.0 + 64.0*I]
506506+ sage: B.condition()
507507++ doctest:warning
508508++ ...
509509++ ComplexWarning: Casting complex values to real discards the imaginary part
510510+ 203.851798...
511511+ sage: B.condition(p='frob')
512512+ 203.851798...
513513+@@ -654,9 +657,7 @@ cdef class Matrix_double_dense(Matrix_dense):
514514+ True
515515+ sage: B = A.change_ring(CDF)
516516+ sage: B.condition()
517517+- Traceback (most recent call last):
518518+- ...
519519+- LinAlgError: Singular matrix
520520++ +Infinity
521521+522522+ Improper values of ``p`` are caught. ::
523523+524524+@@ -2519,7 +2520,7 @@ cdef class Matrix_double_dense(Matrix_dense):
480525 sage: P.is_unitary(algorithm='orthonormal')
481526 Traceback (most recent call last):
482527 ...
···485530486531 TESTS::
487532488488-@@ -3662,8 +3662,8 @@ cdef class Matrix_double_dense(Matrix_dense):
533533+@@ -3635,8 +3636,8 @@ cdef class Matrix_double_dense(Matrix_dense):
489534 [0.0 1.0 2.0]
490535 [3.0 4.0 5.0]
491536 sage: m.numpy()
···496541497542 Alternatively, numpy automatically calls this function (via
498543 the magic :meth:`__array__` method) to convert Sage matrices
499499-@@ -3674,16 +3674,16 @@ cdef class Matrix_double_dense(Matrix_dense):
544544+@@ -3647,16 +3648,16 @@ cdef class Matrix_double_dense(Matrix_dense):
500545 [0.0 1.0 2.0]
501546 [3.0 4.0 5.0]
502547 sage: numpy.array(m)
···518563 dtype('complex128')
519564520565diff --git a/src/sage/matrix/special.py b/src/sage/matrix/special.py
521521-index c698ba5e97..b743bab354 100644
566566+index ccbd208810..c3f9a65093 100644
522567--- a/src/sage/matrix/special.py
523568+++ b/src/sage/matrix/special.py
524524-@@ -705,7 +705,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
569569+@@ -706,7 +706,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
525570526571 sage: import numpy
527572 sage: entries = numpy.array([1.2, 5.6]); entries
···530575 sage: A = diagonal_matrix(3, entries); A
531576 [1.2 0.0 0.0]
532577 [0.0 5.6 0.0]
533533-@@ -715,7 +715,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
578578+@@ -716,7 +716,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
534579535580 sage: j = numpy.complex(0,1)
536581 sage: entries = numpy.array([2.0+j, 8.1, 3.4+2.6*j]); entries
···540585 [2.0 + 1.0*I 0.0 0.0]
541586 [ 0.0 8.1 0.0]
542587diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
543543-index 230f142117..2ab1c0ae68 100644
588588+index 37d92c1282..955d083b34 100644
544589--- a/src/sage/modules/free_module_element.pyx
545590+++ b/src/sage/modules/free_module_element.pyx
546546-@@ -982,7 +982,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
591591+@@ -988,7 +988,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
547592 sage: v.numpy()
548593 array([1, 2, 5/6], dtype=object)
549594 sage: v.numpy(dtype=float)
···552597 sage: v.numpy(dtype=int)
553598 array([1, 2, 0])
554599 sage: import numpy
555555-@@ -993,7 +993,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
600600+@@ -999,7 +999,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
556601 be more efficient but may have unintended consequences::
557602558603 sage: v.numpy(dtype=None)
···596641 """
597642 if dtype is None or dtype is self._vector_numpy.dtype:
598643 from copy import copy
599599-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
600600-index 17b5ebb84b..92ce35c502 100644
601601---- a/src/sage/numerical/optimize.py
602602-+++ b/src/sage/numerical/optimize.py
603603-@@ -486,9 +486,9 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
604604- else:
605605- min = optimize.fmin_tnc(f, x0, approx_grad=True, bounds=cons, messages=0, **args)[0]
606606- elif isinstance(cons[0], function_type) or isinstance(cons[0], Expression):
607607-- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args)
608608-+ min = optimize.fmin_cobyla(f, x0, cons, disp=0, **args)
609609- elif isinstance(cons, function_type) or isinstance(cons, Expression):
610610-- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args)
611611-+ min = optimize.fmin_cobyla(f, x0, cons, disp=0, **args)
612612- return vector(RDF, min)
613613-614614-615644diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
616645index ad9693da62..758fb709b7 100644
617646--- a/src/sage/plot/complex_plot.pyx
···649678 """
650679 import numpy
651680 cdef unsigned int i, j, imax, jmax
681681+diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
682682+index 5d28473731..fc4b2046c0 100644
683683+--- a/src/sage/plot/histogram.py
684684++++ b/src/sage/plot/histogram.py
685685+@@ -53,10 +53,17 @@ class Histogram(GraphicPrimitive):
686686+ """
687687+ import numpy as np
688688+ self.datalist=np.asarray(datalist,dtype=float)
689689++ if 'normed' in options:
690690++ from sage.misc.superseded import deprecation
691691++ deprecation(25260, "the 'normed' option is deprecated. Use 'density' instead.")
692692+ if 'linestyle' in options:
693693+ from sage.plot.misc import get_matplotlib_linestyle
694694+ options['linestyle'] = get_matplotlib_linestyle(
695695+ options['linestyle'], return_type='long')
696696++ if options.get('range', None):
697697++ # numpy.histogram performs type checks on "range" so this must be
698698++ # actual floats
699699++ options['range'] = [float(x) for x in options['range']]
700700+ GraphicPrimitive.__init__(self, options)
701701+702702+ def get_minmax_data(self):
703703+@@ -80,10 +87,14 @@ class Histogram(GraphicPrimitive):
704704+ {'xmax': 4.0, 'xmin': 0, 'ymax': 2, 'ymin': 0}
705705+706706+ TESTS::
707707+-
708708+ sage: h = histogram([10,3,5], normed=True)[0]
709709+- sage: h.get_minmax_data() # rel tol 1e-15
710710+- {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.4761904761904765, 'ymin': 0}
711711++ doctest:warning...:
712712++ DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
713713++ See https://trac.sagemath.org/25260 for details.
714714++ sage: h.get_minmax_data()
715715++ doctest:warning ...:
716716++ VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
717717++ {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
718718+ """
719719+ import numpy
720720+721721+@@ -152,7 +163,7 @@ class Histogram(GraphicPrimitive):
722722+ 'rwidth': 'The relative width of the bars as a fraction of the bin width',
723723+ 'cumulative': '(True or False) If True, then a histogram is computed in which each bin gives the counts in that bin plus all bins for smaller values. Negative values give a reversed direction of accumulation.',
724724+ 'range': 'A list [min, max] which define the range of the histogram. Values outside of this range are treated as outliers and omitted from counts.',
725725+- 'normed': 'Deprecated alias for density',
726726++ 'normed': 'Deprecated. Use density instead.',
727727+ 'density': '(True or False) If True, the counts are normalized to form a probability density. (n/(len(x)*dbin)',
728728+ 'weights': 'A sequence of weights the same length as the data list. If supplied, then each value contributes its associated weight to the bin count.',
729729+ 'stacked': '(True or False) If True, multiple data are stacked on top of each other.',
730730+@@ -199,7 +210,7 @@ class Histogram(GraphicPrimitive):
731731+ subplot.hist(self.datalist.transpose(), **options)
732732+733733+734734+-@options(aspect_ratio='automatic',align='mid', weights=None, range=None, bins=10, edgecolor='black')
735735++@options(aspect_ratio='automatic', align='mid', weights=None, range=None, bins=10, edgecolor='black')
736736+ def histogram(datalist, **options):
737737+ """
738738+ Computes and draws the histogram for list(s) of numerical data.
739739+@@ -231,8 +242,9 @@ def histogram(datalist, **options):
740740+ - ``linewidth`` -- (float) width of the lines defining the bars
741741+ - ``linestyle`` -- (default: 'solid') Style of the line. One of 'solid'
742742+ or '-', 'dashed' or '--', 'dotted' or ':', 'dashdot' or '-.'
743743+- - ``density`` -- (boolean - default: False) If True, the counts are
744744+- normalized to form a probability density.
745745++ - ``density`` -- (boolean - default: False) If True, the result is the
746746++ value of the probability density function at the bin, normalized such
747747++ that the integral over the range is 1.
748748+ - ``range`` -- A list [min, max] which define the range of the
749749+ histogram. Values outside of this range are treated as outliers and
750750+ omitted from counts
652751diff --git a/src/sage/plot/line.py b/src/sage/plot/line.py
653752index 23f5e61446..3b1b51d7cf 100644
654753--- a/src/sage/plot/line.py
···718817 TESTS:
719818720819diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
721721-index f66cd898b9..35995886d5 100644
820820+index 1b119e323f..3290b00695 100644
722821--- a/src/sage/probability/probability_distribution.pyx
723822+++ b/src/sage/probability/probability_distribution.pyx
724823@@ -130,7 +130,17 @@ cdef class ProbabilityDistribution:
···741840 import pylab
742841 l = [float(self.get_random_element()) for _ in range(num_samples)]
743842diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx
744744-index a0bfe080f5..7d95e7a1a8 100644
843843+index 12ca1b222b..9bad7dae0c 100644
745844--- a/src/sage/rings/rational.pyx
746845+++ b/src/sage/rings/rational.pyx
747747-@@ -1056,7 +1056,7 @@ cdef class Rational(sage.structure.element.FieldElement):
846846+@@ -1041,7 +1041,7 @@ cdef class Rational(sage.structure.element.FieldElement):
748847 dtype('O')
749848750849 sage: numpy.array([1, 1/2, 3/4])
···754853 if mpz_cmp_ui(mpq_denref(self.value), 1) == 0:
755854 if mpz_fits_slong_p(mpq_numref(self.value)):
756855diff --git a/src/sage/rings/real_mpfr.pyx b/src/sage/rings/real_mpfr.pyx
757757-index 4c630867a4..64e2187f5b 100644
856856+index 9b90c8833e..1ce05b937d 100644
758857--- a/src/sage/rings/real_mpfr.pyx
759858+++ b/src/sage/rings/real_mpfr.pyx
760760-@@ -1438,7 +1438,7 @@ cdef class RealNumber(sage.structure.element.RingElement):
859859+@@ -1439,7 +1439,7 @@ cdef class RealNumber(sage.structure.element.RingElement):
761860762861 sage: import numpy
763862 sage: numpy.arange(10.0)
···767866 dtype('float64')
768867 sage: numpy.array([1.000000000000000000000000000000000000]).dtype
769868diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py
770770-index 3d270ebf9d..1144f168e3 100644
869869+index de31fe9883..7a33ea6f5b 100644
771870--- a/src/sage/schemes/elliptic_curves/height.py
772871+++ b/src/sage/schemes/elliptic_curves/height.py
773773-@@ -1623,18 +1623,18 @@ class EllipticCurveCanonicalHeight:
872872+@@ -1627,18 +1627,18 @@ class EllipticCurveCanonicalHeight:
774873 even::
775874776875 sage: H.wp_on_grid(v,4)
···798897 tau = self.tau(v)
799898 fk, err = self.fk_intervals(v, 15, CDF)
800899diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
801801-index 2dcb0492b9..2b1a06385c 100644
900900+index 9da38002e8..d61e74bf82 100644
802901--- a/src/sage/symbolic/ring.pyx
803902+++ b/src/sage/symbolic/ring.pyx
804804-@@ -1135,7 +1135,7 @@ cdef class NumpyToSRMorphism(Morphism):
903903+@@ -1136,7 +1136,7 @@ cdef class NumpyToSRMorphism(Morphism):
805904 sage: cos(numpy.int('2'))
806905 cos(2)
807906 sage: numpy.cos(numpy.int('2'))
+3-3
pkgs/applications/science/math/sage/sage-env.nix
···3737, lcalc
3838, rubiks
3939, flintqs
4040-, openblasCompat
4040+, openblas-cblas-pc
4141, flint
4242, gmp
4343, mpfr
···9898 export PKG_CONFIG_PATH='${lib.concatStringsSep ":" (map (pkg: "${pkg}/lib/pkgconfig") [
9999 # This is only needed in the src/sage/misc/cython.py test and I'm not sure if there's really a use-case
100100 # for it outside of the tests. However since singular and openblas are runtime dependencies anyways
101101- # it doesn't really hurt to include.
101101+ # and openblas-cblas-pc is tiny, it doesn't really hurt to include.
102102 singular
103103- openblasCompat
103103+ openblas-cblas-pc
104104 ])
105105 }'
106106 export SAGE_ROOT='${sage-src}'
···4455let
66 # if you bump version, update pkgs.tortoisehg too or ping maintainer
77- version = "4.7";
77+ version = "4.7.1";
88 name = "mercurial-${version}";
99 inherit (python2Packages) docutils hg-git dulwich python;
1010in python2Packages.buildPythonApplication {
···13131414 src = fetchurl {
1515 url = "https://mercurial-scm.org/release/${name}.tar.gz";
1616- sha256 = "17rl1lyvr3qa5x73xyiwnv09wwiwjd18f01gvispzyvpgx1v3309";
1616+ sha256 = "03217dk8jh2ckrqqhqyahw44f5j2aq3kv03ba5v2b11i3hy3h0w5";
1717 };
18181919 inherit python; # pass it so that the same version can be used in hg2git
···11+{ stdenv, fetchurl, writeScript, file }:
22+let lib = stdenv.lib;
33+in {
44+ # : string
55+ pname
66+ # : string
77+, version
88+ # : string
99+, sha256
1010+ # : string
1111+, description
1212+ # : list Platform
1313+, platforms ? lib.platforms.all
1414+ # : list string
1515+, outputs ? [ "bin" "lib" "dev" "doc" "out" ]
1616+ # TODO(Profpatsch): automatically infer most of these
1717+ # : list string
1818+, configureFlags
1919+ # mostly for moving and deleting files from the build directory
2020+ # : lines
2121+, postInstall
2222+ # : list Maintainer
2323+, maintainers ? []
2424+2525+2626+}:
2727+2828+let
2929+3030+ # File globs that can always be deleted
3131+ commonNoiseFiles = [
3232+ ".gitignore"
3333+ "Makefile"
3434+ "INSTALL"
3535+ "configure"
3636+ "patch-for-solaris"
3737+ "src/**/*"
3838+ "tools/**/*"
3939+ "package/**/*"
4040+ "config.mak"
4141+ ];
4242+4343+ # File globs that should be moved to $doc
4444+ commonMetaFiles = [
4545+ "COPYING"
4646+ "AUTHORS"
4747+ "NEWS"
4848+ "CHANGELOG"
4949+ "README"
5050+ "README.*"
5151+ ];
5252+5353+ globWith = stdenv.lib.concatMapStringsSep "\n";
5454+ rmNoise = globWith (f:
5555+ ''rm -rf ${f}'') commonNoiseFiles;
5656+ mvMeta = globWith
5757+ (f: ''mv ${f} "$DOCDIR" 2>/dev/null || true'')
5858+ commonMetaFiles;
5959+6060+ # Move & remove actions, taking the package doc directory
6161+ commonFileActions = writeScript "common-file-actions.sh" ''
6262+ #!${stdenv.shell}
6363+ set -e
6464+ DOCDIR="$1"
6565+ shopt -s globstar extglob nullglob
6666+ ${rmNoise}
6767+ mkdir -p "$DOCDIR"
6868+ ${mvMeta}
6969+ '';
7070+7171+7272+in stdenv.mkDerivation {
7373+ name = "${pname}-${version}";
7474+7575+ src = fetchurl {
7676+ url = "https://skarnet.org/software/${pname}/${pname}-${version}.tar.gz";
7777+ inherit sha256;
7878+ };
7979+8080+ inherit outputs;
8181+8282+ dontDisableStatic = true;
8383+ enableParallelBuilding = true;
8484+8585+ configureFlags = configureFlags ++ [
8686+ "--enable-absolute-paths"
8787+ (if stdenv.isDarwin
8888+ then "--disable-shared"
8989+ else "--enable-shared")
9090+ ]
9191+ # On darwin, the target triplet from -dumpmachine includes version number,
9292+ # but skarnet.org software uses the triplet to test binary compatibility.
9393+ # Explicitly setting target ensures code can be compiled against a skalibs
9494+ # binary built on a different version of darwin.
9595+ # http://www.skarnet.org/cgi-bin/archive.cgi?1:mss:623:heiodchokfjdkonfhdph
9696+ ++ (lib.optional stdenv.isDarwin
9797+ "--build=${stdenv.hostPlatform.system}");
9898+9999+ # TODO(Profpatsch): ensure that there is always a $doc output!
100100+ postInstall = ''
101101+ echo "Cleaning & moving common files"
102102+ mkdir -p $doc/share/doc/${pname}
103103+ ${commonFileActions} $doc/share/doc/${pname}
104104+105105+ ${postInstall}
106106+ '';
107107+108108+ postFixup = ''
109109+ echo "Checking for remaining source files"
110110+ rem=$(find -mindepth 1 -xtype f -print0 \
111111+ | tee $TMP/remaining-files)
112112+ if [[ "$rem" != "" ]]; then
113113+ echo "ERROR: These files should be either moved or deleted:"
114114+ cat $TMP/remaining-files | xargs -0 ${file}/bin/file
115115+ exit 1
116116+ fi
117117+ '';
118118+119119+ meta = {
120120+ homepage = "https://skarnet.org/software/${pname}/";
121121+ inherit description platforms;
122122+ license = stdenv.lib.licenses.isc;
123123+ maintainers = with lib.maintainers;
124124+ [ pmahoney Profpatsch ] ++ maintainers;
125125+ };
126126+127127+}
+22
pkgs/data/fonts/et-book/default.nix
···11+{ stdenv, fetchFromGitHub }:
22+33+fetchFromGitHub rec {
44+ rev = "7e8f02dadcc23ba42b491b39e5bdf16e7b383031";
55+ name = "et-book-${builtins.substring 0 6 rev}";
66+ owner = "edwardtufte";
77+ repo = "et-book";
88+ sha256 = "1bfb1l8k7fzgk2l8cikiyfn5x9m0fiwrnsbc1483p8w3qp58s5n2";
99+1010+ postFetch = ''
1111+ tar -xzf $downloadedFile
1212+ mkdir -p $out/share/fonts/truetype
1313+ cp -t $out/share/fonts/truetype et-book-${rev}/source/4-ttf/*.ttf
1414+ '';
1515+1616+ meta = with stdenv.lib; {
1717+ description = "The typeface used in Edward Tufte’s books.";
1818+ license = licenses.mit;
1919+ platforms = platforms.all;
2020+ maintainers = with maintainers; [ jethro ];
2121+ };
2222+}
+1-1
pkgs/data/fonts/medio/default.nix
···1818 '';
19192020 meta = with stdenv.lib; {
2121- homepage = "http://dotcolon.net/font/{pname}/";
2121+ homepage = "http://dotcolon.net/font/${pname}/";
2222 description = "Serif font designed by Sora Sagano";
2323 longDescription = ''
2424 Medio is a serif font designed by Sora Sagano, based roughly
···1818 '';
19192020 meta = with stdenv.lib; {
2121- homepage = "http://dotcolon.net/font/{pname}/";
2121+ homepage = "http://dotcolon.net/font/${pname}/";
2222 description = "Geometric sans serif designed by Sora Sagano";
2323 longDescription = ''
2424 Penna is a geometric sans serif designed by Sora Sagano,
+1-1
pkgs/data/fonts/route159/default.nix
···1818 '';
19192020 meta = with stdenv.lib; {
2121- homepage = "http://dotcolon.net/font/{pname}/";
2121+ homepage = "http://dotcolon.net/font/${pname}/";
2222 description = "A weighted sans serif font";
2323 platforms = platforms.all;
2424 maintainers = with maintainers; [ leenaars ];
+1-1
pkgs/data/fonts/seshat/default.nix
···1818 '';
19192020 meta = with stdenv.lib; {
2121- homepage = "http://dotcolon.net/font/{pname}/";
2121+ homepage = "http://dotcolon.net/font/${pname}/";
2222 description = "Roman body font designed for main text by Sora Sagano";
2323 longDescription = ''
2424 Seshat is a Roman body font designed for the main text. By
···11-WGET_ARGS=( https://download.kde.org/stable/plasma/5.13.4/ -A '*.tar.xz' )
11+WGET_ARGS=( https://download.kde.org/stable/plasma/5.13.5/ -A '*.tar.xz' )
···34343535 configureFlags = stdenv.lib.optional (!emacsSupport) "--without-emacs";
36363737+ hardeningDisable = [ "format" ];
3838+3739 installFlags = stdenv.lib.optional emacsSupport "lispdir=$(out)/share/emacs/site-lisp";
38403941 # For some reason the tests fail if executated with nix-build, but pass if
+1-1
pkgs/development/compilers/go/1.11.nix
···139139 else if stdenv.targetPlatform.isAarch32 then "arm"
140140 else if stdenv.targetPlatform.isAarch64 then "arm64"
141141 else throw "Unsupported system";
142142- GOARM = stdenv.targetPlatform.parsed.cpu.version or "";
142142+ GOARM = toString (stdenv.lib.intersectLists [(stdenv.targetPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
143143 GO386 = 387; # from Arch: don't assume sse2 on i686
144144 CGO_ENABLED = 1;
145145 GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
+1-1
pkgs/development/compilers/julia/shared.nix
···211211 description = "High-level performance-oriented dynamical language for technical computing";
212212 homepage = https://julialang.org/;
213213 license = stdenv.lib.licenses.mit;
214214- maintainers = with stdenv.lib.maintainers; [ raskin rob ];
214214+ maintainers = with stdenv.lib.maintainers; [ raskin rob garrison ];
215215 platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
216216 broken = stdenv.isi686;
217217 };
···3636 '';
37373838 meta = with stdenv.lib; {
3939- homepage = git://github.com/jwiegley/category-theory.git;
3939+ homepage = https://github.com/jwiegley/category-theory;
4040 description = "A formalization of category theory in Coq for personal study and practical work";
4141 maintainers = with maintainers; [ jwiegley ];
4242 platforms = coq.meta.platforms;
···3939 # These are now core libraries in GHC 8.4.x.
4040 mtl = self.mtl_2_2_2;
4141 parsec = self.parsec_3_1_13_0;
4242- stm = self.stm_2_4_5_0;
4242+ stm = self.stm_2_4_5_1;
4343 text = self.text_1_2_3_0;
44444545 # Make sure we can still build Cabal 1.x.