Merge branch 'master' into staging

This apparently fixes some broken src fetches (gnuradio, twisted).
This commit is contained in:
Vladimír Čunát 2018-07-02 11:07:38 +02:00
commit c1ffc65d1a
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
197 changed files with 7027 additions and 2265 deletions

View File

@ -328,7 +328,7 @@ when building the bindings and are therefore added as `buildInputs`.
meta = {
description = "Pythonic binding for the libxml2 and libxslt libraries";
homepage = http://lxml.de;
homepage = https://lxml.de;
license = licenses.bsd3;
maintainers = with maintainers; [ sjourdois ];
};

57
lib/kernel.nix Normal file
View File

@ -0,0 +1,57 @@
{ lib
# we pass the kernel version here to keep a nice syntax `whenOlder "4.13"`
# kernelVersion, e.g., config.boot.kernelPackages.version
, version
, mkValuePreprocess ? null
}:
with lib;
rec {
# Common patterns
when = cond: opt: if cond then opt else null;
whenAtLeast = ver: when (versionAtLeast version ver);
whenOlder = ver: when (versionOlder version ver);
whenBetween = verLow: verHigh: when (versionAtLeast version verLow && versionOlder version verHigh);
# Keeping these around in case we decide to change this horrible implementation :)
option = x: if x == null then null else "?${x}";
yes = "y";
no = "n";
module = "m";
mkValue = val:
let
isNumber = c: elem c ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"];
in
if val == "" then "\"\""
else if val == yes || val == module || val == no then val
else if all isNumber (stringToCharacters val) then val
else if substring 0 2 val == "0x" then val
else val; # FIXME: fix quoting one day
# generate nix intermediate kernel config file of the form
#
# VIRTIO_MMIO m
# VIRTIO_BLK y
# VIRTIO_CONSOLE n
# NET_9P_VIRTIO? y
#
# Use mkValuePreprocess to preprocess option values, aka mark 'modules' as
# 'yes' or vice-versa
# Borrowed from copumpkin https://github.com/NixOS/nixpkgs/pull/12158
# returns a string, expr should be an attribute set
generateNixKConf = exprs: mkValuePreprocess:
let
mkConfigLine = key: rawval:
let
val = if builtins.isFunction mkValuePreprocess then mkValuePreprocess rawval else rawval;
in
if val == null
then ""
else if hasPrefix "?" val
then "${key}? ${mkValue (removePrefix "?" val)}\n"
else "${key} ${mkValue val}\n";
mkConf = cfg: concatStrings (mapAttrsToList mkConfigLine cfg);
in mkConf exprs;
}

View File

@ -27,7 +27,7 @@
<screen>
# nixos-container create foo --config '
<xref linkend="opt-services.openssh.enable"/> = true;
<link linkend="opt-users.users._name__.openssh.authorizedKeys.keys">users.extraUsers.root.openssh.authorizedKeys.keys</link> = ["ssh-dss AAAAB3N…"];
<link linkend="opt-users.users._name__.openssh.authorizedKeys.keys">users.users.root.openssh.authorizedKeys.keys</link> = ["ssh-dss AAAAB3N…"];
'
</screen>
</para>

View File

@ -19,7 +19,7 @@
All users that should have permission to change network settings must belong
to the <code>networkmanager</code> group:
<programlisting>
<link linkend="opt-users.users._name__.extraGroups">users.extraUsers.youruser.extraGroups</link> = [ "networkmanager" ];
<link linkend="opt-users.users._name__.extraGroups">users.users.alice.extraGroups</link> = [ "networkmanager" ];
</programlisting>
</para>

View File

@ -20,7 +20,7 @@
follows:
<!-- FIXME: this might not work if the user is unmanaged. -->
<programlisting>
<link linkend="opt-users.users._name__.openssh.authorizedKeys.keys">users.extraUsers.alice.openssh.authorizedKeys.keys</link> =
<link linkend="opt-users.users._name__.openssh.authorizedKeys.keys">users.users.alice.openssh.authorizedKeys.keys</link> =
[ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ];
</programlisting>
</para>

View File

@ -66,7 +66,7 @@ $ ./result/bin/run-*-vm
<literal>mutableUsers = false</literal>. Another way is to temporarily add
the following to your configuration:
<screen>
<link linkend="opt-users.users._name__.initialHashedPassword">users.extraUsers.your-user.initialHashedPassword</link> = "test";
<link linkend="opt-users.users._name__.initialHashedPassword">users.users.your-user.initialHashedPassword</link> = "test";
</screen>
<emphasis>Important:</emphasis> delete the $hostname.qcow2 file if you have
started the virtual machine at least once without the right users, otherwise

View File

@ -211,7 +211,7 @@ $ sudo groupdel nixbld</screen>
use <literal>sudo</literal>)
</para>
<programlisting>
<link linkend="opt-users.users._name__.initialHashedPassword">users.extraUsers.root.initialHashedPassword</link> = "";
<link linkend="opt-users.users._name__.initialHashedPassword">users.users.root.initialHashedPassword</link> = "";
</programlisting>
</listitem>
<listitem>

View File

@ -330,6 +330,11 @@ inherit (pkgs.nixos {
will be added to <literal>environment.systemPackages</literal>.
</para>
</listitem>
<listitem>
<para>
The module <option>services.networking.hostapd</option> now uses WPA2 by default.
</para>
</listitem>
</itemizedlist>
</section>
</section>

View File

@ -317,6 +317,10 @@
restic = 291;
openvpn = 292;
meguca = 293;
yarn = 294;
hdfs = 295;
mapred = 296;
hadoop = 297;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -594,6 +598,10 @@
restic = 291;
openvpn = 292;
meguca = 293;
yarn = 294;
hdfs = 295;
mapred = 296;
hadoop = 297;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal

View File

@ -178,6 +178,7 @@
./services/backup/rsnapshot.nix
./services/backup/tarsnap.nix
./services/backup/znapzend.nix
./services/cluster/hadoop/default.nix
./services/cluster/kubernetes/default.nix
./services/cluster/kubernetes/dns.nix
./services/cluster/kubernetes/dashboard.nix

View File

@ -0,0 +1,31 @@
{ hadoop, pkgs }:
let
propertyXml = name: value: ''
<property>
<name>${name}</name>
<value>${builtins.toString value}</value>
</property>
'';
siteXml = fileName: properties: pkgs.writeTextDir fileName ''
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- generated by NixOS -->
<configuration>
${builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList propertyXml properties)}
</configuration>
'';
userFunctions = ''
hadoop_verify_logdir() {
echo Skipping verification of log directory
}
'';
in
pkgs.buildEnv {
name = "hadoop-conf";
paths = [
(siteXml "core-site.xml" hadoop.coreSite)
(siteXml "hdfs-site.xml" hadoop.hdfsSite)
(siteXml "mapred-site.xml" hadoop.mapredSite)
(siteXml "yarn-site.xml" hadoop.yarnSite)
(pkgs.writeTextDir "hadoop-user-functions.sh" userFunctions)
];
}

View File

@ -0,0 +1,63 @@
{ config, lib, pkgs, ...}:
let
cfg = config.services.hadoop;
hadoopConf = import ./conf.nix { hadoop = cfg; pkgs = pkgs; };
in
with lib;
{
imports = [ ./yarn.nix ./hdfs.nix ];
options.services.hadoop = {
coreSite = mkOption {
default = {};
example = {
"fs.defaultFS" = "hdfs://localhost";
};
description = "Hadoop core-site.xml definition";
};
hdfsSite = mkOption {
default = {};
example = {
"dfs.nameservices" = "namenode1";
};
description = "Hadoop hdfs-site.xml definition";
};
mapredSite = mkOption {
default = {};
example = {
"mapreduce.map.cpu.vcores" = "1";
};
description = "Hadoop mapred-site.xml definition";
};
yarnSite = mkOption {
default = {};
example = {
"yarn.resourcemanager.ha.id" = "resourcemanager1";
};
description = "Hadoop yarn-site.xml definition";
};
package = mkOption {
type = types.package;
default = pkgs.hadoop;
defaultText = "pkgs.hadoop";
example = literalExample "pkgs.hadoop";
description = ''
'';
};
};
config = mkMerge [
(mkIf (builtins.hasAttr "yarn" config.users.extraUsers ||
builtins.hasAttr "hdfs" config.users.extraUsers ) {
users.extraGroups.hadoop = {
gid = config.ids.gids.hadoop;
};
})
];
}

View File

@ -0,0 +1,73 @@
{ config, lib, pkgs, ...}:
let
cfg = config.services.hadoop;
hadoopConf = import ./conf.nix { hadoop = cfg; pkgs = pkgs; };
in
with lib;
{
options.services.hadoop.hdfs = {
namenode.enabled = mkOption {
type = types.bool;
default = false;
description = ''
Whether to run the Hadoop YARN NameNode
'';
};
datanode.enabled = mkOption {
type = types.bool;
default = false;
description = ''
Whether to run the Hadoop YARN DataNode
'';
};
};
config = mkMerge [
(mkIf cfg.hdfs.namenode.enabled {
systemd.services."hdfs-namenode" = {
description = "Hadoop HDFS NameNode";
wantedBy = [ "multi-user.target" ];
environment = {
HADOOP_HOME = "${cfg.package}";
};
preStart = ''
${cfg.package}/bin/hdfs --config ${hadoopConf} namenode -format -nonInteractive || true
'';
serviceConfig = {
User = "hdfs";
SyslogIdentifier = "hdfs-namenode";
ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} namenode";
};
};
})
(mkIf cfg.hdfs.datanode.enabled {
systemd.services."hdfs-datanode" = {
description = "Hadoop HDFS DataNode";
wantedBy = [ "multi-user.target" ];
environment = {
HADOOP_HOME = "${cfg.package}";
};
serviceConfig = {
User = "hdfs";
SyslogIdentifier = "hdfs-datanode";
ExecStart = "${cfg.package}/bin/hdfs --config ${hadoopConf} datanode";
};
};
})
(mkIf (
cfg.hdfs.namenode.enabled || cfg.hdfs.datanode.enabled
) {
users.extraUsers.hdfs = {
description = "Hadoop HDFS user";
group = "hadoop";
uid = config.ids.uids.hdfs;
};
})
];
}

View File

@ -0,0 +1,74 @@
{ config, lib, pkgs, ...}:
let
cfg = config.services.hadoop;
hadoopConf = import ./conf.nix { hadoop = cfg; pkgs = pkgs; };
in
with lib;
{
options.services.hadoop.yarn = {
resourcemanager.enabled = mkOption {
type = types.bool;
default = false;
description = ''
Whether to run the Hadoop YARN ResourceManager
'';
};
nodemanager.enabled = mkOption {
type = types.bool;
default = false;
description = ''
Whether to run the Hadoop YARN NodeManager
'';
};
};
config = mkMerge [
(mkIf (
cfg.yarn.resourcemanager.enabled || cfg.yarn.nodemanager.enabled
) {
users.extraUsers.yarn = {
description = "Hadoop YARN user";
group = "hadoop";
uid = config.ids.uids.yarn;
};
})
(mkIf cfg.yarn.resourcemanager.enabled {
systemd.services."yarn-resourcemanager" = {
description = "Hadoop YARN ResourceManager";
wantedBy = [ "multi-user.target" ];
environment = {
HADOOP_HOME = "${cfg.package}";
};
serviceConfig = {
User = "yarn";
SyslogIdentifier = "yarn-resourcemanager";
ExecStart = "${cfg.package}/bin/yarn --config ${hadoopConf} " +
" resourcemanager";
};
};
})
(mkIf cfg.yarn.nodemanager.enabled {
systemd.services."yarn-nodemanager" = {
description = "Hadoop YARN NodeManager";
wantedBy = [ "multi-user.target" ];
environment = {
HADOOP_HOME = "${cfg.package}";
};
serviceConfig = {
User = "yarn";
SyslogIdentifier = "yarn-nodemanager";
ExecStart = "${cfg.package}/bin/yarn --config ${hadoopConf} " +
" nodemanager";
};
};
})
];
}

View File

@ -85,6 +85,6 @@ in {
};
meta = {
maintainers = pkgs.fwupd.maintainers;
maintainers = pkgs.fwupd.meta.maintainers;
};
}

View File

@ -1,6 +1,7 @@
{ config, pkgs, lib, ... }:
{ config, lib, pkgs, ... }:
with import ./lib.nix { inherit lib; };
# openafsMod, openafsBin, mkCellServDB
with import ./lib.nix { inherit config lib pkgs; };
let
inherit (lib) getBin mkOption mkIf optionalString singleton types;
@ -8,8 +9,8 @@ let
cfg = config.services.openafsClient;
cellServDB = pkgs.fetchurl {
url = http://dl.central.org/dl/cellservdb/CellServDB.2017-03-14;
sha256 = "1197z6c5xrijgf66rhaymnm5cvyg2yiy1i20y4ah4mrzmjx0m7sc";
url = http://dl.central.org/dl/cellservdb/CellServDB.2018-05-14;
sha256 = "1wmjn6mmyy2r8p10nlbdzs4nrqxy8a9pjyrdciy5nmppg4053rk2";
};
clientServDB = pkgs.writeText "client-cellServDB-${cfg.cellName}" (mkCellServDB cfg.cellName cfg.cellServDB);
@ -21,8 +22,6 @@ let
echo "${cfg.mountPoint}:${cfg.cache.directory}:${toString cfg.cache.blocks}" > $out/cacheinfo
'';
openafsMod = config.boot.kernelPackages.openafs;
openafsBin = lib.getBin pkgs.openafs;
in
{
###### interface
@ -147,6 +146,19 @@ in
'';
};
packages = {
module = mkOption {
default = config.boot.kernelPackages.openafs;
type = types.package;
description = "OpenAFS kernel module package. MUST match the userland package!";
};
programs = mkOption {
default = getBin pkgs.openafs;
type = types.package;
description = "OpenAFS programs package. MUST match the kernel module package!";
};
};
sparse = mkOption {
default = true;
type = types.bool;
@ -180,7 +192,7 @@ in
}
];
environment.systemPackages = [ pkgs.openafs ];
environment.systemPackages = [ openafsBin ];
environment.etc = {
clientCellServDB = {

View File

@ -1,14 +1,15 @@
{ lib, ...}:
{ config, lib, pkgs, ...}:
let
inherit (lib) concatStringsSep mkOption types;
inherit (lib) concatStringsSep getBin mkOption types;
in rec {
mkCellServDB = cellName: db: ''
>${cellName}
'' + (concatStringsSep "\n" (map (dbm: if (dbm.ip != "" && dbm.dnsname != "") then dbm.ip + " #" + dbm.dnsname else "")
db));
db))
+ "\n";
# CellServDB configuration type
cellServDBConfig = {
@ -25,4 +26,8 @@ in rec {
description = "DNS full-qualified domain name of a database server";
};
};
openafsMod = config.services.openafsClient.packages.module;
openafsBin = config.services.openafsClient.packages.programs;
openafsSrv = config.services.openafsServer.package;
}

View File

