diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch')
-rw-r--r-- | nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch index 3f844e1b1ef5..981759202386 100644 --- a/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch +++ b/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch @@ -1,17 +1,17 @@ diff --git a/src/sage/env.py b/src/sage/env.py -index 061b94f3f1..67cd091540 100644 +index 1ddfc7cfb9..45033d6328 100644 --- a/src/sage/env.py +++ b/src/sage/env.py -@@ -189,88 +189,13 @@ var('MAXIMA_FAS') +@@ -203,97 +203,13 @@ var('ARB_LIBRARY', 'arb') var('SAGE_BANNER', '') var('SAGE_IMPORTALL', 'yes') - -def _get_shared_lib_filename(libname, *additional_libnames): - """ -- Return the full path to a shared library file installed in the standard -- location for the system within the ``LIBDIR`` prefix (or -- ``$SAGE_LOCAL/lib`` in the case of manual build of Sage). +- Return the full path to a shared library file installed in +- ``$SAGE_LOCAL/lib`` or the directories associated with the +- Python sysconfig. - - This can also be passed more than one library name (e.g. for cases where - some library may have multiple names depending on the platform) in which @@ -25,7 +25,7 @@ index 061b94f3f1..67cd091540 100644 - For distributions like Debian that use a multiarch layout, we also try the - multiarch lib paths (i.e. ``/usr/lib/<arch>/``). - -- Returns ``None`` if the file does not exist. +- This returns ``None`` if the file does not exist. - - EXAMPLES:: - @@ -48,11 +48,17 @@ index 061b94f3f1..67cd091540 100644 - - for libname in (libname,) + additional_libnames: - if sys.platform == 'cygwin': -- bindir = sysconfig.get_config_var('BINDIR') +- # Later down we take the last matching DLL found, so search +- # SAGE_LOCAL second so that it takes precedence +- bindirs = [ +- sysconfig.get_config_var('BINDIR'), +- os.path.join(SAGE_LOCAL, 'bin') +- ] - pats = ['cyg{}.dll'.format(libname), 'cyg{}-*.dll'.format(libname)] - filenames = [] -- for pat in pats: -- filenames += glob.glob(os.path.join(bindir, pat)) +- for bindir in bindirs: +- for pat in pats: +- filenames += glob.glob(os.path.join(bindir, pat)) - - # Note: This is not very robust, since if there are multi DLL - # versions for the same library this just selects one more or less @@ -66,10 +72,13 @@ index 061b94f3f1..67cd091540 100644 - else: - ext = 'so' - -- libdirs = [sysconfig.get_config_var('LIBDIR')] +- libdirs = [ +- os.path.join(SAGE_LOCAL, 'lib'), +- sysconfig.get_config_var('LIBDIR') +- ] - multilib = sysconfig.get_config_var('MULTILIB') - if multilib: -- libdirs.insert(0, os.path.join(libdirs[0], multilib)) +- libdirs.insert(1, os.path.join(libdirs[0], multilib)) - - for libdir in libdirs: - basename = 'lib{}.{}'.format(libname, ext) @@ -89,7 +98,7 @@ index 061b94f3f1..67cd091540 100644 # locate libgap shared object -GAP_SO= _get_shared_lib_filename('gap','') -+GAP_SO= '/default' ++GAP_SO = '/default' var('GAP_SO', GAP_SO) # post process |