Some people within DebianScience would like to package again Sage for Debian. An old version of Sage got packaged long time ago by Tim Abbott, but, because of lack of maintainance, it became totally unusable and was removed from Debian. The status pages (master, develop) give an overview about package versions in Sage and Debian. If you want to help out, pick one of the open tasks or issues below and get going. Or contact us via the mailing list or in #debian-science on irc.oftc.net.

Building Sage with Debian packages

We have a git repository (sagemath) to document the steps we currently do to experiment with building Sage against Debian packages. Important elements are the build dependencies of Sage, patches for Sage and a script called "pruner" that uses automake to determine if the necessary packages are installed (see also this mail).

Start with Debian unstable (sid) with experimental sources enabled. It is nice to do this in a chroot with schroot. (If your build fails with "Permission denied", try adding the following line to /etc/schroot/default/fstab: tmpfs  /dev/shm  tmpfs  rw,nosuid,nodev  0  0 - more details here)

To set up your system for working with our repo:

sudo apt-get install --no-install-recommends git equivs devscripts

Install packages that are required before installing the build dependencies.

git clone --recursive https://anonscm.debian.org/git/debian-science/packages/sagemath.git && cd sagemath

Recursive git clone to also get sage which is included as a git submodule.

debian/rules install-apt-sources

Add our unstable-sage repo for patched dependencies. This is optional; if you prefer you can build these yourself from the instructions in the table below.

To build the package, run:

debian/rules build-dep

Install build dependencies; you may need to run apt-get -f install afterwards. If this fails, install aptitude then try it again.

debian/rules reset

Apply patches and force-reset the upstream sage submodule.

debian/rules prune

Run the pruner script. Check that the output matches the one below.

debian/rules build

Build sage and run the test suite.

The output of the pruner tells you in the end which dependencies were not found on the machine. These will be downloaded and built in the build step, before Sage itself is built. Currently (December 2016) the pruner should output something like the following.

160 system packages will be used

See debian/README.source for any workarounds you might have to apply, such as patching local system files.

Open tasks

Packages in our development APT repository:

Up-to-date information about the packages in the repo can be found on the status pages. (master branch, develop branch)

Package

Bug / Link

Reason for being in the repository

Patched packages:

numpy

842348

Debian maintainer needs to apply this proposed upstream patch - basically accepted but needs unit tests

sympy

840621

We applied this patch to fix a doctest.

Other packages:

Package

Bug / Link

Comments

Testing autoremovals threatening sagemath:

execnet

3 RC bugs

dependency of sympy, testing autoremoval on January 17

RC bugs that need to be fixed before the freeze (possibly prevent testing migration of sagemath):

pyzmq

818265

Things that can wait until after stretch:

cvxopt

An update is ready in git, ?SageMath seems to work with the old version.

thebe

https://github.com/oreillymedia/thebe, lots of javascript dependencies

jmol

Build JSmol into a binary package and use it for 3D plots in notebooks.

Uploading patched packages

We've set up a mini-dinstall APT repo to upload our patched Debian packages to, so that we can build sage against these. This is a temporary measure to make everything work more quickly, and these patched packages are unlikely to be added to Debian officially.

To upload, you must be a member of the debian-science group on alioth. Then, you should add this to your ~/.dput.cf:

[deb-sci-sage]
method = scp
fqdn = alioth.debian.org
incoming = /home/groups/debian-science/htdocs/apt/mini-dinstall/incoming/
post_upload_command = ssh alioth.debian.org /home/groups/debian-science/mini-dinstall

mini-dinstall is pretty forgiving and you can upload either higher or lower versions of what's in there currently. However, you must set the distribution in debian/changelog to sid-sage or unstable-sage, otherwise your package will get rejected. Alternatively, do the build without changing debian/changelog, then afterwards edit the .changes file to say Distribution: sid-sage, then debsign it and upload.

Please include the .orig tarball in your upload, which helps our status pages report more accurately. To do this, you can give --changes-option=-sa to dpkg-buildpackage, or if you forget to do this then you can run changestool $XXX.changes includeallsources after the build, then debsign it and upload.

If you want to upload a different version of a package with the *same version number* as what's already in there, firstly please try to avoid this since it might confuse people. If you do it by accident, mini-dinstall won't reject your upload and you will mess up the database. In this case, run /home/groups/debian-science/mini-dinstall -b --no-db on alioth.debian.org to fix things.

To remove a package

To sbuild using our repo

You can sbuild to make sure you didn't miss any build-dependencies (and for its other benefits).

First, set up an sbuild schroot by following the instructions on that page. Then, for each build you want to do, run:

$ sbuild \
    --chroot-setup-commands='apt-get install -y apt-transport-https' \
    --extra-repository='deb https://debian-science.alioth.debian.org/apt sid-sage/' \
    --extra-repository-key=debian/deb-sci-sage.asc \
    --build-dep-resolver=aspcud \
    -s .

Replace -s . with $pkg.dsc if you already built the latter.

If you also need packages from Debian experimental, add --extra-repository='deb http://httpredir.debian.org/debian experimental main' to the above command line.

Links