sage: cleanup

This commit is contained in:
Gaetan Lepage
2026-08-17 07:59:24 +00:00
parent ab7046381b
commit 62dfa51ec5
2 changed files with 15 additions and 7 deletions

View File

@@ -1,6 +1,5 @@
{
pkgs,
stdenv,
withDoc ? false,
requireSageTests ? true,
extraPythonPackages ? ps: [ ],

View File

@@ -1,6 +1,7 @@
{
stdenv,
lib,
stdenv,
bashNonInteractive,
fetchFromGitHub,
fetchpatch2,
fetchurl,
@@ -11,17 +12,25 @@
# This is done because multiple derivations rely on these sources and they should
# all get the same sources with the same patches applied.
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
version = "10.9";
pname = "sage-src";
__structuredAttrs = true;
strictDeps = true;
src = fetchFromGitHub {
owner = "sagemath";
repo = "sage";
rev = version;
tag = finalAttrs.version;
hash = "sha256-8IBCQYdmL7ane7/WOoogArbwgqPDtL8ecz9GIzuEfOU=";
};
# The shipped scripts (e.g. build/bin/sage-site) use `#!/usr/bin/env bash`.
# With `strictDeps`, patchShebangs only searches HOST_PATH, so bash has to be
# a buildInput for those to get patched.
buildInputs = [ bashNonInteractive ];
# contains essential files (e.g., setup.cfg) generated by the bootstrap script.
# TODO: investigate https://github.com/sagemath/sage/pull/35950
configure-src = fetchurl {
@@ -160,7 +169,7 @@ stdenv.mkDerivation rec {
./patches/scipy-1_18-workaround.patch
];
patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
patches = finalAttrs.nixPatches ++ finalAttrs.bugfixPatches ++ finalAttrs.packageUpgradePatches;
# do not create .orig backup files if patch applies with fuzz
patchFlags = [
@@ -195,11 +204,11 @@ stdenv.mkDerivation rec {
'';
buildPhase = ''
tar xzf ${configure-src}
tar xzf ${finalAttrs.configure-src}
rm configure
'';
installPhase = ''
cp -r . "$out"
'';
}
})