Skip to content

Commit

Permalink
remove dependency on sage-apply-patches (fixes #2)
Browse files Browse the repository at this point in the history
Packaged versions of Sage may not include it.
  • Loading branch information
mwageringel committed Mar 27, 2021
1 parent 5132dd0 commit 809ffda
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 6 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ Installation
============

**Requirements**: Linux with a recent version of `Sage <SAGE_>`_
(including Cython, pkgconfig,…)
(tested with CentOS 7.5.1804, Sage 8.1, 8.4, 8.8, and on Travis-CI with
Ubuntu 18.04).
Ubuntu 18.04, as well as with Sage 9.2 from Arch).

First, clone the `repository from GitHub <fgb_sage_gh_>`_ and then compile and
run the tests::
Expand All @@ -61,9 +62,10 @@ Issues
the entirety of Sage with GCC support might make this work, but this was not
tested. See `issue #3 <https://github.com/mwageringel/fgb_sage/issues/3>`_.

* Packaged versions of Sage: Installing this package can fail if Sage was
installed via a package manager of a Linux distribution; see `issue #2
<https://github.com/mwageringel/fgb_sage/issues/3>`_. As a workaround,
* Packaged versions of Sage: Installing this package should work if Sage was
installed by a package manager of a Linux distribution.
If anything fails, please report this; see `issue #2
<https://github.com/mwageringel/fgb_sage/issues/2>`_. As a workaround,
download a `Sage binary <https://www.sagemath.org/download.html>`_,
use `Sage via Docker <https://hub.docker.com/r/sagemath/sagemath>`_ or
install Sage from source.
Expand Down
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ def run(self):

log.info("Applying patches.")
os.chdir(libfgb_builddir)
if os.system("sage-apply-patches %s" % os.path.join(cwd, libfgb_pkgdir, "patches")):
log.error("Failed to apply patches.")
sys.exit(1)
patches_dir = os.path.join(cwd, libfgb_pkgdir, "patches")
patchfiles = [os.path.join(patches_dir, s)
for s in sorted(os.listdir(patches_dir))
if s.endswith('.patch')]
for p in patchfiles:
log.info("Applying %s" % p)
if os.system("patch -p1 < '%s'" % p):
log.error("Failed to apply patches.")
sys.exit(1)
os.chdir(cwd)

log.info("Copying include and lib files.")
Expand Down

0 comments on commit 809ffda

Please sign in to comment.