practically a copy of the one for patch
Depends on #27662
CC: @embray @kiwifb @slel @vinklein
Component: packages: optional
Author: Dima Pasechnik
Branch/Commit: 741de68
Reviewer: Erik Bray, Samuel Lelièvre, Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/27487