@ -1,6 +1,7 @@
{ config, pkgs, lib, ... }:
{ config, lib, pkgs, ... }:
with import ./lib.nix { inherit lib; };
# openafsBin, openafsSrv, mkCellServDB
with import ./lib.nix { inherit config lib pkgs; };
let
inherit (lib) concatStringsSep intersperse mapAttrsToList mkForce mkIf mkMerge mkOption optionalString types;
@ -11,21 +12,21 @@ let
checkbintime 3 0 5 0 0
'' + (optionalString cfg.roles.database.enable ''
bnode simple vlserver 1
parm ${openafsBin}/libexec/openafs/vlserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} ${cfg.roles.database.vlserverArgs}
parm ${openafsSrv}/libexec/openafs/vlserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} ${cfg.roles.database.vlserverArgs}
end
bnode simple ptserver 1
parm ${openafsBin}/libexec/openafs/ptserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} ${cfg.roles.database.ptserverArgs}
parm ${openafsSrv}/libexec/openafs/ptserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} ${cfg.roles.database.ptserverArgs}
end
'') + (optionalString cfg.roles.fileserver.enable ''
bnode dafs dafs 1
parm ${openafsBin}/libexec/openafs/dafileserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} -udpsize ${udpSizeStr} ${cfg.roles.fileserver.fileserverArgs}
parm ${openafsBin}/libexec/openafs/davolserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} -udpsize ${udpSizeStr} ${cfg.roles.fileserver.volserverArgs}
parm ${openafsBin}/libexec/openafs/salvageserver ${cfg.roles.fileserver.salvageserverArgs}
parm ${openafsBin}/libexec/openafs/dasalvager ${cfg.roles.fileserver.salvagerArgs}
parm ${openafsSrv}/libexec/openafs/dafileserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} -udpsize ${udpSizeStr} ${cfg.roles.fileserver.fileserverArgs}
parm ${openafsSrv}/libexec/openafs/davolserver ${optionalString cfg.dottedPrincipals "-allow-dotted-principals"} -udpsize ${udpSizeStr} ${cfg.roles.fileserver.volserverArgs}
parm ${openafsSrv}/libexec/openafs/salvageserver ${cfg.roles.fileserver.salvageserverArgs}
parm ${openafsSrv}/libexec/openafs/dasalvager ${cfg.roles.fileserver.salvagerArgs}
end
'') + (optionalString (cfg.roles.database.enable && cfg.roles.backup.enable) ''
bnode simple buserver 1
parm ${openafsBin}/libexec/openafs/buserver ${cfg.roles.backup.buserverArgs} ${optionalString (cfg.roles.backup.cellServDB != []) "-cellservdb /etc/openafs/backup/"}
parm ${openafsSrv}/libexec/openafs/buserver ${cfg.roles.backup.buserverArgs} ${optionalString (cfg.roles.backup.cellServDB != []) "-cellservdb /etc/openafs/backup/"}
end
''));
@ -39,8 +40,6 @@ let
udpSizeStr = toString cfg.udpPacketSize;
openafsBin = lib.getBin pkgs.openafs;
in {
options = {
@ -79,6 +78,12 @@ in {
description = "Definition of all cell-local database server machines.";
};
package = mkOption {
default = pkgs.openafs.server or pkgs.openafs;
type = types.package;
description = "OpenAFS package for the server binaries";
};
roles = {
fileserver = {
enable = mkOption {
@ -213,7 +218,7 @@ in {
}
];
environment.systemPackages = [ pkgs.openafs ];
environment.systemPackages = [ openafsBin ];
environment.etc = {
bosConfig = {
@ -244,7 +249,10 @@ in {
after = [ "syslog.target" "network.target" ];
wantedBy = [ "multi-user.target" ];
restartIfChanged = false;
unitConfig.ConditionPathExists = [ "/etc/openafs/server/rxkad.keytab" ];
unitConfig.ConditionPathExists = [
"|/etc/openafs/server/rxkad.keytab"
"|/etc/openafs/server/KeyFileExt"
];
preStart = ''
mkdir -m 0755 -p /var/openafs
${optionalString (netInfo != null) "cp ${netInfo} /var/openafs/netInfo"}

View File

@ -29,7 +29,7 @@ let
ctrl_interface_group=${cfg.group}
${if cfg.wpa then ''
wpa=1
wpa=2
wpa_passphrase=${cfg.wpaPassphrase}
'' else ""}

View File

@ -28,6 +28,10 @@ in {
serviceConfig.ExecStart = "${pkgs.iwd}/libexec/iwd";
};
systemd.tmpfiles.rules = [
"d /var/lib/iwd 0700 root root -"
];
};
meta.maintainers = with lib.maintainers; [ mic92 ];

View File

@ -299,6 +299,8 @@ in rec {
tests.gnome3-gdm = callTest tests/gnome3-gdm.nix {};
tests.grafana = callTest tests/grafana.nix {};
tests.graphite = callTest tests/graphite.nix {};
tests.hadoop.hdfs = callTestOnMatchingSystems [ "x86_64-linux" ] tests/hadoop/hdfs.nix {};
tests.hadoop.yarn = callTestOnMatchingSystems [ "x86_64-linux" ] tests/hadoop/yarn.nix {};
tests.hardened = callTest tests/hardened.nix { };
tests.haproxy = callTest tests/haproxy.nix {};
tests.hibernate = callTest tests/hibernate.nix {};

View File

@ -193,6 +193,7 @@ let
snakeOilCa = pkgs.runCommand "snakeoil-ca" {
buildInputs = [ pkgs.openssl ];
allowSubstitutes = false;
} ''
mkdir "$out"
openssl req -newkey rsa:4096 -x509 -sha256 -days 36500 \
@ -215,6 +216,7 @@ let
'';
in pkgs.runCommand "snakeoil-certs-${fqdn}" {
buildInputs = [ pkgs.openssl ];
allowSubstitutes = false;
} ''
mkdir "$out"
openssl genrsa -out "$out/snakeoil.key" 4096

View File

@ -0,0 +1,54 @@
import ../make-test.nix ({pkgs, ...}: {
nodes = {
namenode = {pkgs, config, ...}: {
services.hadoop = {
package = pkgs.hadoop_3_1;
hdfs.namenode.enabled = true;
coreSite = {
"fs.defaultFS" = "hdfs://namenode:8020";
};
hdfsSite = {
"dfs.replication" = 1;
"dfs.namenode.rpc-bind-host" = "0.0.0.0";
"dfs.namenode.http-bind-host" = "0.0.0.0";
};
};
networking.firewall.allowedTCPPorts = [
9870 # namenode.http-address
8020 # namenode.rpc-address
];
};
datanode = {pkgs, config, ...}: {
services.hadoop = {
package = pkgs.hadoop_3_1;
hdfs.datanode.enabled = true;
coreSite = {
"fs.defaultFS" = "hdfs://namenode:8020";
};
};
networking.firewall.allowedTCPPorts = [
9864 # datanode.http.address
9866 # datanode.address
9867 # datanode.ipc.address
];
};
};
testScript = ''
startAll
$namenode->waitForUnit("hdfs-namenode");
$namenode->waitForUnit("network.target");
$namenode->waitForOpenPort(8020);
$namenode->waitForOpenPort(9870);
$datanode->waitForUnit("hdfs-datanode");
$datanode->waitForUnit("network.target");
$datanode->waitForOpenPort(9864);
$datanode->waitForOpenPort(9866);
$datanode->waitForOpenPort(9867);
$namenode->succeed("curl http://namenode:9870");
$datanode->succeed("curl http://datanode:9864");
'';
})

View File

@ -0,0 +1,46 @@
import ../make-test.nix ({pkgs, ...}: {
nodes = {
resourcemanager = {pkgs, config, ...}: {
services.hadoop.package = pkgs.hadoop_3_1;
services.hadoop.yarn.resourcemanager.enabled = true;
services.hadoop.yarnSite = {
"yarn.resourcemanager.scheduler.class" = "org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler";
};
networking.firewall.allowedTCPPorts = [
8088 # resourcemanager.webapp.address
8031 # resourcemanager.resource-tracker.address
];
};
nodemanager = {pkgs, config, ...}: {
services.hadoop.package = pkgs.hadoop_3_1;
services.hadoop.yarn.nodemanager.enabled = true;
services.hadoop.yarnSite = {
"yarn.resourcemanager.hostname" = "resourcemanager";
"yarn.nodemanager.log-dirs" = "/tmp/userlogs";
"yarn.nodemanager.address" = "0.0.0.0:8041";
};
networking.firewall.allowedTCPPorts = [
8042 # nodemanager.webapp.address
8041 # nodemanager.address
];
};
};
testScript = ''
startAll;
$resourcemanager->waitForUnit("yarn-resourcemanager");
$resourcemanager->waitForUnit("network.target");
$resourcemanager->waitForOpenPort(8031);
$resourcemanager->waitForOpenPort(8088);
$nodemanager->waitForUnit("yarn-nodemanager");
$nodemanager->waitForUnit("network.target");
$nodemanager->waitForOpenPort(8042);
$nodemanager->waitForOpenPort(8041);
$resourcemanager->succeed("curl http://localhost:8088");
$nodemanager->succeed("curl http://localhost:8042");
'';
})

View File

@ -3,13 +3,13 @@
stdenv.mkDerivation rec {
name = "nano-wallet-${version}";
version = "12.1";
version = "14.2";
src = fetchFromGitHub {
owner = "nanocurrency";
repo = "raiblocks";
rev = "V${version}";
sha256 = "10ng7qn6y31s2bjahmpivw2plx90ljjjzb87j3l7zmppsjd2iq03";
sha256 = "0jbv5a8sz403a1pqcgl32idk6y0z510h7ikjg1dcxla0rsch6ipl";
fetchSubmodules = true;
};

View File

@ -1,7 +1,7 @@
let
version = "1.10.7";
sha256 = "0syhvr4n9zyxhx20xln7sf70ljzj6ab36xjz4710ivnwwz2pjajf";
cargoSha256 = "0zwk8xv71s7xkwvssh27772qfb23yhq5jlcny617qik6bwpcdh6b";
version = "1.10.8";
sha256 = "0q6blsbxn48afqf3cmxvmdlyzvf0cpqcymsjbsk8nyx0zxzf1dpk";
cargoSha256 = "0rzhabyhprmcg0cdmibbb8zgqf6z4izsdq8m060mppkkv675x0lf";
patches = [ ./patches/vendored-sources-1.10.patch ];
in
import ./parity.nix { inherit version sha256 cargoSha256 patches; }

View File

@ -0,0 +1,22 @@
{ stdenv, fetchurl, pkgconfig, libsidplayfp }:
stdenv.mkDerivation rec {
version = "1.4.3";
name = "sidplayfp-${version}";
src = fetchurl {
url = "mirror://sourceforge/sidplay-residfp/sidplayfp/1.4/${name}.tar.gz";
sha256 = "04gqhxs4w0riabp1svgcs6gsxdmbfmrs4kaqr5lifvxjvv03vzsn";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libsidplayfp ];
meta = with stdenv.lib; {
description = "A SID player using libsidplayfp";
homepage = https://sourceforge.net/projects/sidplay-residfp/;
license = with licenses; [ gpl2Plus ];
maintainers = with maintainers; [ dezgeg ];
platforms = with platforms; linux;
};
}

View File

@ -16,6 +16,7 @@
, fontconfig
, freetype
, libpulseaudio
, libGL
, libX11
, libXext
, libXi
@ -97,6 +98,7 @@ let
# For Android emulator
libpulseaudio
libX11
libGL
# For GTKLookAndFeel
gtk2

View File

@ -5,11 +5,11 @@
stdenv.mkDerivation rec {
name = "avocode-${version}";
version = "3.0.0";
version = "3.1.1";
src = fetchurl {
url = "https://media.avocode.com/download/avocode-app/${version}/avocode-${version}-linux.zip";
sha256 = "1lm0zzqhnk5gm68l8fkmlkh3gl71f1xw0amy23460a7hm9wcwjr7";
sha256 = "1qvyc08i3b4rr43ssz78xndm4bx8lz2vigh6w9gd7w367xjf4f5b";
};
libPath = stdenv.lib.makeLibraryPath (with xorg; with gnome2; [

View File

@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
sha256 = "16g26vin1693dbdr9qsnw36fdchx394lp79gvp7gcbw0w1ny9av6";
};
patchPhase = ''
sed -i -e 's/ -Wno-format//g' Makefile
'';
makeFlags = "PREFIX=$(out)";
nativeBuildInputs = [ pkgconfig gettext ];

View File

@ -3,11 +3,11 @@
stdenv.mkDerivation rec {
name = "chirp-daily-${version}";
version = "20180611";
version = "20180614";
src = fetchurl {
url = "https://trac.chirp.danplanet.com/chirp_daily/daily-${version}/${name}.tar.gz";
sha256 = "1569gnbs4jb53n58wdkdjrxx9nrayljn5v0wqacn5zfr87s16zxf";
sha256 = "011bxd418hrl88rhp6lhja68b2kvnm1b845v41g9qfsagvfmbv3g";
};
nativeBuildInputs = [ makeWrapper ];

View File

@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, writeText, makeWrapper
# Dependencies documented @ https://gnuradio.org/doc/doxygen/build_guide.html
# => core dependencies
, ninja, cmake, pkgconfig, git, boost, cppunit, fftw
, cmake, pkgconfig, git, boost, cppunit, fftw
# => python wrappers
# May be able to upgrade to swig3
, python, swig2, numpy, scipy, matplotlib
@ -32,12 +32,12 @@ stdenv.mkDerivation rec {
owner = "gnuradio";
repo = "gnuradio";
rev = "v${version}";
sha256 = "0fqxn1k41xqd52i5z528zdhkn52i9z5hl6cc75ggdx9iqxhvb3jj";
sha256 = "1qpa53axqavdv2ykby7rwh7xmhvv964xq1d7rcvbwkry7dngrbib";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake pkgconfig git makeWrapper cppunit orc ninja
cmake pkgconfig git makeWrapper cppunit orc
];
buildInputs = [

View File

@ -1,12 +1,14 @@
{ stdenv, fetchurl, pkgconfig, libXtst, libvorbis, hunspell
{ stdenv, fetchFromGitHub, pkgconfig, libXtst, libvorbis, hunspell
, libao, ffmpeg, libeb, lzo, xz, libtiff
, qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake }:
stdenv.mkDerivation rec {
name = "goldendict-1.5.0.rc2";
src = fetchurl {
url = "https://github.com/goldendict/goldendict/archive/1.5.0-RC2.tar.gz";
sha256 = "1pizz39l61rbps0wby75fkvzyrah805257j33siqybwhsfiy1kmw";
name = "goldendict-2018-06-13";
src = fetchFromGitHub {
owner = "goldendict";
repo = "goldendict";
rev = "48e850c7ec11d83cba7499f7fdce377ef3849bbb";
sha256 = "0i4q4waqjv45hgwillvjik97pg26kwlmz4925djjkx8s6hxgjlq9";
};
nativeBuildInputs = [ pkgconfig qmake ];
@ -22,6 +24,6 @@ stdenv.mkDerivation rec {
description = "A feature-rich dictionary lookup program";
platforms = stdenv.lib.platforms.linux;
maintainers = [ stdenv.lib.maintainers.astsmtl ];
maintainers = with stdenv.lib.maintainers; [ gebner astsmtl ];
};
}

View File

@ -1,8 +1,22 @@
{ stdenv, pkgs, python3Packages }:
{ stdenv, pkgs, python3 }:
with python3Packages;
let
python = python3.override {
packageOverrides = self: super: {
buildPythonApplication rec {
# https://github.com/pimutils/khal/issues/780
python-dateutil = super.python-dateutil.overridePythonAttrs (oldAttrs: rec {
version = "2.6.1";
src = oldAttrs.src.override {
inherit version;
sha256 = "891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca";
};
});
};
};
in with python.pkgs; buildPythonApplication rec {
pname = "khal";
version = "0.9.9";
@ -29,10 +43,11 @@ buildPythonApplication rec {
pkginfo
freezegun
];
buildInputs = [ setuptools_scm pytest pkgs.glibcLocales ];
nativeBuildInputs = [ setuptools_scm pkgs.glibcLocales ];
checkInputs = [ pytest ];
checkPhase = ''
# py.test
py.test
'';
meta = with stdenv.lib; {

View File

@ -1,5 +1,5 @@
{
mkDerivation, fetchFromGitHub, lib,
mkDerivation, fetchurl, lib,
extra-cmake-modules, kdoctools, wrapGAppsHook,
kconfig, kinit, kjsembed, taglib, exiv2, podofo,
kcrash
@ -7,15 +7,14 @@
let
pname = "krename";
version = "20170610";
version = "5.0.0";
in mkDerivation rec {
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "KDE";
repo = "krename";
rev = "18000edfec52de0b417d575e14eb078b4bd7b2f3";
sha256 = "0hsrlfrbi42jqqnkcz682c6yrfi3xpl299672knj22074wr6sv0j";
src = fetchurl {
url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.xz";
sha256 = "136j1dkqrhv458rjh5v3vzjhvq6dhz7k79zk6mmx8zvqacc7cq8a";
};
meta = with lib; {

View File

@ -1,35 +0,0 @@
From b51b63b78c9ff1639f5f65ccfdd54681f1cadc1d Mon Sep 17 00:00:00 2001
From: Sam Parkinson <sam@sam.today>
Date: Tue, 26 Dec 2017 14:46:27 +1100
Subject: [PATCH] Extend the python path; rather than replacing it
Some distros (i.e. NixOS) require the special PYTHONPATH, so that
the web extension has access to the python packages it wants (i.e. gi).
Previously, the PYTHONPATH was replaced with the web extension path;
meaning it would crash on NixOS. This instead prepends the web
extension path to the PYTHONPATH.
---
eolie/application.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/eolie/application.py b/eolie/application.py
index 3c21542..bed4e55 100644
--- a/eolie/application.py
+++ b/eolie/application.py
@@ -340,7 +340,11 @@ class Application(Gtk.Application):
self.settings = Settings.new()
# Init extensions
- GLib.setenv("PYTHONPATH", self.__extension_dir, True)
+ current_path = GLib.getenv("PYTHONPATH")
+ new_path = self.__extension_dir
+ if current_path:
+ new_path = new_path + ':' + current_path
+ GLib.setenv("PYTHONPATH", new_path, True)
# Create favicon path
if not GLib.file_test(self.__FAVICONS_PATH, GLib.FileTest.IS_DIR):
--
2.15.0

View File

@ -1,67 +1,53 @@
{ stdenv, fetchgit, intltool, itstool, meson, ninja, pkgconfig, wrapGAppsHook
, glib, glib-networking, gsettings-desktop-schemas, gst_all_1, gtk3, gobjectIntrospection
, gtkspell3, libsecret, python36, python36Packages, webkitgtk }:
{ stdenv, fetchgit, meson, ninja, pkgconfig, wrapGAppsHook
, desktop-file-utils, gobjectIntrospection, python36Packages
, gnome3, gst_all_1, gtkspell3, hunspell }:
stdenv.mkDerivation rec {
name = "eolie-${version}";
version = "0.9.16";
version = "0.9.35";
src = fetchgit {
url = https://gitlab.gnome.org/gnumdk/eolie;
rev = version;
sha256 = "0mvhr6hy4nx7xaq9r9qp5rb0y293kjjryw5ykzb473cr3iwzk25b";
url = "https://gitlab.gnome.org/World/eolie";
rev = "refs/tags/${version}";
fetchSubmodules = true;
sha256 = "0x3p1fgx1fhrnr7vkkpnl34401r6k6xg2mrjff7ncb1k57q522k7";
};
nativeBuildInputs = [
intltool
itstool
nativeBuildInputs = with python36Packages; [
desktop-file-utils
gobjectIntrospection
meson
ninja
pkgconfig
wrapGAppsHook
gobjectIntrospection
wrapPython
];
buildInputs = [
glib
glib-networking
gsettings-desktop-schemas
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav
gtk3
gtkspell3
libsecret
python36
python36Packages.pygobject3
python36Packages.pycairo
python36Packages.dateutil
python36Packages.dbus-python
python36Packages.beautifulsoup4
python36Packages.pycrypto
python36Packages.requests
webkitgtk
buildInputs = [ gtkspell3 hunspell python36Packages.pygobject3 ] ++ (with gnome3; [
glib glib-networking gsettings_desktop_schemas gtk3 webkitgtk libsecret
]) ++ (with gst_all_1; [
gst-libav gst-plugins-base gst-plugins-ugly gstreamer
]);
pythonPath = with python36Packages; [
beautifulsoup4
pycairo
pygobject3
python-dateutil
];
wrapPrefixVariables = [ "PYTHONPATH" ];
postFixup = "wrapPythonPrograms";
postPatch = ''
chmod +x meson_post_install.py # patchShebangs requires executable file
patchShebangs meson_post_install.py
'';
patches = [
./0001-Extend-the-python-path-rather-than-replacing-it.patch
];
meta = with stdenv.lib; {
description = "A new GNOME web browser";
homepage = https://wiki.gnome.org/Apps/Eolie;
license = licenses.gpl3;
maintainers = [ maintainers.samdroid-apps ];
platforms = platforms.linux;
homepage = https://wiki.gnome.org/Apps/Eolie;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ samdroid-apps worldofpeace ];
platforms = platforms.linux;
};
}

View File

@ -1,14 +1,16 @@
{ stdenv, fetchurl, system, makeWrapper, makeDesktopItem,
alsaLib, dbus, glib, fontconfig, freetype, libpulseaudio,
utillinux, zlib, xorg, udev, sqlite, expat, libv4l, procps, libGL }:
{ stdenv, fetchurl, system, makeWrapper, makeDesktopItem, autoPatchelfHook
, dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, procps
, qtbase, qtdeclarative, qtlocation, qtquickcontrols2, qtscript
, qtwebchannel, qtwebengine
}:
let
version = "2.0.123200.0405";
version = "2.2.128100.0627";
srcs = {
x86_64-linux = fetchurl {
url = "https://zoom.us/client/${version}/zoom_x86_64.tar.xz";
sha256 = "1ifwa2xf5mw1ll2j1f39qd7mpyxpc6xj3650dmlnxf525dsm573z";
sha256 = "1x98zhs75c22x58zj4vzk8gb9yr7a9hfkbiqhjp5jrvccgz6ncin";
};
};
@ -17,76 +19,44 @@ in stdenv.mkDerivation {
src = srcs.${system};
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
libPath = stdenv.lib.makeLibraryPath [
alsaLib
expat
glib
freetype
libGL
libpulseaudio
zlib
dbus
fontconfig
sqlite
utillinux
udev
xorg.libX11
xorg.libSM
xorg.libICE
xorg.libxcb
xorg.xcbutilimage
xorg.xcbutilkeysyms
xorg.libXcursor
xorg.libXext
xorg.libXfixes
xorg.libXdamage
xorg.libXtst
xorg.libxshmfence
xorg.libXi
xorg.libXrender
xorg.libXcomposite
xorg.libXScrnSaver
xorg.libXrandr
stdenv.cc.cc
buildInputs = [
dbus glib libGL libX11 libXfixes libuuid libxcb qtbase qtdeclarative
qtlocation qtquickcontrols2 qtscript qtwebchannel qtwebengine
];
installPhase = ''
runHook preInstall
installPhase =
let
files = stdenv.lib.concatStringsSep " " [
"*.pcm"
"*.png"
"ZXMPPROOT.cer"
"ZoomLauncher"
"config-dump.sh"
"qtdiag"
"timezones"
"translations"
"version.txt"
"zcacert.pem"
"zoom"
"zoom.sh"
"zoomlinux"
"zopen"
];
in ''
runHook preInstall
packagePath=$out/share/zoom-us
mkdir -p $packagePath
mkdir -p $out/bin
cp -ar * $packagePath
packagePath=$out/share/zoom-us
mkdir -p $packagePath $out/bin
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $packagePath/zoom
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $packagePath/QtWebEngineProcess
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $packagePath/qtdiag
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $packagePath/zopen
# included from https://github.com/NixOS/nixpkgs/commit/fc218766333a05c9352b386e0cbb16e1ae84bf53
# it works for me without it, but, well...
paxmark m $packagePath/zoom
#paxmark m $packagePath/QtWebEngineProcess # is this what dtzWill talked about?
cp -ar ${files} $packagePath
# RUNPATH set via patchelf is used only for half of libraries (why?), so wrap it
makeWrapper $packagePath/zoom $out/bin/zoom-us \
--prefix LD_LIBRARY_PATH : "$packagePath:$libPath" \
--prefix LD_PRELOAD : "${libv4l}/lib/v4l1compat.so" \
--prefix PATH : "${procps}/bin" \
--set QT_PLUGIN_PATH "$packagePath/platforms" \
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \
--set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale"
makeWrapper $packagePath/zoom $out/bin/zoom-us \
--prefix PATH : "${procps}/bin"
cat > $packagePath/qt.conf <<EOF
[Paths]
Prefix = $packagePath
EOF
runHook postInstall
'';
runHook postInstall
'';
postInstall = (makeDesktopItem {
name = "zoom-us";
@ -98,6 +68,8 @@ in stdenv.mkDerivation {
mimeType = "x-scheme-handler/zoommtg;";
}).buildCommand;
passthru.updateScript = ./update.sh;
meta = {
homepage = https://zoom.us/;
description = "zoom.us video conferencing application";

View File

@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pcre common-updater-scripts
set -eu -o pipefail
version="$(curl -sI https://zoom.us/client/latest/zoom_x86_64.tar.xz | grep -Fi 'Location:' | pcregrep -o1 '/(([0-9]\.?)+)/')"
update-source-version zoom-us "$version"

View File

@ -13,6 +13,8 @@ let
};
};
boostPython = boost.override { enablePython = true; };
in stdenv.mkDerivation rec {
name = "twister-${version}";
version = "0.9.34";
@ -29,13 +31,13 @@ in stdenv.mkDerivation rec {
"--disable-deprecated-functions"
"--enable-tests"
"--enable-python-binding"
"--with-boost-libdir=${boost.out}/lib"
"--with-boost-libdir=${boostPython.out}/lib"
];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [
autoconf automake libtool python2
boost db openssl geoip miniupnpc libiconv
boostPython db openssl geoip miniupnpc libiconv
];
patches = stdenv.lib.singleton (fetchpatch {

View File

@ -1,5 +1,6 @@
{ stdenv
, lib
, fetchurl
, requireFile
, makeWrapper
, libredirect
@ -23,10 +24,20 @@
, alsaLib
, libidn
, zlib
, version ? "13.9.1"
, version ? "13.10.0"
}:
let
# In 56e1bdc7f9c (libidn: 1.34 -> 1.35), libidn.so.11 became libidn.so.12.
# Citrix looks for the former so we build version 1.34 to please the binary
libidn_134 = libidn.overrideDerivation (_: rec {
name = "libidn-1.34";
src = fetchurl {
url = "mirror://gnu/libidn/${name}.tar.gz";
sha256 = "0g3fzypp0xjcgr90c5cyj57apx1cmy0c6y9lvw2qdcigbyby469p";
};
});
versionInfo = {
"13.4.0" = rec {
major = "13";
@ -102,6 +113,17 @@ let
x86hash = "A93E9770FD10FDD3586A2D47448559EA037265717A7000B9BD2B1DCCE7B0A483";
x64suffix = "6";
x86suffix = "6";
homepage = https://www.citrix.com/downloads/citrix-receiver/legacy-receiver-for-linux/receiver-for-linux-1391.html;
};
"13.10.0" = {
major = "13";
minor = "10";
patch = "0";
x64hash = "7025688C7891374CDA11C92FC0BA2FA8151AEB4C4D31589AD18747FAE943F6EA";
x86hash = "2DCA3C8EDED11C5D824D579BC3A6B7D531EAEDDCBFB16E91B5702C72CAE9DEE4";
x64suffix = "20";
x86suffix = "20";
homepage = https://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-latest.html;
};
};
@ -160,7 +182,7 @@ let
xorg.libXinerama
xorg.libXfixes
libpng12
libidn
libidn_134
zlib
gtk_engines
freetype

View File

@ -25,11 +25,11 @@ in
stdenv.mkDerivation rec {
name = "gnucash-${version}";
version = "3.1-1";
version = "3.2";
src = fetchurl {
url = "mirror://sourceforge/gnucash/${name}.tar.bz2";
sha256 = "0qfjpmr6hnr0v7l2fi00rilnlyan4kqiyygyidxlpdxqqg76dvx1";
sha256 = "0li4b6pvlahgh5n9v91yxfgm972a1kky80xw3q1ggl4f2h6b1rb3";
};
nativeBuildInputs = [ pkgconfig makeWrapper cmake gtest ];

View File

@ -1,4 +1,5 @@
{ stdenv, lib, fetchurl, doxygen, extra-cmake-modules, graphviz, kdoctools
, fetchpatch
, akonadi, alkimia, aqbanking, gmp, gwenhywfar, kactivities, karchive
, kcmutils, kcontacts, kdewebkit, kdiagram, kholidays, kidentitymanagement
@ -20,6 +21,13 @@ stdenv.mkDerivation rec {
sha256 = "1c9apnvc07y17pzy4vygry1dai5ass2z7j354lrcppa85b18yvnx";
};
# Fix build with Qt 5.11.
patches = lib.singleton (fetchpatch {
url = "https://cgit.kde.org/kmymoney.git/patch/?id="
+ "e5198a902996b27bf9abde0ad24af82d55ab5dc1";
sha256 = "1h2f1xznf7343s26fh94x8n2ci0pijk5j86f24lvghawsw848316";
});
# Hidden dependency that wasn't included in CMakeLists.txt:
NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5";

View File

@ -13,7 +13,10 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
buildInputs = [ boost gmp mpfr libedit python texinfo gnused ];
buildInputs = [
(boost.override { enablePython = usePython; })
gmp mpfr libedit python texinfo gnused
];
nativeBuildInputs = [ cmake ];

View File

@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
meta = {
homepage = http://gravit.slowchop.com;
homepage = https://gravit.slowchop.com;
description = "Beautiful OpenGL-based gravity simulator";
license = stdenv.lib.licenses.gpl2;

View File

@ -2,14 +2,14 @@
stdenv.mkDerivation rec {
name = "librepcb-${version}";
version = "20171229";
version = "20180628";
src = fetchFromGitHub {
owner = "LibrePCB";
repo = "LibrePCB";
fetchSubmodules = true;
rev = "4efb06fa42755abc5e606da4669cc17e8de2f8c6";
sha256 = "0r33fm1djqpy0dzvnf5gv2dfh5nj2acaxb7w4cn8yxdgrazjf7ak";
rev = "68577ecf8f39299ef4d81ff964b01c3908d1f10b";
sha256 = "1ca4q8b8fhp19vq5yi55sq6xlsz14ihw3i0h7rq5fw0kigpjldmz";
};
enableParallelBuilding = true;
@ -18,11 +18,13 @@ stdenv.mkDerivation rec {
buildInputs = [ qtbase ];
# LibrePCB still supports QT below 5.9. But some code lines break the build, so they are removed by this patch so that the software builds.
patches = [ ./fix-2017-12.patch ];
qmakeFlags = ["-r"];
postInstall = ''
mkdir -p $out/share/librepcb/fontobene
cp share/librepcb/fontobene/newstroke.bene $out/share/librepcb/fontobene/
'';
meta = with stdenv.lib; {
description = "A free EDA software to develop printed circuit boards";
homepage = http://librepcb.org/;

View File

@ -1,29 +0,0 @@
--- a/libs/librepcb/common/fileio/serializableobjectlist.h
+++ b/libs/librepcb/common/fileio/serializableobjectlist.h
@@ -374,26 +374,6 @@
} // namespace librepcb
/*****************************************************************************************
- * Prevent from using SerializableObjectList in a foreach loop because it always would
- * create a deep copy of the list! You should use C++11 range based for loops instead.
- ****************************************************************************************/
-
-#if (QT_VERSION > QT_VERSION_CHECK(5, 9, 0))
-#define QFOREACHCONTAINER_TEMPLATE QtPrivate::QForeachContainer
-#else
-#define QFOREACHCONTAINER_TEMPLATE QForeachContainer
-#endif
-
-template <typename T, typename P>
-class QFOREACHCONTAINER_TEMPLATE<librepcb::SerializableObjectList<T, P>> { public:
- ~QForeachContainer() = delete;
-};
-template <typename T, typename P>
-class QFOREACHCONTAINER_TEMPLATE<const librepcb::SerializableObjectList<T, P>> { public:
- ~QForeachContainer() = delete;
-};
-
-/*****************************************************************************************
* End of File
****************************************************************************************/

View File

@ -23,6 +23,7 @@ let
"8.7.1" = "0gjn59jkbxwrihk8fx9d823wjyjh5m9gvj9l31nv6z6bcqhgdqi8";
"8.7.2" = "0a0657xby8wdq4aqb2xsxp3n7pmc2w4yxjmrb2l4kccs1aqvaj4w";
"8.8.0" = "13a4fka22hdxsjk11mgjb9ffzplfxyxp1sg5v1c8nk1grxlscgw8";
"8.8.1" = "1hlf58gwazywbmfa48219amid38vqdl94yz21i11b4map6jfwhbk";
}."${version}";
coq-version = builtins.substring 0 3 version;
camlp5 = ocamlPackages.camlp5_strict;

View File

@ -0,0 +1,117 @@
# Sage on nixos
Sage is a pretty complex package that depends on many other complex packages and patches some of those. As a result, the sage nix package is also quite complex.
Don't feel discouraged to fix, simplify or improve things though. Here's a quick overview over the functions of the individual files:
- `sage-src.nix`
Downloads the source code and applies patches. This makes sure that all the other files work with the same sage source. If you want to apply a patch to sage or update sage to a new version, this is the place to do it.
- `env-locations.nix`
Creates a bash file that sets a bunch of environment variables telling sage where to find various packages and files. The definitions of those environment variables can be found in the sage source in the `src/env.py` file. This bash file needs to be sourced before sage is started (done in `sage-env.nix` and `sagedoc.nix`).
- `sage-env.nix`
Sets all environment variables sage needs to run. This includes the package locations defined in `env-locations.nix` as well as the location of sage itself and its various subdirectories.
- `sagelib.nix`
Defines the main sage package (without setting the necessary environments or running any tests).
- `sage-with-env.nix`
Wraps sage in the necessary environment.
- `sage.nix`
Runs sages doctests.
- `sage-wrapper.nix`
Optionally tells sage where do find the docs.
- `sagedoc.nix`
Builds and tests the sage html documentation. Can be used for offline documentation viewing as well as the sage `browse_sage_doc` and `search_doc` functions.
- `sagenb.nix`
The (semi deprecated) sage notebook.
- `default.nix`
Introduces necessary overrides, defines new packages and ties everything together (returning the `sage` package).
- `flask-oldsessions.nix`, `flask-openid.nix`, `python-openid.nix`
These are python packages that were rejected from the main nixpkgs tree because they appear unmaintained. They are needed for the (semi-deprecated) sage notebook. Since that notebook is still needed to run the sage doctests, these packages are included but not exposed to the rest of nixpkgs.
- `pybrial.nix`
pybrial is a dependency of sage. However, pybrial itself also has sage as a dependency. Because of that circular dependency, pybrial is hidden from the rest of nixpkgs (just as the flask packages and python-openid.
- `openblas-pc.nix`
This creates a `.pc` file to be read by `pkg-config` that allows openblas to take on different roles, like `cblas` or `lapack`.
## The sage build is broken
First you should find out which change to nixpkgs is at fault (if you don't already know). You can use `git-bisect` for that (see the manpage).
If the build broke as a result of a package update, try those solutions in order:
- search the [sage trac](https://trac.sagemath.org/) for keywords like "Upgrade <package>". Maybe somebody has already proposed a patch that fixes the issue. You can then add a `fetchpatch` to `sage-src.nix`.
- check if [gentoo](https://github.com/cschwan/sage-on-gentoo/tree/master/sci-mathematics/sage), [debian](https://salsa.debian.org/science-team/sagemath/tree/master/debian) or [arch linux](https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath) already solved the problem. You can then again add a `fetchpatch` to `sage-src.nix`. If applicable you should also [propose the patch upstream](#proposing-a-sage-patch).
- fix the problem yourself. First clone the sagemath source and then check out the sage version you want to patch:
```
[user@localhost ~]$ git clone git://github.com/sagemath/sage.git
[user@localhost ~]$ cd sage
[user@localhost sage]$ git checkout 8.2 # substitute the relevant version here
```
Then make the needed changes and generate a patch with `git diff`:
```
[user@localhost ~]$ <make changes>
[user@localhost ~]$ git diff -u > /path/to/nixpkgs/pkgs/applications/science/math/sage/patches/name-of-patch.patch
```
Now just add the patch to `sage-src.nix` and test your changes. If they fix the problem, [propose them upstream](#proposing-a-sage-patch) and add a link to the trac ticket.
- pin the package version in `default.nix` and add a note that explains why that is necessary.
## Proposing a sage patch
You can [login the sage trac using GitHub](https://trac.sagemath.org/login). Your username will then be `gh-<your-github-name>`. The only other way is to request a trac account via email. After that refer to [git the hard way](http://doc.sagemath.org/html/en/developer/manual_git.html#chapter-manual-git) in the sage documentation. The "easy way" requires a non-GitHub account (requested via email) and a special tool. The "hard way" is really not all that hard if you're a bit familiar with git.
Here's the gist, assuming you want to use ssh key authentication. First, [add your public ssh key](https://trac.sagemath.org/prefs/sshkeys). Then:
```
[user@localhost ~]$ git clone git://github.com/sagemath/sage.git
[user@localhost ~]$ cd sage
[user@localhost sage]$ git remote add trac git@trac.sagemath.org:sage.git -t master
[user@localhost sage]$ git checkout -b u/gh-<your-github-username>/<your-branch-name> develop
[user@localhost sage]$ <make changes>
[user@localhost sage]$ git add .
[user@localhost sage]$ git commit
[user@localhost sage]$ git show # review your changes
[user@localhost sage]$ git push --set-upstream trac u/gh-<your-github-username>/<your-branch-name>
```
You now created a branch on the trac server (you *must* follow the naming scheme as you only have push access to branches with the `u/gh-<your-github-username>/` prefix).
Now you can [create a new trac ticket](https://trac.sagemath.org/newticket).
- Write a description of the change
- set the type and component as appropriate
- write your real name in the "Authors" field
- write `u/gh-<your-github-username>/<your-branch-name>` in the "Branch" field
- click "Create ticket"
- click "Modify" on the top right of your ticket (for some reason you can only change the ticket status after you have created it)
- set the ticket status from `new` to `needs_review`
- click "Save changes"
Refer to sages [Developer's Guide](http://doc.sagemath.org/html/en/developer/index.html) for further details.
## I want to update sage
You'll need to change the `version` field in `sage-src.nix`. Afterwards just try to build and let nix tell you which patches no longer apply (hopefully because they were adopted upstream). Remove those.
Hopefully the build will succeed now. If it doesn't and the problem is obvious, fix it as described in [The sage build is broken](#the-sage-build-is-broken).
If the problem is not obvious, you can try to first update sage to an intermediate version (remember that you can also set the `version` field to any git revision of sage) and locate the sage commit that introduced the issue. You can even use `git-bisect` for that (it will only be a bit tricky to keep track of which patches to apply). Hopefully after that the issue will be obvious.
## Well, that didn't help!
If you couldn't fix the problem, create a GitHub issue on the nixpkgs repo and ping @timokau (or whoever is listed in the `maintainers` list of the sage package).
Describe what you did and why it didn't work. Afterwards it would be great if you help the next guy out and improve this documentation!

View File

@ -1,230 +1,211 @@
# TODO
# - consider writing a script to convert spkgs to nix packages, similar to vim
# or cabal2nix. This would allow a more efficient and "cleaner" build, greater
# flexibility and the possibility to select which dependencies to add and which
# to remove. It would also allow to use system packages for some dependencies
# and recompile others (optimized for the system) without recompiling everything.
# - add optdeps:
# - imagemagick
# - texlive full for documentation
# - ...
# - further seperate build outputs. Also maybe run `make doc`.
# Configure flags like --bindir and --libdir oculd also be used for that, see
# ./configure --help`.
# Other resources:
# - https://wiki.debian.org/DebianScience/Sage
# - https://github.com/cschwan/sage-on-gentoo
# - https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath
{ stdenv
, bash
, fetchurl
, perl
, gfortran6
, python
, autoreconfHook
, gettext
, which
, texlive
, texinfo
, hevea
, buildDocs ? false
, optimize ? false # optimize sage to the current system (obviously impure)
{ nixpkgs
, withDoc ? false
}:
stdenv.mkDerivation rec {
version = "8.1";
name = "sage-${version}";
let
inherit (nixpkgs) fetchpatch fetchurl symlinkJoin fetchFromGitHub callPackage nodePackages_8_x;
# Modified version of patchShebangs that patches to the sage-internal version if possible
# and falls back to the system version if not.
patchSageShebangs = ./patchSageShebangs.sh;
src = fetchurl {
# Note that the source is *not* fetched from github, since that doesn't
# the upstream folder with all the source tarballs of the spkgs.
# If those are not present they are fetched at build time, which breaks
# when building in a sandbox (and probably only works if you install the
# latest sage version).
urls = [
"http://mirrors.mit.edu/sage/src/sage-${version}.tar.gz"
"ftp://ftp.fu-berlin.de/unix/misc/sage/src/sage-${version}.tar.gz"
"http://sagemath.polytechnic.edu.na/src/sage-${version}.tar.gz"
"ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/src/sage-${version}.tar.gz"
"http://sagemath.mirror.ac.za/src/sage-${version}.tar.gz"
"https://ftp.leg.uct.ac.za/pub/packages/sage/src/sage-${version}.tar.gz"
"http://mirror.ufs.ac.za/sagemath/src/sage-${version}.tar.gz"
"https://mirrors-usa.go-parts.com/sage/sagemath/src/sage-${version}.tar.gz"
"http://www.cecm.sfu.ca/sage/src/sage-${version}.tar.gz"
"http://files.sagemath.org/src/sage-${version}.tar.gz"
"https://mirrors.xmission.com/sage/src/sage-${version}.tar.gz"
"http://sagemath.c3sl.ufpr.br/src/sage-${version}.tar.gz"
"http://linorg.usp.br/sage/src/sage-${version}.tar.gz"
"http://mirror.hust.edu.cn/sagemath/src/sage-${version}.tar.gz"
"https://ftp.iitm.ac.in/sage/src/sage-${version}.tar.gz"
"http://ftp.kaist.ac.kr/sage/src/sage-${version}.tar.gz"
"https://ftp.riken.jp/sagemath/src/sage-${version}.tar.gz"
"https://mirrors.tuna.tsinghua.edu.cn/sagemath/src/sage-${version}.tar.gz"
"https://mirrors.ustc.edu.cn/sagemath/src/sage-${version}.tar.gz"
"http://ftp.tsukuba.wide.ad.jp/software/sage/src/sage-${version}.tar.gz"
"https://ftp.yz.yamagata-u.ac.jp/pub/math/sage/src/sage-${version}.tar.gz"
"https://mirror.yandex.ru/mirrors/sage.math.washington.edu/src/sage-${version}.tar.gz"
"https://mirror.aarnet.edu.au/pub/sage/src/sage-${version}.tar.gz"
"https://sage.mirror.garr.it/mirrors/sage/src/sage-${version}.tar.gz"
"https://www.mirrorservice.org/sites/www.sagemath.org/src/sage-${version}.tar.gz"
"http://mirror.switch.ch/mirror/sagemath/src/sage-${version}.tar.gz"
"https://mirrors.up.pt/pub/sage/src/sage-${version}.tar.gz"
"http://www-ftp.lip6.fr/pub/math/sagemath/src/sage-${version}.tar.gz"
"http://ftp.ntua.gr/pub/sagemath/src/sage-${version}.tar.gz"
# https://trac.sagemath.org/ticket/15980 for tracking of python3 support
python = nixpkgs.python2.override {
packageOverrides = self: super: {
cypari2 = super.cypari2.override { inherit pari; };
cysignals = super.cysignals.override { inherit pari; };
cvxopt = super.cvxopt.override { inherit glpk; };
# https://github.com/sagemath/sagenb/issues/437
flask-babel = super.flask-babel.overridePythonAttrs (attrs: rec {
version = "0.9";
src = attrs.src.override {
inherit version;
sha256 = "0k7vk4k54y55ma0nx2k5s0phfqbriwslhy5shh3b0d046q7ibzaa";
};
doCheck = false;
});
# python packages that appear unmaintained and were not accepted into the nixpkgs
# tree because of that. These packages are only dependencies of the more-or-less
# deprecated sagenb. However sagenb is still a default dependency and the doctests
# depend on it.
# See https://github.com/NixOS/nixpkgs/pull/38787 for a discussion.
flask-oldsessions = self.callPackage ./flask-oldsessions.nix {};
flask-openid = self.callPackage ./flask-openid.nix {};
python-openid = self.callPackage ./python-openid.nix {};
pybrial = self.callPackage ./pybrial.nix {};
sagelib = self.callPackage ./sagelib.nix {
inherit flint ecl pari glpk eclib;
inherit sage-src openblas-blas-pc openblas-cblas-pc openblas-lapack-pc pynac singular;
linbox = nixpkgs.linbox.override { withSage = true; };
};
sagenb = self.callPackage ./sagenb.nix {
mathjax = nodePackages_8_x.mathjax;
};
sagedoc = self.callPackage ./sagedoc.nix {
inherit sage-src;
};
env-locations = self.callPackage ./env-locations.nix {
inherit pari_data ecl pari;
inherit singular;
three = nodePackages_8_x.three;
mathjax = nodePackages_8_x.mathjax;
};
sage-env = self.callPackage ./sage-env.nix {
inherit sage-src python rWrapper openblas-cblas-pc glpk ecl singular eclib pari palp flint pynac pythonEnv;
pkg-config = nixpkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig
};
sage-with-env = self.callPackage ./sage-with-env.nix {
inherit pari eclib pythonEnv;
inherit sage-src openblas-blas-pc openblas-cblas-pc openblas-lapack-pc pynac singular;
pkg-config = nixpkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig
three = nodePackages_8_x.three;
};
sage = self.callPackage ./sage.nix { };
sage-wrapper = self.callPackage ./sage-wrapper.nix {
inherit sage-src withDoc;
};
};
};
openblas-blas-pc = callPackage ./openblas-pc.nix { name = "blas"; };
openblas-cblas-pc = callPackage ./openblas-pc.nix { name = "cblas"; };
openblas-lapack-pc = callPackage ./openblas-pc.nix { name = "lapack"; };
sage-src = callPackage ./sage-src.nix {};
pythonRuntimeDeps = with python.pkgs; [
sagelib
pybrial
sagenb
cvxopt
networkx
service-identity
psutil
sympy
fpylll
matplotlib
scipy
ipywidgets
rpy2
sphinx
typing
pillow
];
pythonEnv = python.buildEnv.override {
extraLibs = pythonRuntimeDeps;
ignoreCollisions = true;
} // { extraLibs = pythonRuntimeDeps; }; # make the libs accessible
# needs to be rWrapper, standard "R" doesn't include default packages
rWrapper = nixpkgs.rWrapper.override {
# https://trac.sagemath.org/ticket/25674
R = nixpkgs.R.overrideAttrs (attrs: rec {
name = "R-3.4.4";
src = fetchurl {
url = "http://cran.r-project.org/src/base/R-3/${name}.tar.gz";
sha256 = "0dq3jsnwsb5j3fhl0wi3p5ycv8avf8s5j1y4ap3d2mkjmcppvsdk";
};
});
};
# update causes issues
# https://groups.google.com/forum/#!topic/sage-packaging/cS3v05Q0zso
# https://trac.sagemath.org/ticket/24735
singular = nixpkgs.singular.overrideAttrs (oldAttrs: {
name = "singular-4.1.0p3";
src = fetchurl {
url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/4-1-0/singular-4.1.0p3.tar.gz";
sha256 = "105zs3zk46b1cps403ap9423rl48824ap5gyrdgmg8fma34680a4";
};
});
# *not* to confuse with the python package "pynac"
# https://trac.sagemath.org/ticket/24838 (depends on arb update)
pynac = nixpkgs.pynac.override { inherit singular; };
eclib = nixpkgs.eclib.override { inherit pari; };
# With openblas (64 bit), the tests fail the same way as when sage is build with
# openblas instead of openblasCompat. Apparently other packages somehow use flints
# blas when it is available. Alternative would be to override flint to use
# openblasCompat.
flint = nixpkgs.flint.override { withBlas = false; };
# Multiple palp dimensions need to be available and sage expects them all to be
# in the same folder.
palp = symlinkJoin {
name = "palp-${nixpkgs.palp.version}";
paths = [
(nixpkgs.palp.override { dimensions = 4; doSymlink = false; })
(nixpkgs.palp.override { dimensions = 5; doSymlink = false; })
(nixpkgs.palp.override { dimensions = 6; doSymlink = true; })
(nixpkgs.palp.override { dimensions = 11; doSymlink = false; })
];
sha256 = "1cpcs1mr0yii64s152xmxyd450bfzjb22jjj0zh9y3n6g9alzpyq";
};
postPatch = ''
substituteAllInPlace src/bin/sage-env
bash=${bash} substituteAllInPlace build/bin/sage-spkg
'';
installPhase = ''
# Sage installs during first `make`, `make install` is no-op and just takes time.
'';
outputs = [ "out" ] ++ stdenv.lib.optionals (buildDocs) [ "doc" ];
buildInputs = [
bash # needed for the build
perl # needed for the build
python # needed for the build
gfortran6 # needed to build giac, openblas
autoreconfHook # needed to configure sage with prefix
gettext # needed to build the singular spkg
which # needed in configure of mpir
texinfo # needed to build maxima
] ++ stdenv.lib.optionals(buildDocs) [
hevea # needed to build the docs of the giac spkg
(texlive.combine { inherit (texlive)
scheme-basic
collection-pstricks # needed by giac
times # font needed by giac
stmaryrd # needed by giac
babel-greek # optional for giac, otherwise throws a bunch of latex command not founds
;
})
];
nativeBuildInputs = [ gfortran6 perl which ];
patches = [
# fix usages of /bin/rm
./spkg-singular.patch
# help python find the crypt library
# patches python3 and indirectly python2, since those installation files are symlinked
./spkg-python.patch
# fix usages of /usr/bin/perl
./spkg-git.patch
# fix usages of /bin/cp and add necessary argument to function call
./spkg-giac.patch
# environment
./env.patch
# adjust wrapper shebang and patch shebangs after each spkg build
./shebangs.patch
];
enableParallelBuilding = true;
hardeningDisable = [
"format" # needed to build palp, for lines like `printf(ctime(&_NFL->TIME))`
# TODO could be patched with `sed s|printf(ctime(\(.*\)))|%s... or fixed upstream
];
configureFlags = stdenv.lib.optionals(buildDocs) [ "--docdir=$(doc)" ];
preConfigure = ''
export SAGE_NUM_THREADS="$NIX_BUILD_CORES"
export HOME=/tmp/sage-home
export SAGE_ROOT="$PWD"
export SAGE_SRC="$PWD"
mkdir -p "$HOME"
mkdir -p "$out"
# we need to keep the source around
dir="$PWD"
cd ..
mv "$dir" "$out/sage-root"
export SAGE_SPKG_INSTALL_DOCS='no'
cd "$out/sage-root" # build in target dir, since `make` is also `make install`
''
+ stdenv.lib.optionalString (buildDocs) ''
mkdir -p "$doc"
export SAGE_DOC="$doc"
export SAGE_DOCBUILD_OPTS="--no-pdf-links -k"
''
+ stdenv.lib.optionalString (!optimize) ''
export SAGE_FAT_BINARY=yes
'';
buildFlags = if (buildDocs) then "doc" else "build";
# for reference: http://doc.sagemath.org/html/en/installation/source.html
preBuild = ''
# symlink python to make sure the shebangs are patched to the sage path
# while still being able to use python before building it
# (this is important because otherwise sage will try to install python
# packages globally later on)
ln -s "${python}/bin/python2" $out/bin/python2
ln -s "$out/bin/python2" $out/bin/python
touch $out/bin/python3
bash $patchSageShebangs .
'';
postBuild = ''
# Clean up
rm -r "$out/sage-root/upstream" # don't keep the sources of all the spkgs
rm -rf "$out/sage-root/src/build"
rm -rf "$out/sage-root/src/autom4te.cache"
rm -rf "$out/sage-root/src/config"
rm -rf "$out/sage-root/src/m4"
rm -rf "$out/sage-root/.git"
rm -r "$out/sage-root/logs"
rm -r "$out"/lib/python*/test
# Fix dependency cycle between out and doc
rm -f "$out/sage-root/config.log"
rm -f "$out/sage-root/config.status"
rm -f "$out/sage-root/build/make/Makefile-auto"
rm -f "$out/sage-home/.sage/gap/libgap-workspace-"*
# Make sure unnessessary packages don't end up in the build closure
find "$out" \
-iname 'config.log' \
-delete \
-or -iname 'Makefile' \
-delete
rm -f "$out/lib/R/etc/Renviron"
# Make sure all shebangs are properly patched
bash $patchSageShebangs $out
'';
# TODO there are some doctest failures, which seem harmless.
# We should figure out a way to fix the failures or ignore only those tests.
doCheck = false;
checkTarget = "ptestalllong"; # all long tests in parallell
preCheck = ''
export SAGE_TIMEOUT=0 # no timeout
export SAGE_TIMEOUT_LONG=0 # no timeout
'';
meta = {
homepage = http://www.sagemath.org;
description = "A free open source mathematics software system";
# taken from the homepage
longDescription = ''
SageMath is a free open-source mathematics software system licensed under the GPL. It builds on top of many existing open-source packages: NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined power through a common, Python-based language or directly via interfaces or wrappers.
Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.
'';
license = stdenv.lib.licenses.gpl2Plus;
platforms = ["x86_64-linux" "i686-linux"];
maintainers = with stdenv.lib.maintainers; [ timokau ];
# Sage expects those in the same directory.
pari_data = symlinkJoin {
name = "pari_data";
paths = with nixpkgs; [
pari-galdata
pari-seadata-small
];
};
}
# https://trac.sagemath.org/ticket/22191
ecl = nixpkgs.ecl_16_1_2;
# sage currently uses an unreleased version of pari
pari = (nixpkgs.pari.override { withThread = false; }).overrideAttrs (attrs: rec {
version = "2.10-1280-g88fb5b3"; # on update remove pari-stackwarn patch from `sage-src.nix`
src = fetchurl {
url = "mirror://sageupstream/pari/pari-${version}.tar.gz";
sha256 = "19gbsm8jqq3hraanbmsvzkbh88iwlqbckzbnga3y76r7k42akn7m";
};
});
# https://trac.sagemath.org/ticket/24824
glpk = nixpkgs.glpk.overrideAttrs (attrs: rec {
version = "4.63";
name = "glpk-${version}";
src = fetchurl {
url = "mirror://gnu/glpk/${name}.tar.gz";
sha256 = "1xp7nclmp8inp20968bvvfcwmz3mz03sbm0v3yjz8aqwlpqjfkci";
};
patches = (attrs.patches or []) ++ [
# Alternatively patch sage with debians
# https://sources.debian.org/data/main/s/sagemath/8.1-7/debian/patches/t-version-glpk-4.60-extra-hack-fixes.patch
# The header of that debian patch contains a good description of the issue. The gist of it:
# > If GLPK in Sage causes one error, and this is caught by Sage and recovered from, then
# > later (because upstream GLPK does not clear the "error" flag) Sage will append
# > all subsequent terminal output of GLPK into the error_message string but not
# > actually forward it to the user's terminal. This breaks some doctests.
(fetchpatch {
name = "error_recovery.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/glpk/patches/error_recovery.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "0z99z9gd31apb6x5n5n26411qzx0ma3s6dnznc4x61x86bhq31qf";
})
# Allow setting a exact verbosity level (OFF|ERR|ON|ALL|DBG)
(fetchpatch {
name = "exact_verbosity.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/glpk/patches/glp_exact_verbosity.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "15gm5i2alqla3m463i1qq6jx6c0ns6lip7njvbhp37pgxg4s9hx8";
})
];
});
in
python.pkgs.sage-wrapper // {
doc = python.pkgs.sagedoc;
lib = python.pkgs.sagelib;
}

View File

@ -0,0 +1,46 @@
{ stdenv
, writeTextFile
, pari_data
, pari
, singular
, maxima-ecl
, conway_polynomials
, graphs
, elliptic_curves
, polytopes_db
, gap-libgap-compatible
, ecl
, combinatorial_designs
, jmol
, mathjax
, three
, cysignals
}:
writeTextFile rec {
name = "sage-env-locations";
destination = "/${name}";
text = ''
export GP_DATA_DIR="${pari_data}/share/pari"
export PARI_DATA_DIR="${pari_data}"
export GPHELP="${pari}/bin/gphelp"
export GPDOCDIR="${pari}/share/pari/doc"
export SINGULARPATH='${singular}/share/singular'
export SINGULAR_SO='${singular}/lib/libSingular.so'
export SINGULAR_EXECUTABLE='${singular}/bin/Singular'
export MAXIMA_FAS='${maxima-ecl}/lib/maxima/${maxima-ecl.version}/binary-ecl/maxima.fas'
export MAXIMA_PREFIX="${maxima-ecl}"
export CONWAY_POLYNOMIALS_DATA_DIR='${conway_polynomials}/share/conway_polynomials'
export GRAPHS_DATA_DIR='${graphs}/share/graphs'
export ELLCURVE_DATA_DIR='${elliptic_curves}/share/ellcurves'
export POLYTOPE_DATA_DIR='${polytopes_db}/share/reflexive_polytopes'
export GAP_ROOT_DIR='${gap-libgap-compatible}/share/gap/build-dir'
export ECLDIR='${ecl}/lib/ecl-${ecl.version}/'
export COMBINATORIAL_DESIGN_DATA_DIR="${combinatorial_designs}/share/combinatorial_designs"
export CREMONA_MINI_DATA_DIR="${elliptic_curves}/share/cremona"
export JMOL_DIR="${jmol}"
export MATHJAX_DIR="${mathjax}/lib/node_modules/mathjax"
export THREEJS_DIR="${three}/lib/node_modules/three"
export SAGE_INCLUDE_DIRECTORIES="${cysignals}/lib/python2.7/site-packages"
'';
}

View File

@ -1,22 +0,0 @@
diff --git a/src/bin/sage-env b/src/bin/sage-env
index ead308f861..ed8db9f9b7 100644
--- a/src/bin/sage-env
+++ b/src/bin/sage-env
@@ -111,6 +111,8 @@ resolvelinks() {
}
+SAGE_ROOT="@out@/sage-root"
+
# New value for SAGE_ROOT: either SAGE_ROOT (if given)
# or a guessed value based on pwd.
if [ -n "$SAGE_ROOT" ]; then
@@ -185,6 +187,8 @@ fi
export SAGE_ENV_SOURCED=$SAGE_ENV_VERSION
export SAGE_ROOT="$NEW_SAGE_ROOT"
+export SAGE_LOCAL='@out@/'
+export PYTHONPATH="@out@/lib/python2.7/site-packages:$PYTHONPATH"
# sage-env must know where the Sage's script files are.

View File

@ -1,11 +0,0 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p curl go-pup
# Fetches a list of all available source mirrors from the sage homepage.
# Note that the list is sorted by country, but fetchurl doesn't offer an option
# to customize mirror preference.
curl -s http://www.sagemath.org/download-source.html \
| pup 'table#mirror' \
| pup 'a attr{href}' \
| sed -e 's/index\.html/sage-${version}.tar.gz/'

View File

@ -0,0 +1,36 @@
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, python
, flask
}:
buildPythonPackage rec {
pname = "Flask-OldSessions";
version = "0.10";
# no artifact on pypi: https://github.com/mitsuhiko/flask-oldsessions/issues/1
src = fetchFromGitHub {
owner = "mitsuhiko";
repo = "flask-oldsessions";
rev = "${version}";
sha256 = "04b5m8njjiwld9a0zw55iqwvyjgwcpdbhz1cic8nyhgcmypbicqn";
};
propagatedBuildInputs = [
flask
];
# missing module flask.testsuite, probably assumes an old version of flask
doCheck = false;
checkPhase = ''
${python.interpreter} run-tests.py
'';
meta = with stdenv.lib; {
description = "Provides a session class that works like the one in Flask before 0.10.";
license = licenses.bsd2;
maintainers = with maintainers; [ timokau ];
homepage = https://github.com/mitsuhiko/flask-oldsessions;
};
}

View File

@ -0,0 +1,28 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, flask
, python-openid
}:
buildPythonPackage rec {
pname = "Flask-OpenID";
version = "1.2.5";
src = fetchPypi {
inherit pname version;
sha256 = "1aycwmwi7ilcaa5ab8hm0bp6323zl8z25q9ha0gwrl8aihfgx3ss";
};
propagatedBuildInputs = [
flask
python-openid
];
meta = with stdenv.lib; {
description = "Adds openid support to flask applications";
license = licenses.bsd2;
maintainers = with maintainers; [ timokau ];
homepage = https://pythonhosted.org/Flask-OpenID/;
};
}

View File

@ -0,0 +1,18 @@
{ stdenv
, openblasCompat
, writeTextFile
, name
}:
writeTextFile {
name = "openblas-${name}-pc-${openblasCompat.version}";
destination = "/lib/pkgconfig/${name}.pc";
text = ''
Name: ${name}
Version: ${openblasCompat.version}
Description: ${name} for SageMath, provided by the OpenBLAS package.
Cflags: -I${openblasCompat}/include
Libs: -L${openblasCompat}/lib -lopenblas
'';
}

View File

@ -1,51 +0,0 @@
# This is a slightly modified version of nix's default patchShebangs
dir="$1"
echo "patching sage internal script interpreter paths in $( readlink -f "$dir")"
find "$dir" -type f -perm -0100 | while read f; do
if [ "$(head -1 "$f" | head -c+2)" != '#!' ]; then
# missing shebang => not a script
continue
fi
oldInterpreterLine=$(head -1 "$f" | tail -c+3)
read -r oldPath arg0 args <<< "$oldInterpreterLine"
if $(echo "$oldPath" | grep -q "/bin/env$"); then
# Check for unsupported 'env' functionality:
# - options: something starting with a '-'
# - environment variables: foo=bar
if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then
echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)"
exit 1
fi
executable="$arg0"
else
if [ "$oldPath" = "" ]; then
# If no interpreter is specified linux will use /bin/sh. Set
# oldpath="/bin/sh" so that we get /nix/store/.../sh.
oldPath="/bin/sh"
fi
executable="$(basename "$oldPath")"
args="$arg0 $args"
fi
newPath="$(echo "$out/bin/$executable $args" | sed 's/[[:space:]]*$//')"
if [[ ! -x "$newPath" ]] ; then
newPath="$(command -v "$executable" || true)"
fi
# Strip trailing whitespace introduced when no arguments are present
newInterpreterLine="$(echo "$newPath $args" | sed 's/[[:space:]]*$//')"
if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then
if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then
echo "$f: sage interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""
# escape the escape chars so that sed doesn't interpret them
escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g')
sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"
fi
fi
done

View File

@ -0,0 +1,427 @@
commit c885927e25b29bd23869e02379c2918da430323e
Author: Timo Kaufmann <timokau@zoho.com>
Date: Sat Jun 30 02:26:15 2018 +0200
diff --git a/build/pkgs/arb/checksums.ini b/build/pkgs/arb/checksums.ini
index 1924ee03c3..9323b97391 100644
--- a/build/pkgs/arb/checksums.ini
+++ b/build/pkgs/arb/checksums.ini
@@ -1,4 +1,4 @@
tarball=arb-VERSION.tar.gz
-sha1=27476d0529e48a07d92da90bd0fb80dd18f443e3
-md5=733285d9705d10b8024e551ffa81952f
-cksum=2391183744
+sha1=44eda7bf8eaa666c45b1fc2c1b5bd08756d94b58
+md5=fa24de9fffe4394fb6a7a6792e2ecc5f
+cksum=3689220688
diff --git a/build/pkgs/arb/package-version.txt b/build/pkgs/arb/package-version.txt
index c8810e9bdb..fb2c0766b7 100644
--- a/build/pkgs/arb/package-version.txt
+++ b/build/pkgs/arb/package-version.txt
@@ -1 +1 @@
-2.12.0.p0
+2.13.0
diff --git a/build/pkgs/arb/patches/arb-pie-hardening-conflict.patch b/build/pkgs/arb/patches/arb-pie-hardening-conflict.patch
deleted file mode 100644
index 3e5c0e708b..0000000000
--- a/build/pkgs/arb/patches/arb-pie-hardening-conflict.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-In newer binutils, ld options -r and -pie conflict.
-Patch due to Jörg-Volker Peetz
-(source : https://groups.google.com/d/msg/sage-devel/TduebNoZuBE/sEULolL0BQAJ),
-packaged by Emmanuel Charpentier
-
-diff -ru arb-2.8.1-orig/Makefile.subdirs arb-2.8.1-new/Makefile.subdirs
---- arb-2.8.1-orig/Makefile.subdirs 2015-12-31 17:30:01.000000000 +0100
-+++ arb-2.8.1-new/Makefile.subdirs 2016-11-07 18:50:34.540051779 +0100
-@@ -52,7 +52,7 @@
- $(QUIET_CC) $(CC) $(CFLAGS) $(INCS) -c $< -o $@ -MMD -MP -MF "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$@"
-
- $(MOD_LOBJ): $(LOBJS)
-- $(QUIET_CC) $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
-+ $(QUIET_CC) $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
-
- -include $(LOBJS:.lo=.d)
-
diff --git a/src/sage/rings/complex_arb.pyx b/src/sage/rings/complex_arb.pyx
index 70d51e655a..00e7caea2c 100644
--- a/src/sage/rings/complex_arb.pyx
+++ b/src/sage/rings/complex_arb.pyx
@@ -857,14 +857,14 @@ class ComplexBallField(UniqueRepresentation, Field):
[0.500000000000000 +/- 2.09e-16]
sage: CBF.integral(lambda x, _: x.gamma(), 1 - CBF(i), 1 + CBF(i))
- [+/- 3.95e-15] + [1.5723926694981 +/- 4.53e-14]*I
+ [+/- 4...e-15] + [1.5723926694981 +/- 4...e-14]*I
sage: C = ComplexBallField(100)
sage: C.integral(lambda x, _: x.cos() * x.sin(), 0, 1)
[0.35403670913678559674939205737 +/- 8.89e-30]
sage: CBF.integral(lambda x, _: (x + x.exp()).sin(), 0, 8)
- [0.34740017266 +/- 6.36e-12]
+ [0.34740017266 +/- 6...e-12]
sage: C = ComplexBallField(2000)
sage: C.integral(lambda x, _: (x + x.exp()).sin(), 0, 8) # long time
@@ -879,14 +879,14 @@ class ComplexBallField(UniqueRepresentation, Field):
....: else:
....: return z.sqrt()
sage: CBF.integral(my_sqrt, -1 + CBF(i), -1 - CBF(i))
- [+/- 1.14e-14] + [-0.4752076627926 +/- 5.18e-14]*I
+ [+/- 1.14e-14] + [-0.4752076627926 +/- 5...e-14]*I
Note, though, that proper handling of the ``analytic`` flag is required
even when the path does not touch the branch cut::
sage: correct = CBF.integral(my_sqrt, 1, 2); correct
[1.21895141649746 +/- 3.73e-15]
- sage: RBF(integral(sqrt(x), x, 1, 2))
+ sage: RBF(integral(sqrt(x), x, 1, 2)) # long time
[1.21895141649746 +/- 1.79e-15]
sage: wrong = CBF.integral(lambda z, _: z.sqrt(), 1, 2) # WRONG!
sage: correct - wrong
@@ -915,9 +915,9 @@ class ComplexBallField(UniqueRepresentation, Field):
the integrand is unbounded::
sage: CBF.integral(lambda x, _: 1/x, -1, 1)
- [+/- inf] + [+/- inf]*I
+ nan + nan*I
sage: CBF.integral(lambda x, _: 1/x, 10^-1000, 1)
- [+/- inf] + [+/- inf]*I
+ nan + nan*I
sage: CBF.integral(lambda x, _: 1/x, 10^-1000, 1, abs_tol=1e-10)
[2302.5850930 +/- 1.26e-8]
@@ -928,14 +928,15 @@ class ComplexBallField(UniqueRepresentation, Field):
sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, abs_tol=1e-450)
[2.304377150950e-439 +/- 9.74e-452]
sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, abs_tol=0)
- [2.304377150949e-439 +/- 7.53e-452]
- sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, rel_tol=1e-4, abs_tol=0)
- [2.30438e-439 +/- 3.90e-445]
+ [2.304377150950e-439 +/- 7...e-452]
+ sage: CBF.integral(lambda x, _: x.exp(), -1020, -1010, rel_tol=1e-2, abs_tol=0)
+ [2.30438e-439 +/- 5.94e-445]
- sage: CBF.integral(lambda x, _: x*(1/x).sin(), 0, 1)
- [+/- 0.644]
- sage: CBF.integral(lambda x, _: x*(1/x).sin(), 0, 1, use_heap=True)
- [0.3785300 +/- 4.32e-8]
+ sage: epsi = CBF(1e-10)
+ sage: CBF.integral(lambda x, _: x*(1/x).sin(), epsi, 1)
+ [0.38 +/- 8.54e-3]
+ sage: CBF.integral(lambda x, _: x*(1/x).sin(), epsi, 1, use_heap=True)
+ [0.37853002 +/- 8.73e-9]
ALGORITHM:
@@ -951,12 +952,12 @@ class ComplexBallField(UniqueRepresentation, Field):
sage: i = QuadraticField(-1).gen()
sage: CBF.integral(lambda x, _: (1 + i*x).gamma(), -1, 1)
- [1.5723926694981 +/- 4.53e-14] + [+/- 3.95e-15]*I
+ [1.5723926694981 +/- 4...e-14] + [+/- 4...e-15]*I
- sage: ComplexBallField(10000).integral(lambda x, _: x.sin(), 0, 1, rel_tol=1e-400)
- [0.459... +/- ...e-4...]
+ sage: ComplexBallField(10000).integral(lambda x, _: x.sin(), 0, 1, rel_tol=1e-300)
+ [0.459... +/- ...e-3...]
sage: CBF.integral(lambda x, _: x.sin(), 0, 100, rel_tol=10)
- [+/- 7.61]
+ [0.138 +/- 5.53e-4]
sage: ComplexBallField(10000).integral(lambda x, _: x.sin(), 0, 1, abs_tol=1e-400)
[0.459697... +/- ...e-4...]
@@ -2389,9 +2390,9 @@ cdef class ComplexBall(RingElement):
sage: ~CBF(i/3)
[-3.00000000000000 +/- 9.44e-16]*I
sage: ~CBF(0)
- [+/- inf]
+ nan
sage: ~CBF(RIF(10,11))
- [0.1 +/- 9.53e-3]
+ [0.1 +/- 9.10e-3]
"""
cdef ComplexBall res = self._new()
if _do_sig(prec(self)): sig_on()
@@ -2512,9 +2513,9 @@ cdef class ComplexBall(RingElement):
sage: CBF(-2, 1)/CBF(1, 1/3)
[-1.500000000000000 +/- 8.83e-16] + [1.500000000000000 +/- 5.64e-16]*I
sage: CBF(2+I)/CBF(0)
- [+/- inf] + [+/- inf]*I
+ nan + nan*I
sage: CBF(1)/CBF(0)
- [+/- inf]
+ nan
sage: CBF(1)/CBF(RBF(0, 1.))
nan
"""
@@ -2543,9 +2544,9 @@ cdef class ComplexBall(RingElement):
sage: CBF(0)^(1/3)
0
sage: CBF(0)^(-1)
- [+/- inf]
+ nan
sage: CBF(0)^(-2)
- [+/- inf] + [+/- inf]*I
+ nan + nan*I
TESTS::
@@ -2656,12 +2657,12 @@ cdef class ComplexBall(RingElement):
sage: CBF(1).rising_factorial(5)
120.0000000000000
sage: CBF(1/3, 1/2).rising_factorial(300)
- [-3.87949484514e+612 +/- 5.23e+600] + [-3.52042209763e+612 +/- 5.55e+600]*I
+ [-3.87949484514e+612 +/- 5...e+600] + [-3.52042209763e+612 +/- 5...e+600]*I
sage: CBF(1).rising_factorial(-1)
nan
sage: CBF(1).rising_factorial(2**64)
- [+/- 2.30e+347382171305201370464]
+ [+/- 2.30e+347382171326740403407]
sage: ComplexBallField(128)(1).rising_factorial(2**64)
[2.343691126796861348e+347382171305201285713 +/- 4.71e+347382171305201285694]
sage: CBF(1/2).rising_factorial(CBF(2,3))
@@ -2700,7 +2701,7 @@ cdef class ComplexBall(RingElement):
[1.000000000000000 +/- 2.83e-16] + [-0.441271200305303 +/- 2.82e-16]*I
sage: CBF('inf').log()
- nan + nan*I
+ [+/- inf]
sage: CBF(2).log(0)
nan + nan*I
"""
@@ -2808,7 +2809,7 @@ cdef class ComplexBall(RingElement):
sage: CBF(pi/2, 1/10).tan()
[+/- 2.87e-14] + [10.0333111322540 +/- 2.36e-14]*I
sage: CBF(pi/2).tan()
- [+/- inf]
+ nan
"""
cdef ComplexBall res = self._new()
if _do_sig(prec(self)): sig_on()
@@ -2825,7 +2826,7 @@ cdef class ComplexBall(RingElement):
sage: CBF(pi, 1/10).cot()
[+/- 5.74e-14] + [-10.0333111322540 +/- 2.81e-14]*I
sage: CBF(pi).cot()
- [+/- inf]
+ nan
"""
cdef ComplexBall res = self._new()
if _do_sig(prec(self)): sig_on()
@@ -3211,9 +3212,9 @@ cdef class ComplexBall(RingElement):
1.000000000000000*I
sage: CBF(2+3*I).hypergeometric([1/4,1/3],[1/2])
- [0.7871684267473 +/- 7.34e-14] + [0.2749254173721 +/- 9.23e-14]*I
+ [0.7871684267473 +/- 7...e-14] + [0.2749254173721 +/- 9...e-14]*I
sage: CBF(2+3*I).hypergeometric([1/4,1/3],[1/2],regularized=True)
- [0.4441122268685 +/- 3.96e-14] + [0.1551100567338 +/- 5.75e-14]*I
+ [0.4441122268685 +/- 3...e-14] + [0.1551100567338 +/- 5...e-14]*I
sage: CBF(5).hypergeometric([2,3], [-5])
nan + nan*I
@@ -4041,9 +4042,9 @@ cdef class ComplexBall(RingElement):
sage: phi = CBF(1,1)
sage: (CBF.pi()/2).elliptic_e_inc(phi)
- [1.283840957898 +/- 3.23e-13] + [-0.5317843366915 +/- 7.79e-14]*I
+ [1.283840957898 +/- 3...e-13] + [-0.5317843366915 +/- 7...e-14]*I
sage: phi.elliptic_e()
- [1.2838409578982 +/- 5.90e-14] + [-0.5317843366915 +/- 3.35e-14]*I
+ [1.2838409578982 +/- 5...e-14] + [-0.5317843366915 +/- 3...e-14]*I
sage: phi = CBF(2, 3/7)
sage: (CBF.pi()/2).elliptic_e_inc(phi)
@@ -4312,8 +4313,7 @@ cdef class ComplexBall(RingElement):
sage: CBF(10).laguerre_L(3, 2)
[-6.666666666667 +/- 4.15e-13]
sage: CBF(5,7).laguerre_L(CBF(2,3), CBF(1,-2))
- [5515.315030271 +/- 4.37e-10] + [-12386.942845271 +/- 5.47e-10]*I
-
+ [5515.315030271 +/- 4...e-10] + [-12386.942845271 +/- 5...e-10]*I
"""
cdef ComplexBall my_n = self._parent.coerce(n)
cdef ComplexBall my_m = self._parent.coerce(m)
@@ -4357,9 +4357,9 @@ cdef class ComplexBall(RingElement):
EXAMPLES::
sage: CBF(1/2).legendre_P(5)
- [0.08984375000000000 +/- 4.5...e-18]
+ [0.0898437500000000 +/- 7...e-17]
sage: CBF(1,2).legendre_P(CBF(2,3), CBF(0,1))
- [0.10996180744364 +/- 7.45e-15] + [0.14312767804055 +/- 8.38e-15]*I
+ [0.10996180744364 +/- 7.12e-15] + [0.14312767804055 +/- 8.07e-15]*I
sage: CBF(-10).legendre_P(5, 325/100)
[-22104403.487377 +/- 6.81e-7] + [53364750.687392 +/- 7.25e-7]*I
sage: CBF(-10).legendre_P(5, 325/100, type=3)
@@ -4393,9 +4393,9 @@ cdef class ComplexBall(RingElement):
sage: CBF(1/2).legendre_Q(5)
[0.55508089057168 +/- 2.79e-15]
sage: CBF(1,2).legendre_Q(CBF(2,3), CBF(0,1))
- [0.167678710 +/- 4.60e-10] + [-0.161558598 +/- 7.47e-10]*I
+ [0.167678710 +/- 3.91e-10] + [-0.161558598 +/- 6.77e-10]*I
sage: CBF(-10).legendre_Q(5, 325/100)
- [-83825154.36008 +/- 4.94e-6] + [-34721515.80396 +/- 5.40e-6]*I
+ [-83825154.36008 +/- 5.02e-6] + [-34721515.80396 +/- 5.42e-6]*I
sage: CBF(-10).legendre_Q(5, 325/100, type=3)
[-4.797306921692e-6 +/- 6.82e-19] + [-4.797306921692e-6 +/- 6.57e-19]*I
diff --git a/src/sage/rings/polynomial/polynomial_complex_arb.pyx b/src/sage/rings/polynomial/polynomial_complex_arb.pyx
index c436d4705b..ef611a566b 100644
--- a/src/sage/rings/polynomial/polynomial_complex_arb.pyx
+++ b/src/sage/rings/polynomial/polynomial_complex_arb.pyx
@@ -543,7 +543,7 @@ cdef class Polynomial_complex_arb(Polynomial):
sage: (1 - x/3).inverse_series_trunc(3)
([0.1111111111111111 +/- 5.99e-17])*x^2 + ([0.3333333333333333 +/- 7.04e-17])*x + 1.000000000000000
sage: x.inverse_series_trunc(1)
- [+/- inf]
+ nan
sage: Pol(0).inverse_series_trunc(2)
(nan + nan*I)*x + nan + nan*I
@@ -671,7 +671,7 @@ cdef class Polynomial_complex_arb(Polynomial):
sage: pol._sqrt_series(2)
([+/- 7.51e-3] + [+/- 0.501]*I)*x + [+/- 5.01e-3] + [+/- 1.01]*I
sage: x._sqrt_series(2)
- ([+/- inf] + [+/- inf]*I)*x
+ (nan + nan*I)*x
"""
cdef Polynomial_complex_arb res = self._new()
if n < 0:
diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx
index c9f68e38d7..76e3037a9a 100644
--- a/src/sage/rings/real_arb.pyx
+++ b/src/sage/rings/real_arb.pyx
@@ -161,7 +161,7 @@ values and should be preferred::
sage: RBF(NaN) < RBF(infinity)
False
- sage: 1/RBF(0) <= RBF(infinity)
+ sage: RBF(0).add_error(infinity) <= RBF(infinity)
True
TESTS::
@@ -252,6 +252,8 @@ cdef void mpfi_to_arb(arb_t target, const mpfi_t source, const long precision):
(+infinity, +infinity)
sage: RBF(RIF(-infinity)).endpoints()
(-infinity, -infinity)
+ sage: RBF(RIF(-infinity, infinity)).endpoints()
+ (-infinity, +infinity)
sage: RIF(RBF(infinity)).endpoints()
(+infinity, +infinity)
sage: RIF(RBF(-infinity)).endpoints()
@@ -266,10 +268,11 @@ cdef void mpfi_to_arb(arb_t target, const mpfi_t source, const long precision):
if _do_sig(precision): sig_on()
mpfi_get_left(left, source)
mpfi_get_right(right, source)
- arb_set_interval_mpfr(target, left, right, precision)
- # Work around weakness of arb_set_interval_mpfr(tgt, inf, inf)
- if mpfr_equal_p(left, right):
- mag_zero(arb_radref(target))
+ if mpfr_inf_p(left) and mpfr_inf_p(right) and mpfr_sgn(left) < 0 < mpfr_sgn(right):
+ # Work around a weakness of arb_set_interval_mpfr(tgt, -inf, inf)
+ arb_zero_pm_inf(target)
+ else:
+ arb_set_interval_mpfr(target, left, right, precision)
if _do_sig(precision): sig_off()
mpfr_clear(left)
@@ -649,17 +652,15 @@ class RealBallField(UniqueRepresentation, Field):
EXAMPLES::
sage: RBF.some_elements()
- [1.000000000000000,
- [0.3333333333333333 +/- 7.04e-17],
+ [0, 1.000000000000000, [0.3333333333333333 +/- 7.04e-17],
[-4.733045976388941e+363922934236666733021124 +/- 3.46e+363922934236666733021108],
- [+/- inf],
- [+/- inf],
- nan]
+ [+/- inf], [+/- inf], [+/- inf], nan]
"""
import sage.symbolic.constants
- return [self(1), self(1)/3,
+ inf = self(sage.rings.infinity.Infinity)
+ return [self(0), self(1), self(1)/3,
-self(2)**(Integer(2)**80),
- self(sage.rings.infinity.Infinity), ~self(0),
+ inf, -inf, self.zero().add_error(inf),
self.element_class(self, sage.symbolic.constants.NotANumber())]
def _sum_of_products(self, terms):
@@ -881,7 +882,7 @@ class RealBallField(UniqueRepresentation, Field):
sage: RBF.gamma(5)
24.00000000000000
sage: RBF.gamma(10**20)
- [+/- 5.92e+1956570551809674821757]
+ [+/- 5.50e+1956570552410610660600]
sage: RBF.gamma(1/3)
[2.678938534707747 +/- 8.99e-16]
sage: RBF.gamma(-5)
@@ -2247,7 +2248,7 @@ cdef class RealBall(RingElement):
sage: inf = RBF(+infinity)
sage: other_inf = RBF(+infinity, 42.r)
sage: neg_inf = RBF(-infinity)
- sage: extended_line = 1/RBF(0)
+ sage: extended_line = RBF(0).add_error(infinity)
sage: exact_nan = inf - inf
sage: exact_nan.mid(), exact_nan.rad()
(NaN, 0.00000000)
@@ -2659,7 +2660,7 @@ cdef class RealBall(RingElement):
sage: ~RBF(5)
[0.2000000000000000 +/- 4.45e-17]
sage: ~RBF(0)
- [+/- inf]
+ nan
sage: RBF(RIF(-0.1,0.1))
[+/- 0.101]
@@ -2739,7 +2740,7 @@ cdef class RealBall(RingElement):
sage: RBF(pi)/RBF(e)
[1.155727349790922 +/- 8.43e-16]
sage: RBF(2)/RBF(0)
- [+/- inf]
+ nan
"""
cdef RealBall res = self._new()
if _do_sig(prec(self)): sig_on()
@@ -2765,7 +2766,7 @@ cdef class RealBall(RingElement):
sage: RBF(-1)^(1/3)
nan
sage: RBF(0)^(-1)
- [+/- inf]
+ nan
sage: RBF(-e)**RBF(pi)
nan
@@ -3129,7 +3130,7 @@ cdef class RealBall(RingElement):
sage: RBF(1).tan()
[1.557407724654902 +/- 3.26e-16]
sage: RBF(pi/2).tan()
- [+/- inf]
+ nan
"""
cdef RealBall res = self._new()
if _do_sig(prec(self)): sig_on()
@@ -3146,7 +3147,7 @@ cdef class RealBall(RingElement):
sage: RBF(1).cot()
[0.642092615934331 +/- 4.79e-16]
sage: RBF(pi).cot()
- [+/- inf]
+ nan
"""
cdef RealBall res = self._new()
if _do_sig(prec(self)): sig_on()
@@ -3257,7 +3258,7 @@ cdef class RealBall(RingElement):
sage: RBF(1).coth()
[1.313035285499331 +/- 4.97e-16]
sage: RBF(0).coth()
- [+/- inf]
+ nan
"""
cdef RealBall res = self._new()
if _do_sig(prec(self)): sig_on()

View File

@ -0,0 +1,127 @@
diff --git a/src/doc/common/conf.py b/src/doc/common/conf.py
index 25f94f7b7d..9f6139ea4a 100644
--- a/src/doc/common/conf.py
+++ b/src/doc/common/conf.py
@@ -622,9 +622,9 @@ def call_intersphinx(app, env, node, contnode):
Check that the link from the thematic tutorials to the reference
manual is relative, see :trac:`20118`::
- sage: from sage.env import SAGE_DOC
- sage: thematic_index = os.path.join(SAGE_DOC, "html", "en", "thematic_tutorials", "index.html")
- sage: for line in open(thematic_index).readlines():
+ sage: from sage.env import SAGE_DOC # optional - dochtml
+ sage: thematic_index = os.path.join(SAGE_DOC, "html", "en", "thematic_tutorials", "index.html") # optional - dochtml
+ sage: for line in open(thematic_index).readlines(): # optional - dochtml
....: if "padics" in line:
....: sys.stdout.write(line)
<li><a class="reference external" href="../reference/padics/sage/rings/padics/tutorial.html#sage-rings-padics-tutorial" title="(in Sage Reference Manual: p-Adics ...)"><span>Introduction to the -adics</span></a></li>
diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py
index 4236fd05e0..8e499cbaf7 100644
--- a/src/sage/doctest/control.py
+++ b/src/sage/doctest/control.py
@@ -87,7 +87,7 @@ class DocTestDefaults(SageObject):
self.sagenb = False
self.long = False
self.warn_long = None
- self.optional = set(['sage']) | auto_optional_tags
+ self.optional = set(['sage', 'dochtml']) | auto_optional_tags
self.randorder = None
self.global_iterations = 1 # sage-runtests default is 0
self.file_iterations = 1 # sage-runtests default is 0
@@ -343,7 +343,8 @@ class DocTestController(SageObject):
if not optionaltag_regex.search(o):
raise ValueError('invalid optional tag {!r}'.format(o))
- options.optional |= auto_optional_tags
+ if "sage" in options.optional:
+ options.optional |= auto_optional_tags
self.options = options
self.files = args
@@ -741,7 +742,7 @@ class DocTestController(SageObject):
sage: DC = DocTestController(DD, [dirname])
sage: DC.expand_files_into_sources()
sage: sorted(DC.sources[0].options.optional) # abs tol 1
- ['guava', 'magma', 'py3']
+ ['guava', 'magma']
We check that files are skipped appropriately::
@@ -968,7 +969,7 @@ class DocTestController(SageObject):
sage: from sage.doctest.control import DocTestDefaults, DocTestController
sage: DC = DocTestController(DocTestDefaults(), [])
sage: DC._optional_tags_string()
- 'sage'
+ 'dochtml,sage'
sage: DC = DocTestController(DocTestDefaults(optional="all,and,some,more"), [])
sage: DC._optional_tags_string()
'all'
diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py
index 9255aa848f..cc4712d3ec 100644
--- a/src/sage/misc/sagedoc.py
+++ b/src/sage/misc/sagedoc.py
@@ -18,9 +18,9 @@ TESTS:
Check that argspecs of extension function/methods appear correctly,
see :trac:`12849`::
- sage: from sage.env import SAGE_DOC
- sage: docfilename = os.path.join(SAGE_DOC, 'html', 'en', 'reference', 'calculus', 'sage', 'symbolic', 'expression.html')
- sage: with open(docfilename) as fobj:
+ sage: from sage.env import SAGE_DOC # optional - dochtml
+ sage: docfilename = os.path.join(SAGE_DOC, 'html', 'en', 'reference', 'calculus', 'sage', 'symbolic', 'expression.html') # optional - dochtml
+ sage: with open(docfilename) as fobj: # optional - dochtml
....: for line in fobj:
....: if "#sage.symbolic.expression.Expression.numerical_approx" in line:
....: print(line)
@@ -790,11 +790,12 @@ def _search_src_or_doc(what, string, extra1='', extra2='', extra3='',
::
- sage: len(_search_src_or_doc('src', r'matrix\(', 'incidence_structures', 'self', 'combinat', interact=False).splitlines()) > 1
+ sage: from sage.misc.sagedoc import _search_src_or_doc # optional - dochtml
+ sage: len(_search_src_or_doc('src', r'matrix\(', 'incidence_structures', 'self', 'combinat', interact=False).splitlines()) > 1 # optional - dochtml
True
- sage: 'abvar/homology' in _search_src_or_doc('doc', 'homology', 'variety', interact=False) # long time (4s on sage.math, 2012)
+ sage: 'abvar/homology' in _search_src_or_doc('doc', 'homology', 'variety', interact=False) # optional - dochtml, long time (4s on sage.math, 2012)
True
- sage: 'divisors' in _search_src_or_doc('src', '^ *def prime', interact=False)
+ sage: 'divisors' in _search_src_or_doc('src', '^ *def prime', interact=False) # optional - dochtml
True
"""
# process keywords
@@ -1160,9 +1161,9 @@ def search_doc(string, extra1='', extra2='', extra3='', extra4='',
counting the length of ``search_doc('tree',
interact=False).splitlines()`` gives the number of matches. ::
- sage: len(search_doc('tree', interact=False).splitlines()) > 4000 # long time
+ sage: len(search_doc('tree', interact=False).splitlines()) > 4000 # optional - dochtml, long time
True
- sage: len(search_doc('tree', whole_word=True, interact=False).splitlines()) < 2000 # long time
+ sage: len(search_doc('tree', whole_word=True, interact=False).splitlines()) < 2000 # optional - dochtml, long time
True
"""
return _search_src_or_doc('doc', string, extra1=extra1, extra2=extra2,
@@ -1332,9 +1333,9 @@ class _sage_doc:
EXAMPLES::
- sage: browse_sage_doc._open("reference", testing=True)[0] # indirect doctest
+ sage: browse_sage_doc._open("reference", testing=True)[0] # optional - dochtml, indirect doctest
'http://localhost:8000/doc/live/reference/index.html'
- sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47]
+ sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] # optional - dochtml
'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring'
"""
def __init__(self):
@@ -1494,9 +1495,9 @@ class _sage_doc:
EXAMPLES::
- sage: browse_sage_doc._open("reference", testing=True)[0]
+ sage: browse_sage_doc._open("reference", testing=True)[0] # optional - dochtml
'http://localhost:8000/doc/live/reference/index.html'
- sage: browse_sage_doc._open("tutorial", testing=True)[1]
+ sage: browse_sage_doc._open("tutorial", testing=True)[1] # optional - dochtml
'.../html/en/tutorial/index.html'
"""
url = self._base_url + os.path.join(name, "index.html")

View File

@ -0,0 +1,98 @@
diff --git a/src/sage/libs/eclib/interface.py b/src/sage/libs/eclib/interface.py
index f77000c478..9d17d412ae 100644
--- a/src/sage/libs/eclib/interface.py
+++ b/src/sage/libs/eclib/interface.py
@@ -1014,7 +1014,7 @@ class mwrank_MordellWeil(SageObject):
WARNING: saturation at primes p > 2 will not be done;
...
Gained index 2
- New regulator = 93.857300720636393209
+ New regulator = 93.85730...
(False, 2, '[ ]')
sage: EQ.points()
[[-2, 3, 1], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]]
@@ -1025,7 +1025,7 @@ class mwrank_MordellWeil(SageObject):
WARNING: saturation at primes p > 3 will not be done;
...
Gained index 3
- New regulator = 10.4285889689595992455
+ New regulator = 10.42858...
(False, 3, '[ ]')
sage: EQ.points()
[[-2, 3, 1], [-14, 25, 8], [-13422227300, -49322830557, 12167000000]]
@@ -1036,7 +1036,7 @@ class mwrank_MordellWeil(SageObject):
WARNING: saturation at primes p > 5 will not be done;
...
Gained index 5
- New regulator = 0.417143558758383969818
+ New regulator = 0.41714...
(False, 5, '[ ]')
sage: EQ.points()
[[-2, 3, 1], [-14, 25, 8], [1, -1, 1]]
@@ -1221,7 +1221,7 @@ class mwrank_MordellWeil(SageObject):
WARNING: saturation at primes p > 2 will not be done;
...
Gained index 2
- New regulator = 93.857300720636393209
+ New regulator = 93.85730...
(False, 2, '[ ]')
sage: EQ
Subgroup of Mordell-Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]]
@@ -1235,7 +1235,7 @@ class mwrank_MordellWeil(SageObject):
WARNING: saturation at primes p > 3 will not be done;
...
Gained index 3
- New regulator = 10.4285889689595992455
+ New regulator = 10.42858...
(False, 3, '[ ]')
sage: EQ
Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]]
@@ -1249,7 +1249,7 @@ class mwrank_MordellWeil(SageObject):
WARNING: saturation at primes p > 5 will not be done;
...
Gained index 5
- New regulator = 0.417143558758383969818
+ New regulator = 0.41714...
(False, 5, '[ ]')
sage: EQ
Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]]
diff --git a/src/sage/libs/eclib/mwrank.pyx b/src/sage/libs/eclib/mwrank.pyx
index a4f89e1ca5..f8a22d2f55 100644
--- a/src/sage/libs/eclib/mwrank.pyx
+++ b/src/sage/libs/eclib/mwrank.pyx
@@ -1234,9 +1234,9 @@ cdef class _two_descent:
sage: D2.saturate()
Searching for points (bound = 8)...done:
found points which generate a subgroup of rank 3
- and regulator 0.417143558758383969817119544618093396749810106098479
+ and regulator 0.41714...
Processing points found during 2-descent...done:
- now regulator = 0.417143558758383969817119544618093396749810106098479
+ now regulator = 0.41714...
No saturation being done
sage: D2.getbasis()
'[[1:-1:1], [-2:3:1], [-14:25:8]]'
@@ -1281,9 +1281,9 @@ cdef class _two_descent:
sage: D2.saturate()
Searching for points (bound = 8)...done:
found points which generate a subgroup of rank 3
- and regulator 0.417143558758383969817119544618093396749810106098479
+ and regulator 0.41714...
Processing points found during 2-descent...done:
- now regulator = 0.417143558758383969817119544618093396749810106098479
+ now regulator = 0.41714...
No saturation being done
sage: D2.getbasis()
'[[1:-1:1], [-2:3:1], [-14:25:8]]'
@@ -1329,9 +1329,9 @@ cdef class _two_descent:
sage: D2.saturate()
Searching for points (bound = 8)...done:
found points which generate a subgroup of rank 3
- and regulator 0.417143558758383969817119544618093396749810106098479
+ and regulator 0.41714...
Processing points found during 2-descent...done:
- now regulator = 0.417143558758383969817119544618093396749810106098479
+ now regulator = 0.41714...
No saturation being done
sage: D2.getbasis()
'[[1:-1:1], [-2:3:1], [-14:25:8]]'

View File

@ -0,0 +1,12 @@
diff --git a/src/sage/all.py b/src/sage/all.py
index 14cec431f1..25a35a0522 100644
--- a/src/sage/all.py
+++ b/src/sage/all.py
@@ -310,6 +310,7 @@ warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0))
# Ignore all deprecations from IPython etc.
warnings.filterwarnings('ignore',
module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)')
+warnings.filterwarnings('ignore', "The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.") # matplotlib normed deprecation
# However, be sure to keep OUR deprecation warnings
warnings.filterwarnings('default',
'[\s\S]*See http://trac.sagemath.org/[0-9]* for details.')

View File

@ -0,0 +1,48 @@
diff --git a/src/sage/interfaces/maxima_abstract.py b/src/sage/interfaces/maxima_abstract.py
index 961c20aaac..3d601d8939 100644
--- a/src/sage/interfaces/maxima_abstract.py
+++ b/src/sage/interfaces/maxima_abstract.py
@@ -1743,7 +1743,7 @@ class MaximaAbstractElement(ExtraTabCompletion, InterfaceElement):
sage: y,d = var('y,d')
sage: f = function('f')
sage: latex(maxima(derivative(f(x*y), x)))
- \left(\left.{{{\it \partial}}\over{{\it \partial}\, {\it t_0}}}\,f\left({\it t_0}\right) \right|_{{\it t_0}={\it x}\, {\it y}}\right)\,{\it y}
+ \left(\left.{{{\it \partial}}\over{{\it \partial}\, {\it t}_{0}}}\,f\left({\it t}_{0}\right) \right|_{{\it t}_{0}={\it x}\, {\it y}}\right)\,{\it y}
sage: latex(maxima(derivative(f(x,y,d), d,x,x,y)))
{{{\it \partial}^4}\over{{\it \partial}\,{\it d}\, {\it \partial}\,{\it x}^2\,{\it \partial}\, {\it y}}}\,f\left({\it x} , {\it y} , {\it d}\right)
sage: latex(maxima(d/(d-2)))
diff --git a/src/sage/manifolds/differentiable/metric.py b/src/sage/manifolds/differentiable/metric.py
index 3cd6ad3235..1e18af1a6b 100644
--- a/src/sage/manifolds/differentiable/metric.py
+++ b/src/sage/manifolds/differentiable/metric.py
@@ -993,7 +993,7 @@ class PseudoRiemannianMetric(TensorField):
2-dimensional differentiable manifold S^2
sage: g.riemann()[:]
[[[[0, 0], [0, 0]], [[0, sin(th)^2], [-sin(th)^2, 0]]],
- [[[0, (cos(th)^2 - 1)/sin(th)^2], [1, 0]], [[0, 0], [0, 0]]]]
+ [[[0, -1], [1, 0]], [[0, 0], [0, 0]]]]
In dimension 2, the Riemann tensor can be expressed entirely in terms of
the Ricci scalar `r`:
diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
index dfb8751467..27402e54ab 100644
--- a/src/sage/symbolic/expression.pyx
+++ b/src/sage/symbolic/expression.pyx
@@ -7154,7 +7154,7 @@ cdef class Expression(CommutativeRingElement):
sage: ex = lcm(sin(x)^2 - 1, sin(x)^2 + sin(x)); ex
(sin(x)^2 + sin(x))*(sin(x)^2 - 1)/(sin(x) + 1)
sage: ex.simplify_full()
- -cos(x)^2*sin(x)
+ sin(x)^3 - sin(x)
TESTS:
@@ -10004,7 +10004,7 @@ cdef class Expression(CommutativeRingElement):
sage: f=tan(3*x)
sage: f.simplify_trig()
- (4*cos(x)^2 - 1)*sin(x)/(4*cos(x)^3 - 3*cos(x))
+ -(4*cos(x)^2 - 1)*sin(x)/(4*cos(x)*sin(x)^2 - cos(x))
sage: f.simplify_trig(False)
sin(3*x)/cos(3*x)

View File

@ -0,0 +1,812 @@
diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst
index 79b4205fd3..9a89bd2136 100644
--- a/src/doc/en/faq/faq-usage.rst
+++ b/src/doc/en/faq/faq-usage.rst
@@ -338,7 +338,7 @@ ints. For example::
sage: RealNumber = float; Integer = int
sage: from scipy import stats
sage: stats.ttest_ind(list([1,2,3,4,5]),list([2,3,4,5,.6]))
- Ttest_indResult(statistic=0.076752955645333687, pvalue=0.94070490247380478)
+ Ttest_indResult(statistic=0.0767529..., pvalue=0.940704...)
sage: stats.uniform(0,15).ppf([0.5,0.7])
array([ 7.5, 10.5])
diff --git a/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst b/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
index 314811c42b..e5f54ec4c2 100644
--- a/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
+++ b/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
@@ -48,11 +48,13 @@ we could do the following.
sage: B = numpy.array([1.0]*5)
sage: B.shape=(5,1)
sage: print(B)
- [[ 1.]
- [ 1.]
- [ 1.]
- [ 1.]
- [ 1.]]
+ [[1.]
+ [1.]
+ [1.]
+ [1.]
+ [1.]]
+
+
sage: print(A)
[ 2.00e+00 3.00e+00 0 0 0 ]
[ 3.00e+00 0 4.00e+00 0 6.00e+00]
diff --git a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
index 5b89cd75ee..e50b2ea5d4 100644
--- a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
+++ b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
@@ -84,7 +84,7 @@ well as take slices
sage: l[3]
3.0
sage: l[3:6]
- array([ 3., 4., 5.])
+ array([3., 4., 5.])
You can do basic arithmetic operations
@@ -147,11 +147,11 @@ also do matrix vector multiplication, and matrix addition
sage: n = numpy.matrix([[1,2],[3,4]],dtype=float)
sage: v = numpy.array([[1],[2]],dtype=float)
sage: n*v
- matrix([[ 5.],
- [ 11.]])
+ matrix([[ 5.],
+ [11.]])
sage: n+n
- matrix([[ 2., 4.],
- [ 6., 8.]])
+ matrix([[2., 4.],
+ [6., 8.]])
If ``n`` was created with :meth:`numpy.array`, then to do matrix vector
multiplication, you would use ``numpy.dot(n,v)``.
@@ -170,11 +170,11 @@ to manipulate
22., 23., 24.])
sage: n.shape=(5,5)
sage: n
- array([[ 0., 1., 2., 3., 4.],
- [ 5., 6., 7., 8., 9.],
- [ 10., 11., 12., 13., 14.],
- [ 15., 16., 17., 18., 19.],
- [ 20., 21., 22., 23., 24.]])
+ array([[ 0., 1., 2., 3., 4.],
+ [ 5., 6., 7., 8., 9.],
+ [10., 11., 12., 13., 14.],
+ [15., 16., 17., 18., 19.],
+ [20., 21., 22., 23., 24.]])
This changes the one-dimensional array into a `5\times 5` array.
@@ -187,8 +187,8 @@ NumPy arrays can be sliced as well
sage: n=numpy.array(range(25),dtype=float)
sage: n.shape=(5,5)
sage: n[2:4,1:3]
- array([[ 11., 12.],
- [ 16., 17.]])
+ array([[11., 12.],
+ [16., 17.]])
It is important to note that the sliced matrices are references to
the original
@@ -224,8 +224,8 @@ Some particularly useful commands are
sage: x=numpy.arange(0,2,.1,dtype=float)
sage: x
- array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ,
- 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])
+ array([0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2,
+ 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])
You can see that :meth:`numpy.arange` creates an array of floats increasing by 0.1
from 0 to 2. There is a useful command :meth:`numpy.r_` that is best explained by example
@@ -240,10 +240,11 @@ from 0 to 2. There is a useful command :meth:`numpy.r_` that is best explained b
sage: Integer=int
sage: n=r_[0.0:5.0]
sage: n
- array([ 0., 1., 2., 3., 4.])
+ array([0., 1., 2., 3., 4.])
sage: n=r_[0.0:5.0, [0.0]*5]
sage: n
- array([ 0., 1., 2., 3., 4., 0., 0., 0., 0., 0.])
+ array([0., 1., 2., 3., 4., 0., 0., 0., 0., 0.])
+
:meth:`numpy.r_` provides a shorthand for constructing NumPy arrays efficiently.
Note in the above ``0.0:5.0`` was shorthand for ``0.0, 1.0, 2.0, 3.0, 4.0``.
@@ -255,7 +256,7 @@ intervals. We can do this as follows
::
sage: r_[0.0:5.0:11*j]
- array([ 0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5, 5. ])
+ array([0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5, 5. ])
The notation ``0.0:5.0:11*j`` expands to a list of 11 equally space
points between 0 and 5 including both endpoints. Note that ``j`` is the
@@ -287,23 +288,23 @@ an equally spaced grid with `\Delta x = \Delta y = .25` for
sage: y=numpy.r_[0.0:1.0:5*j]
sage: xx,yy= meshgrid(x,y)
sage: xx
- array([[ 0. , 0.25, 0.5 , 0.75, 1. ],
- [ 0. , 0.25, 0.5 , 0.75, 1. ],
- [ 0. , 0.25, 0.5 , 0.75, 1. ],
- [ 0. , 0.25, 0.5 , 0.75, 1. ],
- [ 0. , 0.25, 0.5 , 0.75, 1. ]])
+ array([[0. , 0.25, 0.5 , 0.75, 1. ],
+ [0. , 0.25, 0.5 , 0.75, 1. ],
+ [0. , 0.25, 0.5 , 0.75, 1. ],
+ [0. , 0.25, 0.5 , 0.75, 1. ],
+ [0. , 0.25, 0.5 , 0.75, 1. ]])
sage: yy
- array([[ 0. , 0. , 0. , 0. , 0. ],
- [ 0.25, 0.25, 0.25, 0.25, 0.25],
- [ 0.5 , 0.5 , 0.5 , 0.5 , 0.5 ],
- [ 0.75, 0.75, 0.75, 0.75, 0.75],
- [ 1. , 1. , 1. , 1. , 1. ]])
+ array([[0. , 0. , 0. , 0. , 0. ],
+ [0.25, 0.25, 0.25, 0.25, 0.25],
+ [0.5 , 0.5 , 0.5 , 0.5 , 0.5 ],
+ [0.75, 0.75, 0.75, 0.75, 0.75],
+ [1. , 1. , 1. , 1. , 1. ]])
sage: f(xx,yy)
- array([[ 0. , 0.0625, 0.25 , 0.5625, 1. ],
- [ 0.0625, 0.125 , 0.3125, 0.625 , 1.0625],
- [ 0.25 , 0.3125, 0.5 , 0.8125, 1.25 ],
- [ 0.5625, 0.625 , 0.8125, 1.125 , 1.5625],
- [ 1. , 1.0625, 1.25 , 1.5625, 2. ]])
+ array([[0. , 0.0625, 0.25 , 0.5625, 1. ],
+ [0.0625, 0.125 , 0.3125, 0.625 , 1.0625],
+ [0.25 , 0.3125, 0.5 , 0.8125, 1.25 ],
+ [0.5625, 0.625 , 0.8125, 1.125 , 1.5625],
+ [1. , 1.0625, 1.25 , 1.5625, 2. ]])
You can see that :meth:`numpy.meshgrid` produces a pair of matrices, here denoted
`xx` and `yy`, such that `(xx[i,j],yy[i,j])` has coordinates
@@ -324,7 +325,7 @@ equation `Ax=b` do
sage: b=numpy.array(range(1,6))
sage: x=linalg.solve(A,b)
sage: numpy.dot(A,x)
- array([ 1., 2., 3., 4., 5.])
+ array([1., 2., 3., 4., 5.])
This creates a random 5x5 matrix ``A``, and solves `Ax=b` where
``b=[0.0,1.0,2.0,3.0,4.0]``. There are many other routines in the :mod:`numpy.linalg`
diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
index df85cce43d..34ea164be0 100644
--- a/src/sage/calculus/riemann.pyx
+++ b/src/sage/calculus/riemann.pyx
@@ -1191,30 +1191,30 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
sage: zval = numpy.array([[0, 1, 1000],[.2+.3j,1,-.3j],[0,0,0]],dtype = numpy.complex128)
sage: deriv = numpy.array([[.1]],dtype = numpy.float64)
sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,False,0.001)
- array([[[ 1., 1., 1.],
- [ 1., 1., 1.],
- [ 1., 1., 1.]],
+ array([[[1., 1., 1.],
+ [1., 1., 1.],
+ [1., 1., 1.]],
<BLANKLINE>
- [[ 1., 1., 1.],
- [ 0., 0., 0.],
- [ 1., 1., 1.]],
+ [[1., 1., 1.],
+ [0., 0., 0.],
+ [1., 1., 1.]],
<BLANKLINE>
- [[ 1., 1., 1.],
- [ 1., 1., 1.],
- [ 1., 1., 1.]]])
+ [[1., 1., 1.],
+ [1., 1., 1.],
+ [1., 1., 1.]]])
sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,True,0.001)
- array([[[ 1. , 1. , 1. ],
- [ 1. , 0.05558355, 0.05558355],
- [ 0.17301243, 0. , 0. ]],
+ array([[[1. , 1. , 1. ],
+ [1. , 0.05558355, 0.05558355],
+ [0.17301243, 0. , 0. ]],
<BLANKLINE>
- [[ 1. , 0.96804683, 0.48044583],
- [ 0. , 0. , 0. ],
- [ 0.77351965, 0.5470393 , 1. ]],
+ [[1. , 0.96804683, 0.48044583],
+ [0. , 0. , 0. ],
+ [0.77351965, 0.5470393 , 1. ]],
<BLANKLINE>
- [[ 1. , 1. , 1. ],
- [ 1. , 1. , 1. ],
- [ 1. , 1. , 1. ]]])
+ [[1. , 1. , 1. ],
+ [1. , 1. , 1. ],
+ [1. , 1. , 1. ]]])
"""
cdef Py_ssize_t i, j, imax, jmax
cdef FLOAT_T x, y, mag, arg, width, target, precision, dmag, darg
@@ -1279,14 +1279,14 @@ cpdef complex_to_rgb(np.ndarray[COMPLEX_T, ndim = 2] z_values):
sage: from sage.calculus.riemann import complex_to_rgb
sage: import numpy
sage: complex_to_rgb(numpy.array([[0, 1, 1000]], dtype = numpy.complex128))
- array([[[ 1. , 1. , 1. ],
- [ 1. , 0.05558355, 0.05558355],
- [ 0.17301243, 0. , 0. ]]])
+ array([[[1. , 1. , 1. ],
+ [1. , 0.05558355, 0.05558355],
+ [0.17301243, 0. , 0. ]]])
sage: complex_to_rgb(numpy.array([[0, 1j, 1000j]], dtype = numpy.complex128))
- array([[[ 1. , 1. , 1. ],
- [ 0.52779177, 1. , 0.05558355],
- [ 0.08650622, 0.17301243, 0. ]]])
+ array([[[1. , 1. , 1. ],
+ [0.52779177, 1. , 0.05558355],
+ [0.08650622, 0.17301243, 0. ]]])
TESTS::
diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
index 61b1003002..4baee9cbbd 100644
--- a/src/sage/combinat/fully_packed_loop.py
+++ b/src/sage/combinat/fully_packed_loop.py
@@ -72,11 +72,11 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
sage: _make_color_list(5, ['blue', 'red'])
['blue', 'red', 'blue', 'red', 'blue']
sage: _make_color_list(5, color_map='summer')
- [(0.0, 0.5, 0.40000000000000002),
- (0.25098039215686274, 0.62549019607843137, 0.40000000000000002),
- (0.50196078431372548, 0.75098039215686274, 0.40000000000000002),
- (0.75294117647058822, 0.87647058823529411, 0.40000000000000002),
- (1.0, 1.0, 0.40000000000000002)]
+ [(0.0, 0.5, 0.4),
+ (0.25098039215686274, 0.6254901960784314, 0.4),
+ (0.5019607843137255, 0.7509803921568627, 0.4),
+ (0.7529411764705882, 0.8764705882352941, 0.4),
+ (1.0, 1.0, 0.4)]
sage: _make_color_list(8, ['blue', 'red'], randomize=True)
['blue', 'blue', 'red', 'blue', 'red', 'red', 'red', 'blue']
"""
diff --git a/src/sage/finance/time_series.pyx b/src/sage/finance/time_series.pyx
index c37700d14e..49b7298d0b 100644
--- a/src/sage/finance/time_series.pyx
+++ b/src/sage/finance/time_series.pyx
@@ -109,8 +109,8 @@ cdef class TimeSeries:
sage: import numpy
sage: v = numpy.array([[1,2], [3,4]], dtype=float); v
- array([[ 1., 2.],
- [ 3., 4.]])
+ array([[1., 2.],
+ [3., 4.]])
sage: finance.TimeSeries(v)
[1.0000, 2.0000, 3.0000, 4.0000]
sage: finance.TimeSeries(v[:,0])
@@ -2098,14 +2098,14 @@ cdef class TimeSeries:
sage: w[0] = 20
sage: w
- array([ 20. , -3. , 4.5, -2. ])
+ array([20. , -3. , 4.5, -2. ])
sage: v
[20.0000, -3.0000, 4.5000, -2.0000]
If you want a separate copy do not give the ``copy=False`` option. ::
sage: z = v.numpy(); z
- array([ 20. , -3. , 4.5, -2. ])
+ array([20. , -3. , 4.5, -2. ])
sage: z[0] = -10
sage: v
[20.0000, -3.0000, 4.5000, -2.0000]
diff --git a/src/sage/functions/hyperbolic.py b/src/sage/functions/hyperbolic.py
index 931a4b41e4..bf33fc483d 100644
--- a/src/sage/functions/hyperbolic.py
+++ b/src/sage/functions/hyperbolic.py
@@ -214,7 +214,7 @@ class Function_coth(GinacFunction):
sage: import numpy
sage: a = numpy.arange(2, 5)
sage: coth(a)
- array([ 1.03731472, 1.00496982, 1.00067115])
+ array([1.03731472, 1.00496982, 1.00067115])
"""
return 1.0 / tanh(x)
@@ -267,7 +267,7 @@ class Function_sech(GinacFunction):
sage: import numpy
sage: a = numpy.arange(2, 5)
sage: sech(a)
- array([ 0.26580223, 0.09932793, 0.03661899])
+ array([0.26580223, 0.09932793, 0.03661899])
"""
return 1.0 / cosh(x)
@@ -318,7 +318,7 @@ class Function_csch(GinacFunction):
sage: import numpy
sage: a = numpy.arange(2, 5)
sage: csch(a)
- array([ 0.27572056, 0.09982157, 0.03664357])
+ array([0.27572056, 0.09982157, 0.03664357])
"""
return 1.0 / sinh(x)
@@ -586,7 +586,7 @@ class Function_arccoth(GinacFunction):
sage: import numpy
sage: a = numpy.arange(2,5)
sage: acoth(a)
- array([ 0.54930614, 0.34657359, 0.25541281])
+ array([0.54930614, 0.34657359, 0.25541281])
"""
return arctanh(1.0 / x)
diff --git a/src/sage/functions/orthogonal_polys.py b/src/sage/functions/orthogonal_polys.py
index 017c85a96f..33fbb499c5 100644
--- a/src/sage/functions/orthogonal_polys.py
+++ b/src/sage/functions/orthogonal_polys.py
@@ -810,12 +810,12 @@ class Func_chebyshev_T(ChebyshevFunction):
sage: z2 = numpy.array([[1,2],[1,2]])
sage: z3 = numpy.array([1,2,3.])
sage: chebyshev_T(1,z)
- array([ 1., 2.])
+ array([1., 2.])
sage: chebyshev_T(1,z2)
- array([[ 1., 2.],
- [ 1., 2.]])
+ array([[1., 2.],
+ [1., 2.]])
sage: chebyshev_T(1,z3)
- array([ 1., 2., 3.])
+ array([1., 2., 3.])
sage: chebyshev_T(z,0.1)
array([ 0.1 , -0.98])
"""
@@ -1095,12 +1095,12 @@ class Func_chebyshev_U(ChebyshevFunction):
sage: z2 = numpy.array([[1,2],[1,2]])
sage: z3 = numpy.array([1,2,3.])
sage: chebyshev_U(1,z)
- array([ 2., 4.])
+ array([2., 4.])
sage: chebyshev_U(1,z2)
- array([[ 2., 4.],
- [ 2., 4.]])
+ array([[2., 4.],
+ [2., 4.]])
sage: chebyshev_U(1,z3)
- array([ 2., 4., 6.])
+ array([2., 4., 6.])
sage: chebyshev_U(z,0.1)
array([ 0.2 , -0.96])
"""
diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py
index 679384c907..d63b295a4c 100644
--- a/src/sage/functions/other.py
+++ b/src/sage/functions/other.py
@@ -390,7 +390,7 @@ class Function_ceil(BuiltinFunction):
sage: import numpy
sage: a = numpy.linspace(0,2,6)
sage: ceil(a)
- array([ 0., 1., 1., 2., 2., 2.])
+ array([0., 1., 1., 2., 2., 2.])
Test pickling::
@@ -539,7 +539,7 @@ class Function_floor(BuiltinFunction):
sage: import numpy
sage: a = numpy.linspace(0,2,6)
sage: floor(a)
- array([ 0., 0., 0., 1., 1., 2.])
+ array([0., 0., 0., 1., 1., 2.])
sage: floor(x)._sympy_()
floor(x)
@@ -840,7 +840,7 @@ def sqrt(x, *args, **kwds):
sage: import numpy
sage: a = numpy.arange(2,5)
sage: sqrt(a)
- array([ 1.41421356, 1.73205081, 2. ])
+ array([1.41421356, 1.73205081, 2. ])
"""
if isinstance(x, float):
return math.sqrt(x)
diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py
index e7e7a311cd..e7ff78a9de 100644
--- a/src/sage/functions/trig.py
+++ b/src/sage/functions/trig.py
@@ -731,7 +731,7 @@ class Function_arccot(GinacFunction):
sage: import numpy
sage: a = numpy.arange(2, 5)
sage: arccot(a)
- array([ 0.46364761, 0.32175055, 0.24497866])
+ array([0.46364761, 0.32175055, 0.24497866])
"""
return math.pi/2 - arctan(x)
@@ -787,7 +787,7 @@ class Function_arccsc(GinacFunction):
sage: import numpy
sage: a = numpy.arange(2, 5)
sage: arccsc(a)
- array([ 0.52359878, 0.33983691, 0.25268026])
+ array([0.52359878, 0.33983691, 0.25268026])
"""
return arcsin(1.0/x)
@@ -845,7 +845,7 @@ class Function_arcsec(GinacFunction):
sage: import numpy
sage: a = numpy.arange(2, 5)
sage: arcsec(a)
- array([ 1.04719755, 1.23095942, 1.31811607])
+ array([1.04719755, 1.23095942, 1.31811607])
"""
return arccos(1.0/x)
@@ -920,13 +920,13 @@ class Function_arctan2(GinacFunction):
sage: a = numpy.linspace(1, 3, 3)
sage: b = numpy.linspace(3, 6, 3)
sage: atan2(a, b)
- array([ 0.32175055, 0.41822433, 0.46364761])
+ array([0.32175055, 0.41822433, 0.46364761])
sage: atan2(1,a)
- array([ 0.78539816, 0.46364761, 0.32175055])
+ array([0.78539816, 0.46364761, 0.32175055])
sage: atan2(a, 1)
- array([ 0.78539816, 1.10714872, 1.24904577])
+ array([0.78539816, 1.10714872, 1.24904577])
TESTS::
diff --git a/src/sage/matrix/constructor.pyx b/src/sage/matrix/constructor.pyx
index 19a1d37df0..5780dfae1c 100644
--- a/src/sage/matrix/constructor.pyx
+++ b/src/sage/matrix/constructor.pyx
@@ -494,8 +494,8 @@ class MatrixFactory(object):
[7 8 9]
Full MatrixSpace of 3 by 3 dense matrices over Integer Ring
sage: n = matrix(QQ, 2, 2, [1, 1/2, 1/3, 1/4]).numpy(); n
- array([[ 1. , 0.5 ],
- [ 0.33333333, 0.25 ]])
+ array([[1. , 0.5 ],
+ [0.33333333, 0.25 ]])
sage: matrix(QQ, n)
[ 1 1/2]
[1/3 1/4]
diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx
index 48e0a8a97f..1be5d35b19 100644
--- a/src/sage/matrix/matrix_double_dense.pyx
+++ b/src/sage/matrix/matrix_double_dense.pyx
@@ -2546,7 +2546,7 @@ cdef class Matrix_double_dense(Matrix_dense):
sage: P.is_unitary(algorithm='orthonormal')
Traceback (most recent call last):
...
- ValueError: failed to create intent(cache|hide)|optional array-- must have defined dimensions but got (0,)
+ error: ((lwork==-1)||(lwork >= MAX(1,2*n))) failed for 3rd keyword lwork: zgees:lwork=0
TESTS::
@@ -3662,8 +3662,8 @@ cdef class Matrix_double_dense(Matrix_dense):
[0.0 1.0 2.0]
[3.0 4.0 5.0]
sage: m.numpy()
- array([[ 0., 1., 2.],
- [ 3., 4., 5.]])
+ array([[0., 1., 2.],
+ [3., 4., 5.]])
Alternatively, numpy automatically calls this function (via
the magic :meth:`__array__` method) to convert Sage matrices
@@ -3674,16 +3674,16 @@ cdef class Matrix_double_dense(Matrix_dense):
[0.0 1.0 2.0]
[3.0 4.0 5.0]
sage: numpy.array(m)
- array([[ 0., 1., 2.],
- [ 3., 4., 5.]])
+ array([[0., 1., 2.],
+ [3., 4., 5.]])
sage: numpy.array(m).dtype
dtype('float64')
sage: m = matrix(CDF, 2, range(6)); m
[0.0 1.0 2.0]
[3.0 4.0 5.0]
sage: numpy.array(m)
- array([[ 0.+0.j, 1.+0.j, 2.+0.j],
- [ 3.+0.j, 4.+0.j, 5.+0.j]])
+ array([[0.+0.j, 1.+0.j, 2.+0.j],
+ [3.+0.j, 4.+0.j, 5.+0.j]])
sage: numpy.array(m).dtype
dtype('complex128')
diff --git a/src/sage/matrix/special.py b/src/sage/matrix/special.py
index c698ba5e97..b743bab354 100644
--- a/src/sage/matrix/special.py
+++ b/src/sage/matrix/special.py
@@ -705,7 +705,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
sage: import numpy
sage: entries = numpy.array([1.2, 5.6]); entries
- array([ 1.2, 5.6])
+ array([1.2, 5.6])
sage: A = diagonal_matrix(3, entries); A
[1.2 0.0 0.0]
[0.0 5.6 0.0]
@@ -715,7 +715,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
sage: j = numpy.complex(0,1)
sage: entries = numpy.array([2.0+j, 8.1, 3.4+2.6*j]); entries
- array([ 2.0+1.j , 8.1+0.j , 3.4+2.6j])
+ array([2. +1.j , 8.1+0.j , 3.4+2.6j])
sage: A = diagonal_matrix(entries); A
[2.0 + 1.0*I 0.0 0.0]
[ 0.0 8.1 0.0]
diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
index 230f142117..2ab1c0ae68 100644
--- a/src/sage/modules/free_module_element.pyx
+++ b/src/sage/modules/free_module_element.pyx
@@ -982,7 +982,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
sage: v.numpy()
array([1, 2, 5/6], dtype=object)
sage: v.numpy(dtype=float)
- array([ 1. , 2. , 0.83333333])
+ array([1. , 2. , 0.83333333])
sage: v.numpy(dtype=int)
array([1, 2, 0])
sage: import numpy
@@ -993,7 +993,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
be more efficient but may have unintended consequences::
sage: v.numpy(dtype=None)
- array([ 1. , 2. , 0.83333333])
+ array([1. , 2. , 0.83333333])
sage: w = vector(ZZ, [0, 1, 2^63 -1]); w
(0, 1, 9223372036854775807)
diff --git a/src/sage/modules/vector_double_dense.pyx b/src/sage/modules/vector_double_dense.pyx
index 39fc2970de..2badf98284 100644
--- a/src/sage/modules/vector_double_dense.pyx
+++ b/src/sage/modules/vector_double_dense.pyx
@@ -807,13 +807,13 @@ cdef class Vector_double_dense(FreeModuleElement):
sage: v = vector(CDF,4,range(4))
sage: v.numpy()
- array([ 0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j])
+ array([0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j])
sage: v = vector(CDF,0)
sage: v.numpy()
array([], dtype=complex128)
sage: v = vector(RDF,4,range(4))
sage: v.numpy()
- array([ 0., 1., 2., 3.])
+ array([0., 1., 2., 3.])
sage: v = vector(RDF,0)
sage: v.numpy()
array([], dtype=float64)
@@ -823,11 +823,11 @@ cdef class Vector_double_dense(FreeModuleElement):
sage: import numpy
sage: v = vector(CDF, 3, range(3))
sage: v.numpy()
- array([ 0.+0.j, 1.+0.j, 2.+0.j])
+ array([0.+0.j, 1.+0.j, 2.+0.j])
sage: v.numpy(dtype=numpy.float64)
- array([ 0., 1., 2.])
+ array([0., 1., 2.])
sage: v.numpy(dtype=numpy.float32)
- array([ 0., 1., 2.], dtype=float32)
+ array([0., 1., 2.], dtype=float32)
"""
if dtype is None or dtype is self._vector_numpy.dtype:
from copy import copy
diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
index 17b5ebb84b..92ce35c502 100644
--- a/src/sage/numerical/optimize.py
+++ b/src/sage/numerical/optimize.py
@@ -486,9 +486,9 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
else:
min = optimize.fmin_tnc(f, x0, approx_grad=True, bounds=cons, messages=0, **args)[0]
elif isinstance(cons[0], function_type) or isinstance(cons[0], Expression):
- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args)
+ min = optimize.fmin_cobyla(f, x0, cons, disp=0, **args)
elif isinstance(cons, function_type) or isinstance(cons, Expression):
- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args)
+ min = optimize.fmin_cobyla(f, x0, cons, disp=0, **args)
return vector(RDF, min)
diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
index ad9693da62..758fb709b7 100644
--- a/src/sage/plot/complex_plot.pyx
+++ b/src/sage/plot/complex_plot.pyx
@@ -61,9 +61,9 @@ cdef inline double mag_to_lightness(double r):
sage: from sage.plot.complex_plot import complex_to_rgb
sage: complex_to_rgb([[0, 1, 10]])
- array([[[ 0. , 0. , 0. ],
- [ 0.77172568, 0. , 0. ],
- [ 1. , 0.22134776, 0.22134776]]])
+ array([[[0. , 0. , 0. ],
+ [0.77172568, 0. , 0. ],
+ [1. , 0.22134776, 0.22134776]]])
"""
return atan(log(sqrt(r)+1)) * (4/PI) - 1
@@ -82,13 +82,13 @@ def complex_to_rgb(z_values):
sage: from sage.plot.complex_plot import complex_to_rgb
sage: complex_to_rgb([[0, 1, 1000]])
- array([[[ 0. , 0. , 0. ],
- [ 0.77172568, 0. , 0. ],
- [ 1. , 0.64421177, 0.64421177]]])
+ array([[[0. , 0. , 0. ],
+ [0.77172568, 0. , 0. ],
+ [1. , 0.64421177, 0.64421177]]])
sage: complex_to_rgb([[0, 1j, 1000j]])
- array([[[ 0. , 0. , 0. ],
- [ 0.38586284, 0.77172568, 0. ],
- [ 0.82210588, 1. , 0.64421177]]])
+ array([[[0. , 0. , 0. ],
+ [0.38586284, 0.77172568, 0. ],
+ [0.82210588, 1. , 0.64421177]]])
"""
import numpy
cdef unsigned int i, j, imax, jmax
diff --git a/src/sage/plot/line.py b/src/sage/plot/line.py
index 23f5e61446..3b1b51d7cf 100644
--- a/src/sage/plot/line.py
+++ b/src/sage/plot/line.py
@@ -502,14 +502,12 @@ def line2d(points, **options):
from sage.plot.all import Graphics
from sage.plot.plot import xydata_from_point_list
from sage.rings.all import CC, CDF
+ points = list(points) # make sure points is a python list
if points in CC or points in CDF:
pass
else:
- try:
- if not points:
- return Graphics()
- except ValueError: # numpy raises a ValueError if not empty
- pass
+ if len(points) == 0:
+ return Graphics()
xdata, ydata = xydata_from_point_list(points)
g = Graphics()
g._set_extra_kwds(Graphics._extract_kwds_for_show(options))
diff --git a/src/sage/plot/plot_field.py b/src/sage/plot/plot_field.py
index 0025098a8d..23c80902f3 100644
--- a/src/sage/plot/plot_field.py
+++ b/src/sage/plot/plot_field.py
@@ -49,9 +49,10 @@ class PlotField(GraphicPrimitive):
sage: r.xpos_array
[0.0, 0.0, 1.0, 1.0]
sage: r.yvec_array
- masked_array(data = [0.0 0.70710678118... 0.70710678118... 0.89442719...],
- mask = [False False False False],
- fill_value = 1e+20)
+ masked_array(data=[0.0, 0.70710678118..., 0.70710678118...,
+ 0.89442719...],
+ mask=[False, False, False, False],
+ fill_value=1e+20)
TESTS:
diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
index f3da57c370..3806f4b32f 100644
--- a/src/sage/plot/streamline_plot.py
+++ b/src/sage/plot/streamline_plot.py
@@ -38,16 +38,14 @@ class StreamlinePlot(GraphicPrimitive):
sage: r.options()['plot_points']
2
sage: r.xpos_array
- array([ 0., 1.])
+ array([0., 1.])
sage: r.yvec_array
- masked_array(data =
- [[1.0 1.0]
- [0.5403023058681398 0.5403023058681398]],
- mask =
- [[False False]
- [False False]],
- fill_value = 1e+20)
- <BLANKLINE>
+ masked_array(
+ data=[[1.0, 1.0],
+ [0.5403023058681398, 0.5403023058681398]],
+ mask=[[False, False],
+ [False, False]],
+ fill_value=1e+20)
TESTS:
diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
index f66cd898b9..35995886d5 100644
--- a/src/sage/probability/probability_distribution.pyx
+++ b/src/sage/probability/probability_distribution.pyx
@@ -130,7 +130,17 @@ cdef class ProbabilityDistribution:
0.0,
1.4650000000000003]
sage: b
- [0.0, 0.20000000000000001, 0.40000000000000002, 0.60000000000000009, 0.80000000000000004, 1.0, 1.2000000000000002, 1.4000000000000001, 1.6000000000000001, 1.8, 2.0]
+ [0.0,
+ 0.2,
+ 0.4,
+ 0.6000000000000001,
+ 0.8,
+ 1.0,
+ 1.2000000000000002,
+ 1.4000000000000001,
+ 1.6,
+ 1.8,
+ 2.0]
"""
import pylab
l = [float(self.get_random_element()) for _ in range(num_samples)]
diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx
index a0bfe080f5..7d95e7a1a8 100644
--- a/src/sage/rings/rational.pyx
+++ b/src/sage/rings/rational.pyx
@@ -1056,7 +1056,7 @@ cdef class Rational(sage.structure.element.FieldElement):
dtype('O')
sage: numpy.array([1, 1/2, 3/4])
- array([ 1. , 0.5 , 0.75])
+ array([1. , 0.5 , 0.75])
"""
if mpz_cmp_ui(mpq_denref(self.value), 1) == 0:
if mpz_fits_slong_p(mpq_numref(self.value)):
diff --git a/src/sage/rings/real_mpfr.pyx b/src/sage/rings/real_mpfr.pyx
index 4c630867a4..64e2187f5b 100644
--- a/src/sage/rings/real_mpfr.pyx
+++ b/src/sage/rings/real_mpfr.pyx
@@ -1438,7 +1438,7 @@ cdef class RealNumber(sage.structure.element.RingElement):
sage: import numpy
sage: numpy.arange(10.0)
- array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
+ array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
sage: numpy.array([1.0, 1.1, 1.2]).dtype
dtype('float64')
sage: numpy.array([1.000000000000000000000000000000000000]).dtype
diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py
index 3d270ebf9d..1144f168e3 100644
--- a/src/sage/schemes/elliptic_curves/height.py
+++ b/src/sage/schemes/elliptic_curves/height.py
@@ -1623,18 +1623,18 @@ class EllipticCurveCanonicalHeight:
even::
sage: H.wp_on_grid(v,4)
- array([[ 25.43920182, 5.28760943, 5.28760943, 25.43920182],
- [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
- [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
- [ 25.43920182, 5.28760943, 5.28760943, 25.43920182]])
+ array([[25.43920182, 5.28760943, 5.28760943, 25.43920182],
+ [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
+ [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
+ [25.43920182, 5.28760943, 5.28760943, 25.43920182]])
The array of values on the half-grid::
sage: H.wp_on_grid(v,4,True)
- array([[ 25.43920182, 5.28760943],
- [ 6.05099485, 1.83757786],
- [ 6.05099485, 1.83757786],
- [ 25.43920182, 5.28760943]])
+ array([[25.43920182, 5.28760943],
+ [ 6.05099485, 1.83757786],
+ [ 6.05099485, 1.83757786],
+ [25.43920182, 5.28760943]])
"""
tau = self.tau(v)
fk, err = self.fk_intervals(v, 15, CDF)
diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
index 2dcb0492b9..2b1a06385c 100644
--- a/src/sage/symbolic/ring.pyx
+++ b/src/sage/symbolic/ring.pyx
@@ -1135,7 +1135,7 @@ cdef class NumpyToSRMorphism(Morphism):
sage: cos(numpy.int('2'))
cos(2)
sage: numpy.cos(numpy.int('2'))
- -0.41614683654714241
+ -0.4161468365471424
"""
cdef _intermediate_ring

View File

@ -0,0 +1,20 @@
diff --git a/src/sage/doctest/parsing.py b/src/sage/doctest/parsing.py
index 6bdc9a0..31fc780 100644
--- a/src/sage/doctest/parsing.py
+++ b/src/sage/doctest/parsing.py
@@ -40,6 +40,7 @@ from .external import available_software
float_regex = re.compile('\s*([+-]?\s*((\d*\.?\d+)|(\d+\.?))([eE][+-]?\d+)?)')
optional_regex = re.compile(r'(py2|py3|long time|not implemented|not tested|known bug)|([^ a-z]\s*optional\s*[:-]*((\s|\w)*))')
+pari_stack_warning_regex = re.compile(r'\s*\*\*\*.*(Warning: increasing stack size to )\d+\.')
find_sage_prompt = re.compile(r"^(\s*)sage: ", re.M)
find_sage_continuation = re.compile(r"^(\s*)\.\.\.\.:", re.M)
random_marker = re.compile('.*random', re.I)
@@ -935,6 +936,7 @@ class SageOutputChecker(doctest.OutputChecker):
<type 'float'>
"""
got = self.human_readable_escape_sequences(got)
+ got = pari_stack_warning_regex.sub('', got)
if isinstance(want, MarkedOutput):
if want.random:
return True

View File

@ -0,0 +1,479 @@
diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
index 3a417d9d5c..fadaadbaf6 100644
--- a/src/sage/calculus/calculus.py
+++ b/src/sage/calculus/calculus.py
@@ -231,7 +231,7 @@ Another example::
sage: f(x=3)
arcsinh(1)
sage: f.derivative(x)
- 1/3/sqrt(1/9*x^2 + 1)
+ 1/sqrt(x^2 + 9)
We compute the length of the parabola from 0 to 2::
@@ -1509,8 +1509,8 @@ def laplace(ex, t, s, algorithm='maxima'):
Testing SymPy::
sage: laplace(t^n, t, s, algorithm='sympy')
- (s^(-n)*gamma(n + 1)/s, 0, -re(n) < 1)
-
+ (gamma(n + 1)/(s*s^n), 0, -re(n) < 1)
+
Testing Maxima::
sage: laplace(t^n, t, s, algorithm='maxima')
diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
index 1fc2db5c94..f3e49b9cdb 100644
--- a/src/sage/functions/hypergeometric.py
+++ b/src/sage/functions/hypergeometric.py
@@ -34,7 +34,7 @@ Simplification (note that ``simplify_full`` does not yet call
sage: a.simplify_hypergeometric()
1/((-e^x + 1)^e^x)
sage: a.simplify_hypergeometric(algorithm='sage')
- (-e^x + 1)^(-e^x)
+ 1/((-e^x + 1)^e^x)
Equality testing::
@@ -145,7 +145,7 @@ Series expansions of confluent hypergeometric functions::
sage: hypergeometric_M(2, 2, x).series(x, 3)
1 + 1*x + 1/2*x^2 + Order(x^3)
- sage: hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n()
+ sage: hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n() # known bug (see :trac:`25688`)
0.403652637676806
sage: hypergeometric_U(2, 2, 1).n()
0.403652637676806
@@ -773,7 +773,7 @@ def closed_form(hyp):
sage: closed_form(hypergeometric([], [], z))
e^z
sage: closed_form(hypergeometric([a], [], z))
- (-z + 1)^(-a)
+ 1/((-z + 1)^a)
sage: closed_form(hypergeometric([1, 1, 2], [1, 1], z))
(z - 1)^(-2)
sage: closed_form(hypergeometric([2, 3], [1], x))
@@ -1121,7 +1121,7 @@ class Hypergeometric_U(BuiltinFunction):
sage: var('a b z')
(a, b, z)
sage: hypergeometric_U(a, b, z).generalized()
- z^(-a)*hypergeometric((a, a - b + 1), (), -1/z)
+ hypergeometric((a, a - b + 1), (), -1/z)/z^a
sage: hypergeometric_U(1, 3, 1/2).generalized()
2*hypergeometric((1, -1), (), -2)
sage: hypergeometric_U(3, I, 2).generalized()
diff --git a/src/sage/functions/log.py b/src/sage/functions/log.py
index 75d1bf8060..61968582af 100644
--- a/src/sage/functions/log.py
+++ b/src/sage/functions/log.py
@@ -518,17 +518,17 @@ class Function_polylog(GinacFunction):
sage: BF = RealBallField(100)
sage: polylog(2, BF(1/3))
- [0.36621322997706348761674629766 +/- 4.51e-30]
+ [0.36621322997706348761674629766... +/- ...]
sage: polylog(2, BF(4/3))
- nan
+ [2.27001825336107090380391448586 +/- 5.64e-30] + [-0.90377988538400159956755721265 +/- 8.39e-30]*I
sage: parent(_)
- Real ball field with 100 bits of precision
+ Complex ball field with 100 bits of precision
sage: polylog(2, CBF(1/3))
- [0.366213229977063 +/- 5.85e-16]
+ [0.366213229977063 +/- ...]
sage: parent(_)
Complex ball field with 53 bits of precision
sage: polylog(2, CBF(1))
- [1.644934066848226 +/- 6.59e-16]
+ [1.644934066848226 +/- ...]
sage: parent(_)
Complex ball field with 53 bits of precision
"""
diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py
index e7e7a311cd..1f2926d6c9 100644
--- a/src/sage/functions/trig.py
+++ b/src/sage/functions/trig.py
@@ -529,13 +529,8 @@ class Function_arcsin(GinacFunction):
arcsin
sage: asin(complex(1,1))
(0.6662394324925152+1.0612750619050357j)
-
- Check that :trac:`22823` is fixed::
-
- sage: bool(asin(SR(2.1)) == NaN)
- True
- sage: asin(SR(2.1)).is_real()
- False
+ sage: asin(SR(2.1))
+ 1.57079632679490 - 1.37285914424258*I
"""
GinacFunction.__init__(self, 'arcsin', latex_name=r"\arcsin",
conversions=dict(maxima='asin', sympy='asin', fricas="asin", giac="asin"))
@@ -595,13 +590,8 @@ class Function_arccos(GinacFunction):
arccos
sage: acos(complex(1,1))
(0.9045568943023814-1.0612750619050357j)
-
- Check that :trac:`22823` is fixed::
-
- sage: bool(acos(SR(2.1)) == NaN)
- True
- sage: acos(SR(2.1)).is_real()
- False
+ sage: acos(SR(2.1))
+ 1.37285914424258*I
"""
GinacFunction.__init__(self, 'arccos', latex_name=r"\arccos",
conversions=dict(maxima='acos', sympy='acos', fricas='acos', giac='acos'))
@@ -807,7 +797,7 @@ class Function_arcsec(GinacFunction):
sage: arcsec(2).n(100)
1.0471975511965977461542144611
sage: arcsec(1/2).n(100)
- NaN
+ 1.3169578969248167086250463473*I
sage: RDF(arcsec(2)) # abs tol 1e-15
1.0471975511965976
sage: arcsec(1 + I)
@@ -958,7 +948,9 @@ class Function_arctan2(GinacFunction):
sage: atan2(0,0,hold=True)
arctan2(0, 0)
sage: atan2(0,0,hold=True).n()
- NaN
+ Traceback (most recent call last):
+ ...
+ RuntimeError: atan2(): division by zero
Check if :trac:`10062` is fixed, this was caused by
``(I*I).is_positive()`` returning ``True``::
diff --git a/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py b/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
index 3b5c8d1729..1c6b73a16c 100644
--- a/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
+++ b/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
@@ -1422,8 +1422,10 @@ class HyperbolicGeodesicUHP(HyperbolicGeodesic):
expressions do not generate runtime errors. ::
sage: g=HyperbolicPlane().UHP().get_geodesic(-1+I,1+I)
- sage: g.midpoint()
- Point in UHP 1/2*(sqrt(2)*e^(1/2*arccosh(3)) - sqrt(2) + (I - 1)*e^(1/2*arccosh(3)) + I - 1)/((1/4*I - 1/4)*sqrt(2)*e^(1/2*arccosh(3)) - (1/4*I - 1/4)*sqrt(2) + 1/2*e^(1/2*arccosh(3)) + 1/2)
+ sage: point = g.midpoint(); point
+ Point in UHP -1/2*(sqrt(2)*...
+ sage: QQbar(point.coordinates()).radical_expression()
+ I*sqrt(2)
Check that floating points remain floating points
in :meth:`midpoint` ::
diff --git a/src/sage/interfaces/fricas.py b/src/sage/interfaces/fricas.py
index 82aae78e37..8501ea2a18 100644
--- a/src/sage/interfaces/fricas.py
+++ b/src/sage/interfaces/fricas.py
@@ -1084,14 +1084,14 @@ class FriCASElement(ExpectElement):
0.451026811796262,
0.732815101786507,
0.837981225008390,
- NaN,
- NaN,
+ 1.57079632679490 - 0.467145308103262*I,
+ 0.467145308103262*I,
1.11976951499863,
0.451026811796262,
0.732815101786507,
0.837981225008390,
- NaN,
- NaN]
+ 1.57079632679490 - 0.467145308103262*I,
+ 0.467145308103262*I]
sage: l = [tanh, sinh, cosh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch, arcsinh, arccosh, arctanh, arccoth, arcsech, arccsch]
sage: [f(x)._fricas_().sage().subs(x=0.9) for f in l] # optional - fricas
[0.716297870199024,
diff --git a/src/sage/libs/pynac/pynac.pyx b/src/sage/libs/pynac/pynac.pyx
index 9e9d8f664b..e3406f007e 100644
--- a/src/sage/libs/pynac/pynac.pyx
+++ b/src/sage/libs/pynac/pynac.pyx
@@ -1824,7 +1824,7 @@ cdef py_atan2(x, y):
sage: atan2(CC(I), CC(I+1))
0.553574358897045 + 0.402359478108525*I
sage: atan2(CBF(I), CBF(I+1))
- [0.55357435889705 +/- 5.58e-15] + [0.402359478108525 +/- 7.11e-16]*I
+ [0.55357435889705 +/- ...] + [0.402359478108525 +/- ...]*I
Check that :trac:`23776` is fixed and RDF input gives real output::
diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
index 46a15e53eb..7a0beb437b 100644
--- a/src/sage/matrix/matrix_symbolic_dense.pyx
+++ b/src/sage/matrix/matrix_symbolic_dense.pyx
@@ -200,7 +200,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
sage: eval, [evec], mult = es[0]
sage: delta = eval*evec - evec*A
sage: abs(abs(delta)) < 1e-10
- sqrt(9/25*((2*sqrt(6) - 3)*(sqrt(6) - 2) + 7*sqrt(6) - 18)^2 + 9/25*((sqrt(6) - 2)*(sqrt(6) - 4) + 6*sqrt(6) - 14)^2) < (1.00000000000000e-10)
+ 3/5*sqrt(((2*sqrt(6) - 3)*(sqrt(6) - 2) + 7*sqrt(6) - 18)^2 + ((sqrt(6) - 2)*(sqrt(6) - 4) + 6*sqrt(6) - 14)^2) < (1.00000000000000e-10)
sage: abs(abs(delta)).n() < 1e-10
True
diff --git a/src/sage/modules/matrix_morphism.py b/src/sage/modules/matrix_morphism.py
index 17a1d6e290..03892ceec0 100644
--- a/src/sage/modules/matrix_morphism.py
+++ b/src/sage/modules/matrix_morphism.py
@@ -214,9 +214,9 @@ class MatrixMorphism_abstract(sage.categories.morphism.Morphism):
sage: f((1, 0))
Traceback (most recent call last):
...
- TypeError: Unable to coerce entries (=[1.00000000000000*I, 0.000000000000000]) to coefficients in Real Field with 53 bits of precision
+ TypeError: Unable to coerce entries (=[1.00000000000000*I, 0]) to coefficients in Real Field with 53 bits of precision
sage: f((1, 0), coerce=False)
- (1.00000000000000*I, 0.000000000000000)
+ (1.00000000000000*I, 0)
"""
if self.domain().is_ambient():
diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py
index 77cdeb8c46..e501e74036 100644
--- a/src/sage/plot/plot.py
+++ b/src/sage/plot/plot.py
@@ -2061,7 +2061,7 @@ def _plot(funcs, xrange, parametric=False,
plot properly (:trac:`13246`)::
sage: parametric_plot((x, arcsec(x)), (x, -2, 2))
- Graphics object consisting of 1 graphics primitive
+ Graphics object consisting of 2 graphics primitives
"""
from sage.plot.colors import Color
diff --git a/src/sage/repl/display/formatter.py b/src/sage/repl/display/formatter.py
index 8ce2e839d7..948207c95e 100644
--- a/src/sage/repl/display/formatter.py
+++ b/src/sage/repl/display/formatter.py
@@ -25,11 +25,11 @@ generally, all sage expression as an ASCII art object::
sage: shell = get_test_shell()
sage: shell.run_cell('%display ascii_art')
sage: shell.run_cell('integral(x^2/pi^x, x)')
- / 2 2 \ -x*log(pi)
- -\x *log (pi) + 2*x*log(pi) + 2/*e
- ---------------------------------------------
- 3
- log (pi)
+ -x / 2 2 \
+ -pi *\x *log (pi) + 2*x*log(pi) + 2/
+ --------------------------------------
+ 3
+ log (pi)
sage: shell.run_cell("i = var('i')")
sage: shell.run_cell('sum(i*x^i, i, 0, 10)')
10 9 8 7 6 5 4 3 2
diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
index d8ebbf4f76..8c60f65e99 100644
--- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
@@ -151,8 +151,8 @@ A multiple point example (Example 6.5 of [RaWi2012]_)::
[(x + 2*y - 1, 1), (2*x + y - 1, 1)])
sage: F1 = decomp[1]
sage: F1.asymptotics(p, alpha, 2)
- (-3*((2*a^2 - 5*a*b + 2*b^2)*r^2 + (a + b)*r + 3)*((1/3)^(-a)*(1/3)^(-b))^r,
- (1/3)^(-a)*(1/3)^(-b), -3*(2*a^2 - 5*a*b + 2*b^2)*r^2 - 3*(a + b)*r - 9)
+ (-3*((2*a^2 - 5*a*b + 2*b^2)*r^2 + (a + b)*r + 3)*(1/((1/3)^a*(1/3)^b))^r,
+ 1/((1/3)^a*(1/3)^b), -3*(2*a^2 - 5*a*b + 2*b^2)*r^2 - 3*(a + b)*r - 9)
sage: alpha = [4, 3]
sage: decomp = F.asymptotic_decomposition(alpha)
sage: F1 = decomp[1]
@@ -2159,7 +2159,7 @@ class FractionWithFactoredDenominator(RingElement):
sage: p = {x: 1/3, y: 1/3}
sage: alpha = (var('a'), var('b'))
sage: F.asymptotics_multiple(p, alpha, 2, var('r')) # long time
- (3*((1/3)^(-a)*(1/3)^(-b))^r*e^(2/3), (1/3)^(-a)*(1/3)^(-b), 3*e^(2/3))
+ (3*(1/((1/3)^a*(1/3)^b))^r*e^(2/3), 1/((1/3)^a*(1/3)^b), 3*e^(2/3))
"""
from itertools import product
from sage.calculus.functions import jacobian
diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
index 16a268a02c..5fd244e93b 100644
--- a/src/sage/stats/basic_stats.py
+++ b/src/sage/stats/basic_stats.py
@@ -183,7 +183,7 @@ def std(v, bias=False):
sage: std([])
NaN
sage: std([I, sqrt(2), 3/5])
- sqrt(1/450*(10*sqrt(2) - 5*I - 3)^2 + 1/450*(5*sqrt(2) - 10*I + 3)^2 + 1/450*(5*sqrt(2) + 5*I - 6)^2)
+ 1/15*sqrt(1/2)*sqrt((10*sqrt(2) - 5*I - 3)^2 + (5*sqrt(2) - 10*I + 3)^2 + (5*sqrt(2) + 5*I - 6)^2)
sage: std([RIF(1.0103, 1.0103), RIF(2)])
0.6998235813403261?
sage: import numpy
diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
index ab4c05de3a..60f0dc549a 100644
--- a/src/sage/symbolic/expression.pyx
+++ b/src/sage/symbolic/expression.pyx
@@ -622,7 +622,7 @@ cdef class Expression(CommutativeRingElement):
sage: x^(-5)
x^(-5)
sage: x^(-y)
- x^(-y)
+ 1/(x^y)
sage: 2*x^(-1)
2/x
sage: i*x
@@ -3621,14 +3621,14 @@ cdef class Expression(CommutativeRingElement):
sage: repl_dict = {b_0: b_0, b_3: b_1, b_2: b_3, b_1: b_2}
sage: P = precomp.substitute(repl_dict)
sage: P.expand()
- -2^(-b_0)*2^(-b_2)*2^b_3 - 2^b_0*2^(-b_2)*2^b_3 -
- 2^(-b_0)*2^b_2*2^b_3 + 2^b_0*2^b_2*2^b_3 - 2*2^(-b_0)*2^(-b_2)
- - 2*2^b_0*2^(-b_2) - 2*2^(-b_0)*2^b_2 + 2*2^b_0*2^b_2 +
- 2^(-b_0)*2^b_3 + 2^b_0*2^b_3 + 2^(-b_2)*2^b_3 + 2^b_2*2^b_3 +
- 2*2^(-b_0) + 2*2^b_0 + 2*2^(-b_2) + 2*2^b_2 - 9*2^b_3 -
- 2^(-b_0)*2^(-b_2)/2^b_3 - 2^b_0*2^(-b_2)/2^b_3 -
- 2^(-b_0)*2^b_2/2^b_3 + 2^b_0*2^b_2/2^b_3 + 2^(-b_0)/2^b_3 +
- 2^b_0/2^b_3 + 2^(-b_2)/2^b_3 + 2^b_2/2^b_3 - 9/2^b_3 - 18
+ 2^b_0*2^b_2*2^b_3 + 2*2^b_0*2^b_2 + 2^b_0*2^b_3 + 2^b_2*2^b_3 +
+ 2*2^b_0 + 2*2^b_2 - 9*2^b_3 + 2^b_0*2^b_2/2^b_3 -
+ 2^b_0*2^b_3/2^b_2 - 2^b_2*2^b_3/2^b_0 - 2*2^b_0/2^b_2 -
+ 2*2^b_2/2^b_0 + 2^b_0/2^b_3 + 2^b_2/2^b_3 + 2^b_3/2^b_0 +
+ 2^b_3/2^b_2 + 2/2^b_0 + 2/2^b_2 - 2^b_0/(2^b_2*2^b_3) -
+ 2^b_2/(2^b_0*2^b_3) - 9/2^b_3 - 2^b_3/(2^b_0*2^b_2) -
+ 2/(2^b_0*2^b_2) + 1/(2^b_0*2^b_3) + 1/(2^b_2*2^b_3) -
+ 1/(2^b_0*2^b_2*2^b_3) - 18
sage: _0,b_1,b_2=var('b_0,b_1,b_2')
sage: f = 1/27*b_2^2/(2^b_2)^2 + 1/27*b_1^2/(2^b_1)^2 + \
@@ -3809,7 +3809,7 @@ cdef class Expression(CommutativeRingElement):
sage: x = SR.symbol('x', domain='real')
sage: (x^3)^(1/3)
- (x^3)^(1/3)
+ x
sage: (x^4)^(1/4)
abs(x)
sage: (x^8)^(1/4)
@@ -3872,7 +3872,7 @@ cdef class Expression(CommutativeRingElement):
sage: 2^(x/log(2))
e^x
sage: 2^(-x^2/2/log(2))
- e^(-1/2*x^2)
+ 1/e^(1/2*x^2)
sage: x^(x/log(x))
x^(x/log(x))
sage: assume(x > 0)
@@ -4816,18 +4816,24 @@ cdef class Expression(CommutativeRingElement):
sage: ((x+y)^(x+y)).match(w0^w0)
{$0: x + y}
sage: t = ((a+b)*(a+c)).match((a+w0)*(a+w1))
- sage: t[w0], t[w1]
- (c, b)
+ sage: set([t[w0], t[w1]]) == set([b, c])
+ True
sage: ((a+b)*(a+c)).match((w0+b)*(w0+c))
{$0: a}
sage: t = ((a+b)*(a+c)).match((w0+w1)*(w0+w2))
- sage: t[w0], t[w1], t[w2]
- (a, c, b)
- sage: print(((a+b)*(a+c)).match((w0+w1)*(w1+w2)))
- None
+ sage: t[w0]
+ a
+ sage: set([t[w1], t[w2]]) == set([b, c])
+ True
+ sage: t = ((a+b)*(a+c)).match((w0+w1)*(w1+w2))
+ sage: t[w1]
+ a
+ sage: set([t[w0], t[w2]]) == set([b, c])
+ True
sage: t = (a*(x+y)+a*z+b).match(a*w0+w1)
- sage: t[w0], t[w1]
- (x + y, a*z + b)
+ sage: s = set([t[w0], t[w1]])
+ sage: s == set([x+y, a*z+b]) or s == set([z, a*(x+y)+b])
+ True
sage: print((a+b+c+d+f+g).match(c))
None
sage: (a+b+c+d+f+g).has(c)
@@ -4836,7 +4842,7 @@ cdef class Expression(CommutativeRingElement):
{$0: a + b + d + f + g}
sage: (a+b+c+d+f+g).match(c+g+w0)
{$0: a + b + d + f}
- sage: (a+b).match(a+b+w0)
+ sage: (a+b).match(a+b+w0) # known bug
{$0: 0}
sage: print((a*b^2).match(a^w0*b^w1))
None
@@ -5009,7 +5015,7 @@ cdef class Expression(CommutativeRingElement):
a^3 + b^3 + (x + y)^3
sage: t.subs(w0 == w0^2)
- (x^2 + y^2)^18 + a^16 + b^16
+ a^8 + b^8 + (x^2 + y^2)^6
sage: t.subs(a == b, b == c)
(x + y)^3 + b^2 + c^2
@@ -8392,9 +8398,13 @@ cdef class Expression(CommutativeRingElement):
sage: SR(I).arctan2(1)
arctan2(I, 1)
sage: SR(CDF(0,1)).arctan2(1)
- NaN + +infinity*I
- sage: SR(1).arctan2(CDF(0,1)) # known bug
- 0.7853981633974484 - 19.012501686914433*I
+ Traceback (most recent call last):
+ ...
+ ValueError: power::eval(): division by zero
+ sage: SR(1).arctan2(CDF(0,1))
+ Traceback (most recent call last):
+ ...
+ ValueError: power::eval(): division by zero
sage: arctan2(0,oo)
0
@@ -8656,7 +8666,7 @@ cdef class Expression(CommutativeRingElement):
1/2*I*pi
sage: SR(1/2).arccosh()
arccosh(1/2)
- sage: SR(CDF(1/2)).arccosh() # rel tol 1e-15
+ sage: SR(CDF(1/2)).arccosh() # rel tol 1e-15
1.0471975511965976*I
sage: maxima('acosh(0.5)')
1.04719755119659...*%i
@@ -11687,7 +11697,7 @@ cdef class Expression(CommutativeRingElement):
sage: a.solve(t)
[]
sage: b = a.canonicalize_radical(); b
- -23040.0*(-2.0*e^(1800*t) + 25.0*e^(900*t) - 32.0)*e^(-2400*t)
+ (46080.0*e^(1800*t) - 576000.0*e^(900*t) + 737280.0)*e^(-2400*t)
sage: b.solve(t)
[]
sage: b.solve(t, to_poly_solve=True)
@@ -12163,14 +12173,14 @@ cdef class Expression(CommutativeRingElement):
sage: (n,k,j)=var('n,k,j')
sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
- -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
+ -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
sage: assume(j>-1)
sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
1
sage: forget()
sage: assume(n>=j)
sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
- -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
+ -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
sage: forget()
sage: assume(j==-1)
sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
@@ -12178,7 +12188,7 @@ cdef class Expression(CommutativeRingElement):
sage: forget()
sage: assume(j<-1)
sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
- -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
+ -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
sage: forget()
Check that :trac:`16176` is fixed::
diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
index da6f0eef42..4bd65ef572 100644
--- a/src/sage/symbolic/relation.py
+++ b/src/sage/symbolic/relation.py
@@ -895,7 +895,7 @@ def solve(f, *args, **kwds):
sage: (r[0][x], r[0][y])
(2*lambert_w(1/2), 1)
sage: solve(-2*x**3 + 4*x**2 - 2*x + 6 > 0, x, algorithm='sympy')
- [x < (1/6*sqrt(77) + 79/54)^(1/3) + 1/9/(1/6*sqrt(77) + 79/54)^(1/3) + 2/3]
+ [x < 1/3*(1/2)^(1/3)*(9*sqrt(77) + 79)^(1/3) + 2/3*(1/2)^(2/3)/(9*sqrt(77) + 79)^(1/3) + 2/3]
sage: solve(sqrt(2*x^2 - 7) - (3 - x),x,algorithm='sympy')
[x == -8, x == 2]
sage: solve(sqrt(2*x + 9) - sqrt(x + 1) - sqrt(x + 4),x,algorithm='sympy')

View File

@ -0,0 +1,28 @@
diff --git a/src/sage/all.py b/src/sage/all.py
index ca309ef..be3186b 100644
--- a/src/sage/all.py
+++ b/src/sage/all.py
@@ -298,6 +298,23 @@ warnings.filterwarnings('ignore', module='matplotlib[.]font_manager')
warnings.filterwarnings('default',
'[\s\S]*See http://trac.sagemath.org/[0-9]* for details.')
+# Hotpatch around https://bugs.python.org/issue5755 which won't be fixed for
+# python 2.7. Idea by https://stackoverflow.com/a/36293331.
+from distutils.command.build_ext import build_ext
+from distutils.sysconfig import customize_compiler
+
+_build_extensions = build_ext.build_extensions
+
+def build_extensions_patched(self):
+ customize_compiler(self.compiler)
+ try:
+ self.compiler.compiler_so.remove("-Wstrict-prototypes")
+ except (AttributeError, ValueError):
+ pass
+ _build_extensions(self)
+
+build_ext.build_extensions = build_extensions_patched
+
# Set a new random number seed as the very last thing
# (so that printing initial_seed() and using that seed

View File

@ -0,0 +1,40 @@
diff --git a/src/sage/tests/py3_syntax.py b/src/sage/tests/py3_syntax.py
index e564860b48..86ab3725f9 100644
--- a/src/sage/tests/py3_syntax.py
+++ b/src/sage/tests/py3_syntax.py
@@ -179,15 +179,30 @@ class Python3SyntaxTest(SortedDirectoryWalkerABC):
sage: py3_syntax = Python3SyntaxTest()
sage: py3_syntax.test(src.name)
Invalid Python 3 syntax found:
- File "...py", line 1
- print "invalid print statement"
- ^
- SyntaxError: Missing parentheses in call to 'print'
+ Missing parentheses in call to 'print'...
sage: os.unlink(src.name)
"""
+
+ # compile all given files in memory, printing all errors
+ # inspired by the py_compile module (but without writing to file)
+ script = """
+import sys
+import importlib.machinery
+rv = 0
+for file in sys.argv[1:]:
+ loader = importlib.machinery.SourceFileLoader('<sage_test>', file)
+ source_bytes = loader.get_data(file)
+ try:
+ code = loader.source_to_code(source_bytes, file)
+ except Exception as err:
+ print(err)
+ rv = 1
+sys.exit(rv)
+"""
cmd = [
'python3',
- '-m', 'py_compile'
+ '-c',
+ script,
] + list(filenames)
process = subprocess.Popen(
cmd,

View File

@ -0,0 +1,14 @@
reverted:
--- b/src/sage/geometry/polyhedron/backend_cdd.py
+++ a/src/sage/geometry/polyhedron/backend_cdd.py
@@ -154,7 +154,9 @@
... [0.62, -1.38, 0.38],[0.144, -1.04, 0.04],
... [0.1309090909, -1.0290909091, 0.04]]
sage: Polyhedron(point_list)
+ Traceback (most recent call last):
+ ...
+ ValueError: *Error: Numerical inconsistency is found. Use the GMP exact arithmetic.
- A 3-dimensional polyhedron in RDF^3 defined as the convex hull of 14 vertices
sage: Polyhedron(point_list, base_ring=QQ)
A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 14 vertices
"""

View File

@ -0,0 +1,31 @@
From 7419e0246230594ebfd5e7a2fe6b80d67abfc98a Mon Sep 17 00:00:00 2001
From: Jeroen Demeyer <jdemeyer@cage.ugent.be>
Date: Tue, 20 Mar 2018 10:40:41 +0100
Subject: Fix sphinxify doctests
---
sagenb/misc/sphinxify.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sagenb/misc/sphinxify.py b/sagenb/misc/sphinxify.py
index 4f76d41..15623d9 100644
--- a/sagenb/misc/sphinxify.py
+++ b/sagenb/misc/sphinxify.py
@@ -47,11 +47,11 @@ def sphinxify(docstring, format='html'):
sage: from sage.misc.sphinxify import sphinxify
sage: sphinxify('A test')
- '...<div class="docstring">\n \n <p>A test</p>\n\n\n</div>'
+ '<div class="docstring">\n \n <p>A test</p>\n\n\n</div>'
sage: sphinxify('**Testing**\n`monospace`')
- '...<div class="docstring"...<strong>Testing</strong>\n<span class="math"...</p>\n\n\n</div>'
+ '<div class="docstring"...<strong>Testing</strong>\n<span class="math notranslate"...</p>\n\n\n</div>'
sage: sphinxify('`x=y`')
- '...<div class="docstring">\n \n <p><span class="math">x=y</span></p>\n\n\n</div>'
+ '<div class="docstring">\n \n <p><span class="math notranslate">x=y</span></p>\n\n\n</div>'
sage: sphinxify('`x=y`', format='text')
'x=y\n'
sage: sphinxify(':math:`x=y`', format='text')
--
cgit v1.0-1-gd88e

View File

@ -0,0 +1,62 @@
diff --git a/src/bin/sage b/src/bin/sage
index 397f30cbed..3fc473c343 100755
--- a/src/bin/sage
+++ b/src/bin/sage
@@ -980,8 +980,11 @@ if [ "$1" = '-rsyncdist' -o "$1" = "--rsyncdist" ]; then
fi
if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then
+ # Redirect stdin from /dev/null. This helps with running TeX which
+ # tends to ask interactive questions if something goes wrong. These
+ # cause the build to hang. If stdin is /dev/null, TeX just aborts.
shift
- exec sage-python23 -m "sage_setup.docbuild" "$@"
+ exec sage-python23 -m sage_setup.docbuild "$@" </dev/null
fi
if [ "$1" = '-gdb' -o "$1" = "--gdb" ]; then
diff --git a/src/doc/common/conf.py b/src/doc/common/conf.py
index 25f94f7b7d..3f07474d9b 100644
--- a/src/doc/common/conf.py
+++ b/src/doc/common/conf.py
@@ -627,7 +627,7 @@ def call_intersphinx(app, env, node, contnode):
sage: for line in open(thematic_index).readlines():
....: if "padics" in line:
....: sys.stdout.write(line)
- <li><a class="reference external" href="../reference/padics/sage/rings/padics/tutorial.html#sage-rings-padics-tutorial" title="(in Sage Reference Manual: p-Adics ...)"><span>Introduction to the -adics</span></a></li>
+ <li><a class="reference external" href="../reference/padics/sage/rings/padics/tutorial.html#sage-rings-padics-tutorial" title="(in Sage Reference Manual: p-Adics v...)"><span>Introduction to the -adics</span></a></li>
"""
debug_inf(app, "???? Trying intersphinx for %s"%node['reftarget'])
builder = app.builder
diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py
index 4f76d4113a..8f426b5989 100644
--- a/src/sage/misc/sphinxify.py
+++ b/src/sage/misc/sphinxify.py
@@ -47,11 +47,11 @@ def sphinxify(docstring, format='html'):
sage: from sage.misc.sphinxify import sphinxify
sage: sphinxify('A test')
- '...<div class="docstring">\n \n <p>A test</p>\n\n\n</div>'
+ '<div class="docstring">\n \n <p>A test</p>\n\n\n</div>'
sage: sphinxify('**Testing**\n`monospace`')
- '...<div class="docstring"...<strong>Testing</strong>\n<span class="math"...</p>\n\n\n</div>'
+ '<div class="docstring"...<strong>Testing</strong>\n<span class="math...</p>\n\n\n</div>'
sage: sphinxify('`x=y`')
- '...<div class="docstring">\n \n <p><span class="math">x=y</span></p>\n\n\n</div>'
+ '<div class="docstring">\n \n <p><span class="math notranslate nohighlight">x=y</span></p>\n\n\n</div>'
sage: sphinxify('`x=y`', format='text')
'x=y\n'
sage: sphinxify(':math:`x=y`', format='text')
diff --git a/src/sage_setup/docbuild/sphinxbuild.py b/src/sage_setup/docbuild/sphinxbuild.py
index fda76a4174..d3413239dd 100644
--- a/src/sage_setup/docbuild/sphinxbuild.py
+++ b/src/sage_setup/docbuild/sphinxbuild.py
@@ -207,7 +207,7 @@ def runsphinx():
try:
sys.stdout = SageSphinxLogger(sys.stdout, os.path.basename(output_dir))
sys.stderr = SageSphinxLogger(sys.stderr, os.path.basename(output_dir))
- sphinx.cmdline.main(sys.argv)
+ sphinx.cmdline.main(sys.argv[1:])
finally:
sys.stdout = saved_stdout
sys.stderr = saved_stderr

View File

@ -0,0 +1,31 @@
diff --git a/src/sage/repl/ipython_kernel/install.py b/src/sage/repl/ipython_kernel/install.py
index aa23c8405d..8a87de0591 100644
--- a/src/sage/repl/ipython_kernel/install.py
+++ b/src/sage/repl/ipython_kernel/install.py
@@ -112,7 +112,7 @@ class SageKernelSpec(object):
EXAMPLES::
sage: from sage.repl.ipython_kernel.install import SageKernelSpec
- sage: spec = SageKernelSpec()
+ sage: spec = SageKernelSpec(prefix = tmp_dir())
sage: spec.use_local_mathjax()
sage: mathjax = os.path.join(spec.nbextensions_dir, 'mathjax')
sage: os.path.isdir(mathjax)
@@ -129,7 +129,7 @@ class SageKernelSpec(object):
EXAMPLES::
sage: from sage.repl.ipython_kernel.install import SageKernelSpec
- sage: spec = SageKernelSpec()
+ sage: spec = SageKernelSpec(prefix = tmp_dir())
sage: spec.use_local_jsmol()
sage: jsmol = os.path.join(spec.nbextensions_dir, 'jsmol')
sage: os.path.isdir(jsmol)
@@ -146,7 +146,7 @@ class SageKernelSpec(object):
EXAMPLES::
sage: from sage.repl.ipython_kernel.install import SageKernelSpec
- sage: spec = SageKernelSpec()
+ sage: spec = SageKernelSpec(prefix = tmp_dir())
sage: spec.use_local_threejs()
sage: threejs = os.path.join(spec.nbextensions_dir, 'threejs')
sage: os.path.isdir(threejs)

View File

@ -0,0 +1,13 @@
diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py
index 7ff4f21675..1d72168833 100644
--- a/src/sage/misc/package.py
+++ b/src/sage/misc/package.py
@@ -350,7 +350,7 @@ def package_versions(package_type, local=False):
sage: 'gap' in std
True
sage: std['zn_poly']
- ('0.9.p11', '0.9.p11')
+ ('0.9', '0.9.p11')
"""
return {pkg['name']: (pkg['installed_version'], pkg['remote_version']) for pkg in list_packages(package_type, local=local).values()}

View File

@ -0,0 +1,29 @@
{ stdenv
, fetchFromGitHub
, buildPythonPackage
}:
# This has a cyclic dependency with sage. I don't include sage in the
# buildInputs and let python figure it out at runtime. Because of this,
# I don't include the package in the main nipxkgs tree. It wouldn't be useful
# outside of sage anyways (as you could just directly depend on sage and use
# it).
buildPythonPackage rec {
pname = "pyBRiAl";
version = "1.2.3";
# included with BRiAl source
src = fetchFromGitHub {
owner = "BRiAl";
repo = "BRiAl";
rev = "${version}";
sha256 = "0qy4cwy7qrk4zg151cmws5cglaa866z461cnj9wdnalabs7v7qbg";
};
sourceRoot = "source/sage-brial";
meta = with stdenv.lib; {
description = "python implementation of BRiAl";
license = licenses.gpl2;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,42 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, isPy3k
, django
, nose
, twill
, pycrypto
}:
buildPythonPackage rec {
pname = "python-openid";
version = "2.2.5";
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "1vvhxlghjan01snfdc4k7ykd80vkyjgizwgg9bncnin8rqz1ricj";
};
propagatedBuildInputs = [
django
twill
pycrypto
];
# Cannot access the djopenid example module.
# I don't know how to fix that (adding the examples dir to PYTHONPATH doesn't work)
doCheck = false;
checkInputs = [ nose ];
checkPhase = ''
nosetests
'';
meta = with stdenv.lib; {
description = "OpenID library for Python";
license = licenses.asl20;
maintainers = with maintainers; [ timokau ];
homepage = https://github.com/openid/python-openid/;
};
}

View File

@ -0,0 +1,162 @@
{ stdenv
, lib
, writeTextFile
, python
, sage-src
, sagelib
, env-locations
, gfortran
, bash
, coreutils
, gnused
, gnugrep
, binutils
, pythonEnv
, python3
, pkg-config
, pari
, gap-libgap-compatible
, libgap
, ecl
, maxima-ecl
, singular
, giac
, palp
, rWrapper
, gfan
, cddlib
, jmol
, tachyon
, glpk
, eclib
, sympow
, nauty
, sqlite
, ppl
, ecm
, lcalc
, rubiks
, flintqs
, openblas-cblas-pc
, flint
, gmp
, mpfr
, pynac
, zlib
, gsl
, ntl
}:
let
runtimepath = (lib.makeBinPath ([
"@sage-local@"
"@sage-local@/build"
pythonEnv
# empty python env to add python wrapper that clears PYTHONHOME (see
# wrapper.nix). This is necessary because sage will call the python3 binary
# (from python2 code). The python2 PYTHONHOME (again set in wrapper.nix)
# will then confuse python3, if it is not overwritten.
python3.buildEnv
gfortran # for inline fortran
stdenv.cc # for cython
bash
coreutils
gnused
gnugrep
binutils.bintools
pkg-config
pari
gap-libgap-compatible
libgap
ecl
maxima-ecl
singular
giac
palp
rWrapper
gfan
cddlib
jmol
tachyon
glpk
eclib
sympow
nauty
sqlite
ppl
ecm
lcalc
rubiks
flintqs
]
));
in
writeTextFile rec {
name = "sage-env";
destination = "/${name}";
text = ''
export PKG_CONFIG_PATH='${lib.concatStringsSep ":" (map (pkg: "${pkg}/lib/pkgconfig") [
# This is only needed in the src/sage/misc/cython.py test and I'm not sure if there's really a use-case
# for it outside of the tests. However since singular and openblas are runtime dependencies anyways
# and openblas-cblas-pc is tiny, it doesn't really hurt to include.
singular
openblas-cblas-pc
])
}'
export SAGE_ROOT='${sage-src}'
export SAGE_LOCAL='@sage-local@'
export SAGE_SHARE='${sagelib}/share'
orig_path="$PATH"
export PATH='${runtimepath}'
# set dependent vars, like JUPYTER_CONFIG_DIR
source "${sage-src}/src/bin/sage-env"
export PATH="${runtimepath}:$orig_path" # sage-env messes with PATH
export SAGE_LOGS="$TMPDIR/sage-logs"
export SAGE_DOC="''${SAGE_DOC_OVERRIDE:-doc-placeholder}"
export SAGE_DOC_SRC="''${SAGE_DOC_SRC_OVERRIDE:-${sage-src}/src/doc}"
# set locations of dependencies
. ${env-locations}/sage-env-locations
# needed for cython
export CC='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc'
# cython needs to find these libraries, otherwise will fail with `ld: cannot find -lflint` or similar
export LDFLAGS='${
lib.concatStringsSep " " (map (pkg: "-L${pkg}/lib") [
flint
libgap
glpk
gmp
mpfr
pari
pynac
zlib
eclib
gsl
ntl
jmol
sympow
])
}'
export CFLAGS='${
lib.concatStringsSep " " (map (pkg: "-isystem ${pkg}/include") [
singular
gmp.dev
glpk
flint
libgap
pynac
mpfr.dev
])
}'
export SAGE_LIB='${sagelib}/${python.sitePackages}'
export SAGE_EXTCODE='${sage-src}/src/ext'
# for find_library
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}:$DYLD_LIBRARY_PATH"
'';
}

View File

@ -0,0 +1,205 @@
{ stdenv
, fetchFromGitHub
, fetchpatch
}:
stdenv.mkDerivation rec {
version = "8.2";
name = "sage-src-${version}";
src = fetchFromGitHub {
owner = "sagemath";
repo = "sage";
rev = version;
sha256 = "0d7vc16s7dj23an2cb8v5bhbnc6nsw20qhnnxr0xh8qg629027b8";
};
nixPatches = [
# https://trac.sagemath.org/ticket/25309
(fetchpatch {
name = "spkg-paths.patch";
url = "https://git.sagemath.org/sage.git/patch/?h=97f06fddee920399d4fcda65aa9b0925774aec69&id=a86151429ccce1ddd085e8090ada8ebdf02f3310";
sha256 = "1xb9108rzzkdhn71vw44525620d3ww9jv1fph5a77v9y7nf9wgr7";
})
(fetchpatch {
name = "maxima-fas.patch";
url = "https://git.sagemath.org/sage.git/patch/?h=97f06fddee920399d4fcda65aa9b0925774aec69";
sha256 = "14s50yg3hpw9cp3v581dx7zfmpm2j972im7x30iwki8k45mjvk3i";
})
# https://trac.sagemath.org/ticket/25328
# https://trac.sagemath.org/ticket/25546
# https://trac.sagemath.org/ticket/25722
(fetchpatch {
name = "install-jupyter-kernel-in-correct-prefix.patch";
url = "https://git.sagemath.org/sage.git/patch?id=72167b98e3f64326df6b2c78785df25539472fcc";
sha256 = "0pscnjhm7r2yr2rxnv4kkkq626vwaja720lixa3m3w9rwlxll5a7";
})
./patches/test-in-tmpdir.patch
# https://trac.sagemath.org/ticket/25358
(fetchpatch {
name = "safe-directory-test-without-patch.patch";
url = "https://git.sagemath.org/sage.git/patch?id2=8bdc326ba57d1bb9664f63cf165a9e9920cc1afc&id=dc673c17555efca611f68398d5013b66e9825463";
sha256 = "1hhannz7xzprijakn2w2d0rhd5zv2zikik9p51i87bas3nc658f7";
})
# https://trac.sagemath.org/ticket/25357 rebased on 8.2
./patches/python3-syntax-without-write.patch
# https://trac.sagemath.org/ticket/25314
(fetchpatch {
name = "make-qepcad-test-optional.patch";
url = "https://git.sagemath.org/sage.git/patch/?h=fe294c58bd035ef427e268901d54a6faa0058138";
sha256 = "003d5baf5c0n5rfg010ijwkwz8kg0s414cxwczs2vhdayxdixbix";
})
# https://trac.sagemath.org/ticket/25316
./patches/python-5755-hotpatch.patch
# https://trac.sagemath.org/ticket/25354
# https://trac.sagemath.org/ticket/25531
(fetchpatch {
name = "cysignals-include.patch";
url = "https://git.sagemath.org/sage.git/patch/?h=28778bd25a37c80884d2b24e0683fb2989300cef";
sha256 = "0fiiiw91pgs8avm9ggj8hb64bhqzl6jcw094d94nhirmh8w2jmc5";
})
# https://trac.sagemath.org/ticket/25315
(fetchpatch {
name = "find-libraries-in-dyld-library-path.patch";
url = "https://git.sagemath.org/sage.git/patch/?h=20d4593876ce9c6004eac2ab6fd61786d0d96a06";
sha256 = "1k3afq3qlzmgqwx6rzs5wv153vv9dsf5rk8pi61g57l3r3npbjmc";
})
# Pari upstream has since accepted a patch, so this patch won't be necessary once sage updates pari.
# https://trac.sagemath.org/ticket/25312
./patches/pari-stackwarn.patch
# https://trac.sagemath.org/ticket/25311
./patches/zn_poly_version.patch
# https://trac.sagemath.org/ticket/25345
# (upstream patch doesn't apply on 8.2 source)
./patches/dochtml-optional.patch
];
packageUpgradePatches = [
# matplotlib 2.2.2 deprecated `normed` (replaced by `density`).
# This patch only ignores the warning. It would be equally easy to fix it
# (by replacing all mentions of `normed` by `density`), but its better to
# stay close to sage upstream. I didn't open an upstream ticket about it
# because the matplotlib update also requires a new dependency (kiwisolver)
# and I don't want to invest the time to learn how to add it.
./patches/matplotlib-normed-deprecated.patch
# Update to 20171219 broke the doctests because of insignificant precision
# changes, make the doctests less fragile.
# I didn't open an upstream ticket because its not entirely clear if
# 20171219 is really "released" yet. It is listed on the github releases
# page, but not marked as "latest release" and the homepage still links to
# the last version.
./patches/eclib-regulator-precision.patch
# sphinx 1.6 -> 1.7 upgrade
# https://trac.sagemath.org/ticket/24935
./patches/sphinx-1.7.patch
# https://trac.sagemath.org/ticket/25320
(fetchpatch {
name = "zero_division_error_formatting.patch";
url = "https://git.sagemath.org/sage.git/patch/?h=f79070ddd09fa0ad6b340b097bd8d690a7aa35f0";
sha256 = "02wsc3wbp8g8dk5jcjyv18d9v537h3zp5v8lwir46j4na4kj0dlb";
})
# Adapt hashes to new boost version
# https://trac.sagemath.org/ticket/22243
# (this ticket doesn't only upgrade boost but also avoids this problem in the future)
(fetchpatch {
name = "boost-upgrade.patch";
url = "https://git.sagemath.org/sage.git/patch?id=a24a9c6b30b93957333a3116196214a931325b69";
sha256 = "0z3870g2ms2a81vnw08dc2i4k7jr62w8fggvcdwaavgd1wvdxwfl";
})
# gfan 0.6.2
# https://trac.sagemath.org/ticket/23353
(fetchpatch {
name = "gfan-update.patch";
url = "https://git.sagemath.org/sage.git/patch/?h=420215fc469cde733ec7a339e59b78ad6eec804c&id=112498a293ea2bf563e41aed35f1aa608f01b349";
sha256 = "0ga3hkx8cr23dpc919lgvpi5lmy0d728jkq9z6kf0fl9s8g31mxb";
})
# New glpk version has new warnings, filter those out until upstream sage has found a solution
# https://trac.sagemath.org/ticket/24824
(fetchpatch {
url = "https://salsa.debian.org/science-team/sagemath/raw/58bbba93a807ca2933ca317501d093a1bb4b84db/debian/patches/dt-version-glpk-4.65-ignore-warnings.patch";
sha256 = "0b9293v73wb4x13wv5zwyjgclc01zn16msccfzzi6znswklgvddp";
stripLen = 1;
})
# https://trac.sagemath.org/ticket/25329
(fetchpatch {
name = "dont-check-exact-glpk-version.patch";
url = "https://git.sagemath.org/sage.git/patch?id2=8bdc326ba57d1bb9664f63cf165a9e9920cc1afc&id=89d068d8d77316bfffa6bf8e9ebf70b3b3b88e5c";
sha256 = "00knwxs6fmymfgfl0q5kcavmxm9sf90a4r76y35n5s55gj8pl918";
})
# https://trac.sagemath.org/ticket/25355
(fetchpatch {
name = "maxima-5.41.0.patch";
url = "https://git.sagemath.org/sage.git/patch/?id=87328023c4739abdf24108038201e3fa9bdfc739";
sha256 = "0hxi7qr5mfx1bc32r8j7iba4gzd7c6v63asylyf5cbyp86azpb7i";
})
# Update cddlib from 0.94g to 0.94h.
# https://trac.sagemath.org/ticket/25341 (doesn't apply to 8.2 sources)
(fetchpatch {
url = "https://salsa.debian.org/science-team/sagemath/raw/58bbba93a807ca2933ca317501d093a1bb4b84db/debian/patches/u2-version-cddlib-094h.patch";
sha256 = "0fmw7pzbaxs2dshky6iw9pr8i23p9ih2y2lw661qypdrxh5xw03k";
stripLen = 1;
})
./patches/revert-269c1e1551285.patch
# Only formatting changes.
# https://trac.sagemath.org/ticket/25260
./patches/numpy-1.14.3.patch
# https://trac.sagemath.org/ticket/24374
(fetchpatch {
name = "networkx-2.1.patch";
url = "https://salsa.debian.org/science-team/sagemath/raw/487df9ae48ca1d93d9b1cb3af8745d31e30fb741/debian/patches/u0-version-networkx-2.1.patch";
sha256 = "1xxxawygbgxgvlv7b4w8hhzgdnva4rhmgdxaiaa3pwdwln0yc750";
stripLen = 1;
})
# https://trac.sagemath.org/ticket/24927 rebased
./patches/arb-2.13.0.patch
# https://trac.sagemath.org/ticket/24838 rebased
./patches/pynac-0.7.22.patch
];
patches = nixPatches ++ packageUpgradePatches;
postPatch = ''
# make sure shebangs etc are fixed, but sage-python23 still works
find . -type f -exec sed \
-e 's/sage-python23/python/g' \
-i {} \;
echo '#!${stdenv.shell}
python "$@"' > build/bin/sage-python23
# Do not use sage-env-config (generated by ./configure).
# Instead variables are set manually.
echo '# do nothing' > src/bin/sage-env-config
'';
configurePhase = "# do nothing";
buildPhase = "# do nothing";
installPhase = ''
cp -r . "$out"
'';
}

View File

@ -0,0 +1,129 @@
{ stdenv
, lib
, makeWrapper
, sage-env
, sage-src
, sagelib
, sagedoc
, openblasCompat
, openblas-blas-pc
, openblas-cblas-pc
, openblas-lapack-pc
, pkg-config
, three
, singular
, libgap
, gap-libgap-compatible
, gcc
, giac
, maxima-ecl
, pari
, gmp
, gfan
, python2
, flintqs
, eclib
, ntl
, ecm
, pynac
, pythonEnv
}:
let
buildInputs = [
pythonEnv # for patchShebangs
makeWrapper
pkg-config
openblasCompat # lots of segfaults with regular (64 bit) openblas
openblas-blas-pc
openblas-cblas-pc
openblas-lapack-pc
singular
three
pynac
giac
libgap
gap-libgap-compatible
pari
gmp
gfan
maxima-ecl
eclib
flintqs
ntl
ecm
];
# remove python prefix, replace "-" in the name by "_", apply patch_names
# python2.7-some-pkg-1.0 -> some_pkg-1.0
pkg_to_spkg_name = pkg: patch_names: let
parts = lib.splitString "-" pkg.name;
# remove python2.7-
stripped_parts = if (builtins.head parts) == python2.libPrefix then builtins.tail parts else parts;
version = lib.last stripped_parts;
orig_pkgname = lib.init stripped_parts;
pkgname = patch_names (lib.concatStringsSep "_" orig_pkgname);
in pkgname + "-" + version;
# return the names of all dependencies in the transitive closure
transitiveClosure = dep:
if isNull dep then
# propagatedBuildInputs might contain null
# (although that might be considered a programming error in the derivation)
[]
else
[ dep ] ++ (
if builtins.hasAttr "propagatedBuildInputs" dep then
lib.unique (builtins.concatLists (map transitiveClosure dep.propagatedBuildInputs))
else
[]
);
allInputs = lib.remove null (buildInputs ++ pythonEnv.extraLibs);
transitiveDeps = lib.unique (builtins.concatLists (map transitiveClosure allInputs ));
# fix differences between spkg and sage names
# (could patch sage instead, but this is more lightweight and also works for packages depending on sage)
patch_names = builtins.replaceStrings [
"zope.interface"
"node_three"
] [
"zope_interface"
"threejs"
];
# spkg names (this_is_a_package-version) of all transitive deps
input_names = map (dep: pkg_to_spkg_name dep patch_names) transitiveDeps;
in
stdenv.mkDerivation rec {
version = sage-src.version;
name = "sage-with-env-${version}";
inherit buildInputs;
src = sage-src;
configurePhase = "#do nothing";
buildPhase = ''
mkdir installed
for pkg in ${lib.concatStringsSep " " input_names}; do
touch "installed/$pkg"
done
'';
installPhase = ''
mkdir -p "$out/var/lib/sage"
cp -r installed $out/var/lib/sage
mkdir -p "$out/etc"
# sage tests will try to create this file if it doesn't exist
touch "$out/etc/sage-started.txt"
mkdir -p "$out/build"
cp -r src/bin "$out/bin"
cp -r build/bin "$out/build/bin"
cp -f '${sage-env}/sage-env' "$out/bin/sage-env"
substituteInPlace "$out/bin/sage-env" \
--subst-var-by sage-local "$out"
'';
}

View File

@ -0,0 +1,41 @@
{ stdenv
, makeWrapper
, sage
, sage-src
, sagedoc
, withDoc
}:
stdenv.mkDerivation rec {
version = sage.version;
name = "sage-wrapper-${version}";
buildInputs = [
makeWrapper
];
unpackPhase = "#do nothing";
configurePhase = "#do nothing";
buildPhase = "#do nothing";
installPhase = ''
mkdir -p "$out/bin"
makeWrapper "${sage}/bin/sage" "$out/bin/sage" \
--set SAGE_DOC_SRC_OVERRIDE "${sage-src}/src/doc" ${
stdenv.lib.optionalString withDoc "--set SAGE_DOC_OVERRIDE ${sagedoc}/share/doc/sage"
}
'';
doInstallCheck = withDoc;
installCheckPhase = ''
export HOME="$TMPDIR/sage-home"
mkdir -p "$HOME"
"$out/bin/sage" -c 'browse_sage_doc._open("reference", testing=True)'
'';
meta = with stdenv.lib; {
description = "Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab";
license = licenses.gpl2;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,32 @@
{ stdenv
, sage-with-env
, makeWrapper
}:
stdenv.mkDerivation rec {
version = sage-with-env.version;
name = "sage-${version}";
buildInputs = [
makeWrapper
];
unpackPhase = "#do nothing";
configurePhase = "#do nothing";
buildPhase = "#do nothing";
installPhase = ''
mkdir -p "$out/bin"
# Like a symlink, but make sure that $0 points to the original.
makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage"
'';
doInstallCheck = true;
installCheckPhase = ''
export HOME="$TMPDIR/sage-home"
mkdir -p "$HOME"
# "--long" tests are in the order of 1h, without "--long" its 1/2h
"$out/bin/sage" -t --nthreads "$NIX_BUILD_CORES" --optional=sage --long --all
'';
}

View File

@ -0,0 +1,97 @@
{ pkgs
, stdenv
, sage-src
, env-locations
, sage-with-env
, sagelib
, python2
, psutil
, future
, sphinx
, sagenb
, maxima-ecl
, networkx
, scipy
, sympy
, matplotlib
, pillow
, ipykernel
, jupyter_client
, tachyon
, jmol
, ipywidgets
, typing
, cddlib
, pybrial
}:
stdenv.mkDerivation rec {
version = sage-src.version;
name = "sagedoc-${version}";
# Building the documentation has many dependencies, because all documented
# modules are imported and because matplotlib is used to produce plots.
buildInputs = [
sagelib
python2
psutil
future
sphinx
sagenb
maxima-ecl
networkx
scipy
sympy
matplotlib
pillow
ipykernel
jupyter_client
tachyon
jmol
ipywidgets
typing
cddlib
pybrial
];
unpackPhase = ''
export SAGE_DOC_OVERRIDE="$PWD/share/doc/sage"
export SAGE_DOC_SRC_OVERRIDE="$PWD/docsrc"
cp -r "${sage-src}/src/doc" "$SAGE_DOC_SRC_OVERRIDE"
chmod -R 755 "$SAGE_DOC_SRC_OVERRIDE"
'';
buildPhase = ''
export SAGE_NUM_THREADS="$NIX_BUILD_CORES"
export HOME="$TMPDIR/sage_home"
mkdir -p "$HOME"
${sage-with-env}/bin/sage -python -m sage_setup.docbuild \
--mathjax \
--no-pdf-links \
all html
'';
installPhase = ''
cd "$SAGE_DOC_OVERRIDE"
mkdir -p "$out/share/doc/sage"
cp -r html "$out"/share/doc/sage
# Replace duplicated files by symlinks (Gentoo)
cd "$out"/share/doc/sage
mv html/en/_static{,.tmp}
for _dir in `find -name _static` ; do
rm -r $_dir
ln -s /share/doc/sage/html/en/_static $_dir
done
mv html/en/_static{.tmp,}
'';
doCheck = true;
checkPhase = ''
${sage-with-env}/bin/sage -t --optional=dochtml --all
'';
}

View File

@ -0,0 +1,139 @@
{ stdenv
, sage-src
, perl
, buildPythonPackage
, arb
, openblasCompat
, openblas-blas-pc
, openblas-cblas-pc
, openblas-lapack-pc
, brial
, cliquer
, cypari2
, cysignals
, cython
, ecl
, eclib
, ecm
, flint
, gd
, givaro
, glpk
, gsl
, iml
, jinja2
, lcalc
, lrcalc
, libgap
, linbox
, m4ri
, m4rie
, libmpc
, mpfi
, ntl
, numpy
, pari
, pkgconfig
, planarity
, ppl
, pynac
, python
, ratpoints
, readline
, rankwidth
, symmetrica
, zn_poly
, fflas-ffpack
, boost
, singular
, pip
, jupyter_core
}:
buildPythonPackage rec {
format = "other";
version = sage-src.version;
pname = "sagelib";
src = sage-src;
nativeBuildInputs = [
iml
perl
openblas-blas-pc
openblas-cblas-pc
openblas-lapack-pc
jupyter_core
];
buildInputs = [
gd
readline
];
propagatedBuildInputs = [
cypari2
jinja2
numpy
pkgconfig
boost
arb
brial
cliquer
ecl
eclib
ecm
fflas-ffpack
flint
givaro
glpk
gsl
lcalc
libgap
libmpc
linbox
lrcalc
m4ri
m4rie
mpfi
ntl
openblasCompat
pari
planarity
ppl
pynac
rankwidth
ratpoints
singular
symmetrica
zn_poly
pip
cython
cysignals
];
buildPhase = ''
export SAGE_ROOT="$PWD"
export SAGE_LOCAL="$SAGE_ROOT"
export SAGE_SHARE="$SAGE_LOCAL/share"
export JUPYTER_PATH="$SAGE_LOCAL/jupyter"
export PATH="$SAGE_ROOT/build/bin:$SAGE_ROOT/src/bin:$PATH"
export SAGE_NUM_THREADS="$NIX_BUILD_CORES"
mkdir -p "$SAGE_SHARE/sage/ext/notebook-ipython"
mkdir -p "var/lib/sage/installed"
cd src
source bin/sage-dist-helpers
${python.interpreter} -u setup.py --no-user-cfg build
'';
installPhase = ''
${python.interpreter} -u setup.py --no-user-cfg install --prefix=$out
rm -r "$out/${python.sitePackages}/sage/cython_debug"
'';
}

View File

@ -0,0 +1,49 @@
# Has a cyclic dependency with sage (not expressed here) and is not useful outside of sage
{ stdenv
, fetchpatch
, python
, buildPythonPackage
, fetchFromGitHub
, mathjax
, twisted
, flask
, flask-oldsessions
, flask-openid
, flask-autoindex
, flask-babel
}:
buildPythonPackage rec {
pname = "sagenb";
version = "2018-06-26"; # not 1.0.1 because of new flask syntax
src = fetchFromGitHub {
owner = "sagemath";
repo = "sagenb";
rev = "b360a0172e15501fb0163d02dce713a561fee2af";
sha256 = "12anydw0v9w23rbc0a94bqmjhjdir9h820c5zdhipw9ccdcc2jlf";
};
propagatedBuildInputs = [
twisted
flask
flask-oldsessions
flask-openid
flask-autoindex
flask-babel
];
# tests depend on sage
doCheck = false;
meta = with stdenv.lib; {
description = "Sage Notebook";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ timokau ];
};
# let sagenb use mathjax
postInstall = ''
ln -s ${mathjax}/lib/node_modules/mathjax "$out/${python.sitePackages}/mathjax"
'';
}

View File

@ -1,36 +0,0 @@
diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg
index 83e61a7e0d..942ba206c7 100755
--- a/build/bin/sage-spkg
+++ b/build/bin/sage-spkg
@@ -648,8 +648,12 @@ if ! sage-apply-patches; then
error_msg "Error applying patches"
exit 1
fi
+
+@bash@/bin/bash @patchSageShebangs@ .
+
cd ..
+
##################################################################
# The package has been extracted, prepare for installation
##################################################################
@@ -671,7 +675,7 @@ write_script_wrapper() {
local tmpscript="$(dirname "$script")/.tmp-${script##*/}"
cat > "$tmpscript" <<__EOF__
-#!/usr/bin/env bash
+#! @bash@/bin/bash
export SAGE_ROOT="$SAGE_ROOT"
export SAGE_SRC="$SAGE_SRC"
@@ -833,6 +837,9 @@ if [ "$UNAME" = "CYGWIN" ]; then
sage-rebase.sh "$SAGE_LOCAL" 2>/dev/null
fi
+@bash@/bin/bash @patchSageShebangs@ .
+@bash@/bin/bash @patchSageShebangs@ "$out/bin"
+
echo "Successfully installed $PKG_NAME"
if [ "$SAGE_CHECK" = "yes" ]; then

View File

@ -1,20 +0,0 @@
diff --git a/build/pkgs/giac/spkg-install b/build/pkgs/giac/spkg-install
index bdd8df6cb8..3fd7a3ef8a 100644
--- a/build/pkgs/giac/spkg-install
+++ b/build/pkgs/giac/spkg-install
@@ -2,6 +2,15 @@
## Giac
###########################################
+# Fix hardcoded paths, while making sure to only update timestamps of actually
+# changed files (otherwise confuses make)
+grep -rlF '/bin/cp' . | while read file
+do
+ sed -e 's@/bin/cp@cp@g' -i "$file"
+done
+
+# Fix input parser syntax
+sed -e 's@yylex (&yylval)@yylex (\&yyval, scanner)@gp' -i 'src/src/input_parser.cc'
if [ "$SAGE_LOCAL" = "" ]; then
echo "SAGE_LOCAL undefined ... exiting";

View File

@ -1,18 +0,0 @@
diff --git a/build/pkgs/git/spkg-install b/build/pkgs/git/spkg-install
index 87874de3d8..b0906245fa 100644
--- a/build/pkgs/git/spkg-install
+++ b/build/pkgs/git/spkg-install
@@ -33,6 +33,13 @@ fi
cd src
+# Fix hardcoded paths, while making sure to only update timestamps of actually
+# changed files (otherwise confuses make)
+grep -rlF '/usr/bin/perl' . | while read file
+do
+ sed -e 's@/usr/bin/perl@perl@g' -i "$file"
+done
+
# We don't want to think about Fink or Macports
export NO_FINK=1
export NO_DARWIN_PORTS=1

View File

@ -1,13 +0,0 @@
diff --git a/build/pkgs/python3/spkg-build b/build/pkgs/python3/spkg-build
index 56db087ae5..b450703c5f 100644
--- a/build/pkgs/python3/spkg-build
+++ b/build/pkgs/python3/spkg-build
@@ -27,6 +27,8 @@ fi
export EXTRA_CFLAGS="`testcflags.sh -Wno-unused` $CFLAGS"
unset CFLAGS
+export LDFLAGS="$LDFLAGS -lcrypt"
+
if [ "$UNAME" = Darwin ]; then
PYTHON_CONFIGURE="--disable-toolbox-glue $PYTHON_CONFIGURE"

View File

@ -1,18 +0,0 @@
diff --git a/build/pkgs/singular/spkg-install b/build/pkgs/singular/spkg-install
index 8caafb1699..3c34e6608a 100644
--- a/build/pkgs/singular/spkg-install
+++ b/build/pkgs/singular/spkg-install
@@ -2,6 +2,13 @@
## Singular
###########################################
+# Fix hardcoded paths, while making sure to only update timestamps of actually
+# changed files (otherwise confuses make)
+grep -rlF '/bin/rm' . | while read file
+do
+ sed -e 's@/bin/rm@rm@g' -i "$file"
+done
+
if [ -z "$SAGE_LOCAL" ]; then
echo >&2 "Error: SAGE_LOCAL undefined -- exiting..."
echo >&2 "Maybe run 'sage -sh'?"

View File

@ -1,14 +1,15 @@
{stdenv, fetchurl}:
{ stdenv
, fetchurl
, fetchpatch
}:
stdenv.mkDerivation rec {
name = "symmetrica-${version}";
version = "2.0";
# or fetchFromGitHub(owner,repo,rev) or fetchgit(rev)
src = fetchurl {
url = "http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/SYM2_0_tar.gz";
sha256 = "1qhfrbd5ybb0sinl9pad64rscr08qvlfzrzmi4p4hk61xn6phlmz";
name = "symmetrica-2.0.tar.gz";
};
buildInputs = [];
sourceRoot = ".";
installPhase = ''
mkdir -p "$out"/{lib,share/doc/symmetrica,include/symmetrica}
@ -18,6 +19,22 @@ stdenv.mkDerivation rec {
cp *.h "$out/include/symmetrica"
cp README *.doc "$out/share/doc/symmetrica"
'';
patches = [
# don't show banner ("SYMMETRICA VERSION X - STARTING)
# it doesn't contain very much helpful information and a banner is not ideal for a library
(fetchpatch {
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/de.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "0df0vqixcfpzny6dkhyj87h8aznz3xn3zfwwlj8pd10bpb90k6gb";
})
# use int32_t and uint32_t for type INT
# see https://trac.sagemath.org/ticket/13413
(fetchpatch {
name = "fix_64bit_integer_overflow.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/int32.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "0p33c85ck4kd453z687ni4bdcqr1pqx2756j7aq11bf63vjz4cyz";
})
];
meta = {
inherit version;
description = ''A collection of routines for representation theory and combinatorics'';

View File

@ -1,22 +1,16 @@
{ stdenv, pythonPackages, fetchFromGitHub, rtmpdump, ffmpeg }:
pythonPackages.buildPythonApplication rec {
version = "0.13.0";
version = "0.14.2";
name = "streamlink-${version}";
src = fetchFromGitHub {
owner = "streamlink";
repo = "streamlink";
rev = "${version}";
sha256 = "17i5j5a69d28abg13md2r2ycxgmd5h1pjy0pgca1zcqaqfq4v05x";
sha256 = "1njwfy1h8a9n5z6crrfnknlw4ys0bap2jam6ga6njgkd10aly9qr";
};
postPatch = ''
# Fix failing test. This can be removed after version 0.13.0, see:
# https://github.com/streamlink/streamlink/commit/a27e1a2d8eec6eb23c6e1dc280c6afc1cd0b5b32
substituteInPlace tests/test_plugin.py --replace "lambda: datetime" "datetime"
'';
checkInputs = with pythonPackages; [ pytest mock requests-mock freezegun ];
propagatedBuildInputs = (with pythonPackages; [ pycryptodome requests iso-639 iso3166 websocket_client isodate ]) ++ [ rtmpdump ffmpeg ];

View File

@ -319,51 +319,48 @@ rec {
];
# Sage mirrors (http://www.sagemath.org/mirrors.html)
sagemath = [
sageupstream = [
# Africa
http://sagemath.polytechnic.edu.na/src/
ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/src/
http://sagemath.mirror.ac.za/src/
https://ftp.leg.uct.ac.za/pub/packages/sage/src/
http://mirror.ufs.ac.za/sagemath/src/
http://sagemath.polytechnic.edu.na/spkg/upstream/
ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/spkg/upstream/
http://sagemath.mirror.ac.za/spkg/upstream/
https://ftp.leg.uct.ac.za/pub/packages/sage/spkg/upstream/
http://mirror.ufs.ac.za/sagemath/spkg/upstream/
# America, North
http://mirrors-usa.go-parts.com/sage/sagemath/src/
http://mirrors.mit.edu/sage/src/
http://www.cecm.sfu.ca/sage/src/
http://files.sagemath.org/src/
http://mirror.clibre.uqam.ca/sage/src/
https://mirrors.xmission.com/sage/src/
http://mirrors-usa.go-parts.com/sage/sagemath/spkg/upstream/
http://mirrors.mit.edu/sage/spkg/upstream/
http://www.cecm.sfu.ca/sage/spkg/upstream/
http://files.sagemath.org/spkg/upstream/
http://mirror.clibre.uqam.ca/sage/spkg/upstream/
https://mirrors.xmission.com/sage/spkg/upstream/
# America, South
http://sagemath.c3sl.ufpr.br/src/
http://linorg.usp.br/sage/
http://sagemath.c3sl.ufpr.br/spkg/upstream/
http://linorg.usp.br/sage/spkg/upstream
# Asia
http://sage.asis.io/src/
http://mirror.hust.edu.cn/sagemath/src/
https://ftp.iitm.ac.in/sage/src/
http://ftp.kaist.ac.kr/sage/src/
http://ftp.riken.jp/sagemath/src/
https://mirrors.tuna.tsinghua.edu.cn/sagemath/src/
https://mirrors.ustc.edu.cn/sagemath/src/
http://ftp.tsukuba.wide.ad.jp/software/sage/src/
http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/src/
https://mirror.yandex.ru/mirrors/sage.math.washington.edu/src/
http://sage.asis.io/spkg/upstream/
http://mirror.hust.edu.cn/sagemath/spkg/upstream/
https://ftp.iitm.ac.in/sage/spkg/upstream/
http://ftp.kaist.ac.kr/sage/spkg/upstream/
http://ftp.riken.jp/sagemath/spkg/upstream/
https://mirrors.tuna.tsinghua.edu.cn/sagemath/spkg/upstream/
https://mirrors.ustc.edu.cn/sagemath/spkg/upstream/
http://ftp.tsukuba.wide.ad.jp/software/sage/spkg/upstream/
http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/spkg/upstream/
https://mirror.yandex.ru/mirrors/sage.math.washington.edu/spkg/upstream/
# Australia
http://echidna.maths.usyd.edu.au/sage/src/
http://echidna.maths.usyd.edu.au/sage/spkg/upstream/
# Europe
http://sage.mirror.garr.it/mirrors/sage/src/
http://sunsite.rediris.es/mirror/sagemath/src/
http://mirror.switch.ch/mirror/sagemath/src/
http://mirrors.fe.up.pt/pub/sage/src/
http://www-ftp.lip6.fr/pub/math/sagemath/src/
http://ftp.ntua.gr/pub/sagemath/src/
# Old versions
http://sagemath.org/src-old/
http://sage.mirror.garr.it/mirrors/sage/spkg/upstream/
http://sunsite.rediris.es/mirror/sagemath/spkg/upstream/
http://mirror.switch.ch/mirror/sagemath/spkg/upstream/
http://mirrors.fe.up.pt/pub/sage/spkg/upstream/
http://www-ftp.lip6.fr/pub/math/sagemath/spkg/upstream/
http://ftp.ntua.gr/pub/sagemath/spkg/upstream/
];
# MySQL mirrors

View File

@ -0,0 +1,31 @@
{ stdenv
, fetchurl
}:
stdenv.mkDerivation rec {
name = "combinatorial_designs-${version}";
version = "20140630";
src = fetchurl {
url = "mirror://sageupstream/combinatorial_designs/combinatorial_designs-${version}.tar.bz2";
sha256 = "0bj8ngiq59hipa6izi6g5ph5akmy4cbk0vlsb0wa67f7grnnqj69";
};
installPhase = ''
mkdir -p "$out/share/combinatorial_designs"
mv * "$out/share/combinatorial_designs"
'';
meta = with stdenv.lib; {
description = "Data for Combinatorial Designs";
longDescription = ''
Current content:
- The table of MOLS (10 000 integers) from the Handbook of Combinatorial
Designs, 2ed.
'';
license = licenses.publicDomain;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,43 @@
{ stdenv
, fetchurl
, python
}:
stdenv.mkDerivation rec {
name = "conway_polynomials-${version}";
version = "0.5";
pythonEnv = python.withPackages (ps: with ps; [ six ]);
src = fetchurl {
url = "mirror://sageupstream/conway_polynomials/conway_polynomials-${version}.tar.bz2";
sha256 = "05zb1ly9x2bbscqv0jgc45g48xx77mfs7qdbqhn4ihmihn57iwnq";
};
# Script that creates the "database" (nested python array) and pickles it
spkg-install = fetchurl {
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/conway_polynomials/spkg-install.py?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "0m12nfb37j3bn4bp06ddgnyp2d6z0hg5f83pbbjszxw7vxs33a82";
};
installPhase = ''
# directory layout as spkg-install.py expects
dir="$PWD"
cd ..
ln -s "$dir" "src"
# environment spkg-install.py expects
mkdir -p "$out/share"
export SAGE_SHARE="$out/share"
export PYTHONPATH=$PWD
${pythonEnv.interpreter} ${spkg-install}
'';
meta = with stdenv.lib; {
description = "Contains a small database of Conway polynomials.";
license = licenses.gpl2;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,51 @@
{ stdenv
, fetchurl
, python
}:
stdenv.mkDerivation rec {
pname = "elliptic_curves";
version = "0.8";
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://sageupstream/${pname}/${pname}-${version}.tar.bz2";
sha256 = "0pzaym44x88dn8rydiwqgm73yghzlgf7gqvd7qqsrsdl2vyp091w";
};
# Script that creates the sqlite database from the allcurves textfile
spkg-install = fetchurl {
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/${pname}/spkg-install.py?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "116g684i6mvs11fvb6fzfsr4fn903axn31vigdyb8bgpf8l4hvc5";
};
installPhase = ''
# directory layout as spkg-install.py expects
dir="$PWD"
cd ..
ln -s "$dir" "src"
# environment spkg-install.py expects
mkdir -p "$out/share"
export SAGE_SHARE="$out/share"
export PYTHONPATH=$PWD
${python.interpreter} ${spkg-install}
'';
meta = with stdenv.lib; {
description = "Databases of elliptic curves";
longDescription = ''
Includes two databases:
* A small subset of the data in John Cremona's database of elliptic curves up
to conductor 10000. See http://www.warwick.ac.uk/~masgaj/ftp/data/ or
http://sage.math.washington.edu/cremona/INDEX.html
* William Stein's database of interesting curves
'';
license = licenses.gpl2;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,26 @@
{ stdenv
, fetchurl
}:
stdenv.mkDerivation rec {
pname = "graphs";
version = "20161026";
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://sageupstream/${pname}/${pname}-${version}.tar.bz2";
sha256 = "0a2b5lly9nifphvknz88rrhfbbc8vqnlqcv19zdpfq8h8nnyjbb2";
};
installPhase = ''
mkdir -p "$out/share/graphs"
cp * "$out/share/graphs/"
'';
meta = with stdenv.lib; {
description = "A database of graphs";
license = licenses.gpl2;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,26 @@
{ stdenv
, fetchurl
}:
stdenv.mkDerivation rec {
version = "20080411";
name = "pari-galdata-${version}";
src = fetchurl {
url = "http://pari.math.u-bordeaux.fr/pub/pari/packages/galdata.tgz";
sha256 = "1pch6bk76f1i6cwwgm7hhxi5h71m52lqayp4mnyj0jmjk406bhdp";
};
installPhase = ''
mkdir -p "$out/share/pari"
cp -R * "$out/share/pari/"
'';
meta = with stdenv.lib; {
description = "PARI database needed to compute Galois group in degrees 8 through 11";
homepage = http://pari.math.u-bordeaux.fr/;
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,26 @@
{ stdenv
, fetchurl
}:
stdenv.mkDerivation rec {
version = "20090618";
name = "pari-seadata-small-${version}";
src = fetchurl {
url = "http://pari.math.u-bordeaux.fr/pub/pari/packages/seadata-small.tgz";
sha256 = "13qafribxwkz8h3haa0cng7arz0kh7398br4y7vqs9ib8w9yjnxz";
};
installPhase = ''
mkdir -p "$out/share/pari"
cp -R * "$out/share/pari/"
'';
meta = with stdenv.lib; {
description = "PARI database needed by ellap for large primes";
homepage = http://pari.math.u-bordeaux.fr/;
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -0,0 +1,26 @@
{ stdenv
, fetchurl
}:
stdenv.mkDerivation rec {
pname = "polytopes_db";
version = "20170220";
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://sageupstream/${pname}/${pname}-${version}.tar.bz2";
sha256 = "1q0cd811ilhax4dsj9y5p7z8prlalqr7k9mzq178c03frbgqny6b";
};
installPhase = ''
mkdir -p "$out/share/reflexive_polytopes"
cp -R * "$out/share/reflexive_polytopes/"
'';
meta = with stdenv.lib; {
description = "Reflexive polytopes database";
license = licenses.gpl2;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}

View File

@ -7,16 +7,13 @@
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "tracker-miners";
version = "2.0.4";
version = "2.0.5";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
sha256 = "0mp9m2waii583sjgr61m1ni6py6dry11r0rzidgvw1g4cxhn89j6";
sha256 = "00k8nb8dbkjnqjk12gcs5n2cm6yny553qildsm5b2c8nfs1w16b4";
};
# https://github.com/NixOS/nixpkgs/issues/39547
LIBRARY_PATH = stdenv.lib.makeLibraryPath [ giflib ];
nativeBuildInputs = [
intltool
itstool
@ -71,31 +68,11 @@ stdenv.mkDerivation rec {
src = ./fix-paths.patch;
inherit (gnome3) tracker;
})
# https://bugzilla.gnome.org/show_bug.cgi?id=795573
(fetchurl {
url = https://bugzilla.gnome.org/attachment.cgi?id=371422;
sha256 = "1rzwzrc7q73k42s1j1iw52chy10w6y3xksfrzg2l42nn9wk7n281";
})
# https://bugzilla.gnome.org/show_bug.cgi?id=795574
(fetchurl {
url = https://bugzilla.gnome.org/attachment.cgi?id=371423;
sha256 = "0b2ck8z4b2yrgwg4v9jsac5n8h3a91qkp90vv17wxcvr4v50fg48";
})
# https://bugzilla.gnome.org/show_bug.cgi?id=795575
(fetchurl {
url = https://bugzilla.gnome.org/attachment.cgi?id=371424;
sha256 = "03i29fabxrpraydh7712vdrc571qmiq0l4axj24gbi6h77xn7mxc";
})
# https://bugzilla.gnome.org/show_bug.cgi?id=795576
(fetchurl {
url = https://bugzilla.gnome.org/attachment.cgi?id=371427;
sha256 = "187flswvzymjfxwfrrhizb1cvs780zm39aa3i2vwa5fbllr7kcpf";
})
# https://bugzilla.gnome.org/show_bug.cgi?id=795577
(fetchurl {
url = https://bugzilla.gnome.org/attachment.cgi?id=371425;
sha256 = "05m629469jr2lm2cjs54n7xwyim2d5rwwvdjxzcwh5qpfjds5phm";
})
];
passthru = {
@ -114,7 +91,7 @@ stdenv.mkDerivation rec {
postInstall = ''
${glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
'';
# https://bugzilla.gnome.org/show_bug.cgi?id=796145
postFixup = ''
rm $out/share/tracker/miners/org.freedesktop.Tracker1.Miner.RSS.service

View File

@ -4,7 +4,7 @@
let
pname = "tracker";
version = "2.0.3";
version = "2.0.4";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
@ -12,7 +12,7 @@ in stdenv.mkDerivation rec {
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
sha256 = "1005w90vhk1cl8g6kxpy2vdzbskw2jskfjcl42lngv18q5sb4bss";
sha256 = "1mfc5lv820kr7ssi7hldn25gmshh65k19kh478qjsnb64sshsbyf";
};
enableParallelBuilding = true;

View File

@ -3,13 +3,13 @@
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "compton-conf";
version = "0.3.0";
version = "0.4.0";
src = fetchFromGitHub {
owner = "lxde";
repo = pname;
rev = version;
sha256 = "1p1y7g5psczx1dgh6gd1h5iga8rylvczkwlfirzrh0rfl45dajgb";
sha256 = "1r187fx1vivzq1gcwwawax36mnlmfig5j1ba4s4wfdi3q2wcq7mw";
};
nativeBuildInputs = [

Some files were not shown because too many files have changed in this diff Show More