Unverified Commit ae0854e9 authored by Alex Epelde's avatar Alex Epelde
Browse files
parent f242b99c
Loading
Loading
Loading
Loading
+38 −6
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchpatch,
  fetchFromGitHub,
  python,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,

  # build-time dependencies
  setuptools,
  cypari,
  cython,

  # non-Python runtime dependencies
  libGL,

  # Python runtime dependencies
  cypari,
  fxrays,
  ipython,
  libGL,
  low-index,
  packaging,
  pickleshare,
@@ -20,9 +26,16 @@
  snappy-15-knots,
  snappy-manifolds,
  spherogram,
  tkinter-gl,

  # documentation
  sphinxHook,
  sphinx-rtd-theme,
  tkinter-gl,

  # tests
  runCommand,
  sage,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
@@ -58,7 +71,7 @@ buildPythonPackage rec {
  postPatch =
    lib.optionalString stdenv.hostPlatform.isLinux ''
      substituteInPlace setup.py \
        --replace-fail "/usr/include/GL" "${libGL.dev}/include/GL"
        --replace-fail "/usr/include/GL" "${lib.getDev libGL}/include/GL"
      substituteInPlace freedesktop/share/applications/snappy.desktop \
        --replace-fail "Exec=/usr/bin/env python3 -m snappy.app" "Exec=SnapPy"
    ''
@@ -117,6 +130,25 @@ buildPythonPackage rec {
    runHook postCheck
  '';

  passthru.tests.sage =
    let
      sage' = sage.override {
        extraPythonPackages = ps: [ ps.snappy ];
        requireSageTests = false;
      };
    in
    runCommand "snappy-sage-tests"
      {
        nativeBuildInputs = [
          sage'
          writableTmpDirAsHomeHook
        ];
      }
      ''
        sage -python -m snappy.test --skip-gui
        touch $out
      '';

  meta = {
    description = "Studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures";
    changelog = "https://snappy.computop.org/news.html";