Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 060a98e9f4ad
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 055a29c4a1b8
Choose a head ref

Commits on Jun 29, 2018

  1. Copy the full SHA
    892a0e8 View commit details
  2. Copy the full SHA
    082169a View commit details
  3. Copy the full SHA
    68394a7 View commit details
  4. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    83a839c View commit details
  5. graphs: init at 20161026

    timokau committed Jun 29, 2018
    Copy the full SHA
    2f76f66 View commit details
  6. Copy the full SHA
    7c92c26 View commit details
  7. Copy the full SHA
    60fe33b View commit details
  8. Copy the full SHA
    6fc8b0d View commit details
  9. Copy the full SHA
    c7d4528 View commit details
  10. elliptic_curves: init at 0.8

    timokau committed Jun 29, 2018
    Copy the full SHA
    b6f07b1 View commit details
  11. Copy the full SHA
    b7a6689 View commit details
  12. tachyon: add armv7l support

    timokau committed Jun 29, 2018
    Copy the full SHA
    4655b87 View commit details
  13. cysignals: add pari support

    timokau committed Jun 29, 2018
    Copy the full SHA
    f49f133 View commit details
  14. Copy the full SHA
    fca3ea0 View commit details
  15. Copy the full SHA
    5d78baa View commit details
  16. symmetrica: add patches

    timokau committed Jun 29, 2018
    Copy the full SHA
    424835a View commit details
  17. Copy the full SHA
    a0eace3 View commit details
  18. linbox: remove liblapack dependency

    Not actually needed by any package and adds and indirect dependency to
    atlas.
    timokau committed Jun 29, 2018
    Copy the full SHA
    224f73b View commit details
  19. pythonPackages.flask-autoindex: 0.6 -> 2018-06-28

    Fixes the build with current flask, which deprecated the old import
    syntax.
    timokau committed Jun 29, 2018
    Copy the full SHA
    7df80c4 View commit details
  20. pythonPackages.flask-silk: 0.2 -> 2018-06-28

    Fixes the build with current flask, which deprecated the old import
    syntax.
    timokau committed Jun 29, 2018
    Copy the full SHA
    84d89a1 View commit details
  21. Copy the full SHA
    17e6b39 View commit details

Commits on Jun 30, 2018

  1. sage, arb: update sage dependencies arb and pynac

    Removes the version pinning for arb and pynac by backporting the
    upstream (sage) package upgrades. This necessitates a new patch for arb,
    which was however already proposed and accepted upstream.
    timokau committed Jun 30, 2018
    Copy the full SHA
    398dad2 View commit details
  2. sage: replace JUPYTER_PATH patch by upstream patch

    The patch was replaced by a better upstream patch that doesn't mvoe the
    jupyter dir to the user's home.
    timokau committed Jun 30, 2018
    Copy the full SHA
    70ba695 View commit details

Commits on Jul 1, 2018

  1. Merge pull request #39981 from timokau/sage-on-nixos

    Sage on nixos
    7c6f434c authored Jul 1, 2018
    Copy the full SHA
    055a29c View commit details
Showing with 4,011 additions and 485 deletions.
  1. +117 −0 pkgs/applications/science/math/sage/README.md
  2. +202 −221 pkgs/applications/science/math/sage/default.nix
  3. +46 −0 pkgs/applications/science/math/sage/env-locations.nix
  4. +0 −22 pkgs/applications/science/math/sage/env.patch
  5. +0 −11 pkgs/applications/science/math/sage/fetch-mirrors.sh
  6. +36 −0 pkgs/applications/science/math/sage/flask-oldsessions.nix
  7. +28 −0 pkgs/applications/science/math/sage/flask-openid.nix
  8. +18 −0 pkgs/applications/science/math/sage/openblas-pc.nix
  9. +0 −51 pkgs/applications/science/math/sage/patchSageShebangs.sh
  10. +427 −0 pkgs/applications/science/math/sage/patches/arb-2.13.0.patch
  11. +127 −0 pkgs/applications/science/math/sage/patches/dochtml-optional.patch
  12. +98 −0 pkgs/applications/science/math/sage/patches/eclib-regulator-precision.patch
  13. +12 −0 pkgs/applications/science/math/sage/patches/matplotlib-normed-deprecated.patch
  14. +48 −0 pkgs/applications/science/math/sage/patches/maxima-5.41.0-doctests.patch
  15. +812 −0 pkgs/applications/science/math/sage/patches/numpy-1.14.3.patch
  16. +20 −0 pkgs/applications/science/math/sage/patches/pari-stackwarn.patch
  17. +479 −0 pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch
  18. +28 −0 pkgs/applications/science/math/sage/patches/python-5755-hotpatch.patch
  19. +40 −0 pkgs/applications/science/math/sage/patches/python3-syntax-without-write.patch
  20. +14 −0 pkgs/applications/science/math/sage/patches/revert-269c1e1551285.patch
  21. +31 −0 pkgs/applications/science/math/sage/patches/sagenb-sphinx-1.7.patch
  22. +62 −0 pkgs/applications/science/math/sage/patches/sphinx-1.7.patch
  23. +31 −0 pkgs/applications/science/math/sage/patches/test-in-tmpdir.patch
  24. +13 −0 pkgs/applications/science/math/sage/patches/zn_poly_version.patch
  25. +29 −0 pkgs/applications/science/math/sage/pybrial.nix
  26. +42 −0 pkgs/applications/science/math/sage/python-openid.nix
  27. +162 −0 pkgs/applications/science/math/sage/sage-env.nix
  28. +205 −0 pkgs/applications/science/math/sage/sage-src.nix
  29. +129 −0 pkgs/applications/science/math/sage/sage-with-env.nix
  30. +41 −0 pkgs/applications/science/math/sage/sage-wrapper.nix
  31. +32 −0 pkgs/applications/science/math/sage/sage.nix
  32. +97 −0 pkgs/applications/science/math/sage/sagedoc.nix
  33. +139 −0 pkgs/applications/science/math/sage/sagelib.nix
  34. +49 −0 pkgs/applications/science/math/sage/sagenb.nix
  35. +0 −36 pkgs/applications/science/math/sage/shebangs.patch
  36. +0 −20 pkgs/applications/science/math/sage/spkg-giac.patch
  37. +0 −18 pkgs/applications/science/math/sage/spkg-git.patch
  38. +0 −13 pkgs/applications/science/math/sage/spkg-python.patch
  39. +0 −18 pkgs/applications/science/math/sage/spkg-singular.patch
  40. +20 −3 pkgs/applications/science/math/symmetrica/default.nix
  41. +31 −34 pkgs/build-support/fetchurl/mirrors.nix
  42. +31 −0 pkgs/data/misc/combinatorial_designs/default.nix
  43. +43 −0 pkgs/data/misc/conway_polynomials/default.nix
  44. +51 −0 pkgs/data/misc/elliptic_curves/default.nix
  45. +26 −0 pkgs/data/misc/graphs/default.nix
  46. +26 −0 pkgs/data/misc/pari-galdata/default.nix
  47. +26 −0 pkgs/data/misc/pari-seadata-small/default.nix
  48. +26 −0 pkgs/data/misc/polytopes_db/default.nix
  49. +8 −0 pkgs/development/compilers/ecl/16.1.2.nix
  50. +9 −1 pkgs/development/libraries/arb/default.nix
  51. +10 −3 pkgs/development/libraries/libgap/default.nix
  52. +0 −3 pkgs/development/libraries/linbox/default.nix
  53. +1 −1 pkgs/development/libraries/science/math/lcalc/default.nix
  54. +2 −3 pkgs/development/libraries/science/math/openblas/default.nix
  55. +1 −1 pkgs/development/libraries/science/math/rankwidth/default.nix
  56. +1 −1 pkgs/development/libraries/science/math/rubiks/default.nix
  57. +2 −2 pkgs/development/libraries/science/math/sympow/default.nix
  58. +1 −0 pkgs/development/libraries/tachyon/default.nix
  59. +9 −1 pkgs/development/python-modules/cysignals/default.nix
  60. +10 −15 pkgs/development/python-modules/flask-autoindex/default.nix
  61. +9 −5 pkgs/development/python-modules/flask-silk/default.nix
  62. +18 −1 pkgs/development/python-modules/sympy/default.nix
  63. +36 −1 pkgs/top-level/all-packages.nix
117 changes: 117 additions & 0 deletions pkgs/applications/science/math/sage/README.md
Original file line number Diff line number Diff line change
@@ -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!
Loading