summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/erlang/generic-builder.nix3
-rw-r--r--pkgs/development/interpreters/evcxr/default.nix6
-rw-r--r--pkgs/development/interpreters/luajit/2.0.nix6
-rw-r--r--pkgs/development/interpreters/luajit/2.1.nix6
-rw-r--r--pkgs/development/interpreters/python/cpython/3.7/find_library.patch105
-rw-r--r--pkgs/development/interpreters/python/cpython/default.nix5
6 files changed, 120 insertions, 11 deletions
diff --git a/pkgs/development/interpreters/erlang/generic-builder.nix b/pkgs/development/interpreters/erlang/generic-builder.nix
index 18b658ae37c..91ea2fe57ab 100644
--- a/pkgs/development/interpreters/erlang/generic-builder.nix
+++ b/pkgs/development/interpreters/erlang/generic-builder.nix
@@ -5,7 +5,7 @@
 , unixODBC ? null # odbcSupport
 , libGL ? null, libGLU ? null, wxGTK ? null, wxmac ? null, xorg ? null # wxSupport
 , parallelBuild ? false
-, withSystemd ? stdenv.isLinux, systemd # systemd support in epmd
+, systemd
 }:
 
 { baseName ? "erlang"
@@ -20,6 +20,7 @@
 , enableKernelPoll ? true
 , javacSupport ? false, javacPackages ? [ openjdk8 ]
 , odbcSupport ? false, odbcPackages ? [ unixODBC ]
+, withSystemd ? stdenv.isLinux # systemd support in epmd
 , wxSupport ? true, wxPackages ? [ libGL libGLU wxGTK xorg.libX11 ]
 , preUnpack ? "", postUnpack ? ""
 , patches ? [], patchPhase ? "", prePatch ? "", postPatch ? ""
diff --git a/pkgs/development/interpreters/evcxr/default.nix b/pkgs/development/interpreters/evcxr/default.nix
index a97f132b3b2..59abf36f7ac 100644
--- a/pkgs/development/interpreters/evcxr/default.nix
+++ b/pkgs/development/interpreters/evcxr/default.nix
@@ -2,16 +2,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "evcxr";
-  version = "0.6.0";
+  version = "0.7.0";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "evcxr";
     rev = "v${version}";
-    sha256 = "sha256-QpUhUE65/IuT/VenziPX6z+CbJswbPPIv/ZnTthZpEU=";
+    sha256 = "sha256-33XeepqwYmTMcObroPTuxykYuM9qYI1+LV5lZIFSomg=";
   };
 
-  cargoSha256 = "sha256-iUzVd4XtD+41yTV/BmqWLenzAUNPfS7vIHm1KfuPe9A=";
+  cargoSha256 = "sha256-tjCID3YeGkxcq/LqJDMHGNpv1MCXKtcLlDnNkFwx1zU=";
 
   RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
 
diff --git a/pkgs/development/interpreters/luajit/2.0.nix b/pkgs/development/interpreters/luajit/2.0.nix
index 22ad9aa05f4..ffc406a2a7a 100644
--- a/pkgs/development/interpreters/luajit/2.0.nix
+++ b/pkgs/development/interpreters/luajit/2.0.nix
@@ -1,10 +1,10 @@
 { self, callPackage, lib }:
 callPackage ./default.nix {
   inherit self;
-  version = "2.0.5-2020-09-27";
-  rev = "e8ec6fe";
+  version = "2.0.5-2020-12-28";
+  rev = "56c04accf975bff2519c34721dccbbdb7b8e6963";
   isStable = true;
-  sha256 = "0v7g216j0zrjp32nfjqqxzgxgvgbdx89h3x0djbqg3avsgxjwnbk";
+  sha256 = "0mmx7dy843iqdpyxxdfks860np0311gg58gi4zczx10h62y6jacm";
   extraMeta = { # this isn't precise but it at least stops the useless Hydra build
     platforms = with lib; filter (p: p != "aarch64-linux")
       (platforms.linux ++ platforms.darwin);
diff --git a/pkgs/development/interpreters/luajit/2.1.nix b/pkgs/development/interpreters/luajit/2.1.nix
index 18b4d32574a..7335ecd656a 100644
--- a/pkgs/development/interpreters/luajit/2.1.nix
+++ b/pkgs/development/interpreters/luajit/2.1.nix
@@ -1,8 +1,8 @@
 { self, callPackage }:
 callPackage ./default.nix {
   inherit self;
-  version = "2.1.0-2020-09-30";
-  rev = "e9af1ab";
+  version = "2.1.0-2020-12-28";
+  rev = "65378759f38bb946e40f31799992434effd01bba";
   isStable = false;
-  sha256 = "081vrr4snr1c38cscbq1a8barv7abc9czqqlm4qlbdksa8g32bbj";
+  sha256 = "1h78gydlrmvkdrql4ra5a3xr78iiq12bfmny6kiq65v1jbk8f19g";
 }
diff --git a/pkgs/development/interpreters/python/cpython/3.7/find_library.patch b/pkgs/development/interpreters/python/cpython/3.7/find_library.patch
new file mode 100644
index 00000000000..97fb66662d0
--- /dev/null
+++ b/pkgs/development/interpreters/python/cpython/3.7/find_library.patch
@@ -0,0 +1,105 @@
+From 9b5a023a5dc3127da15253f7acad71019395ebe1 Mon Sep 17 00:00:00 2001
+From: Pablo Galindo <Pablogsal@gmail.com>
+Date: Thu, 8 Oct 2020 19:50:37 +0100
+Subject: [PATCH] [3.7] bpo-41976: Fix the fallback to gcc of
+ ctypes.util.find_library when using gcc>9 (GH-22598). (GH-22601)
+
+(cherry picked from commit 27ac19cca2c639caaf6fedf3632fe6beb265f24f)
+
+Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
+---
+ Lib/ctypes/test/test_find.py                  | 12 ++++++-
+ Lib/ctypes/util.py                            | 32 +++++++++++++++----
+ .../2020-10-08-18-22-28.bpo-41976.Svm0wb.rst  |  3 ++
+ 3 files changed, 39 insertions(+), 8 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
+
+diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
+index b99fdcba7b28f..92ac1840ad7d4 100644
+--- a/Lib/ctypes/test/test_find.py
++++ b/Lib/ctypes/test/test_find.py
+@@ -1,4 +1,5 @@
+ import unittest
++import unittest.mock
+ import os.path
+ import sys
+ import test.support
+@@ -72,7 +73,7 @@ def test_shell_injection(self):
+ 
+ @unittest.skipUnless(sys.platform.startswith('linux'),
+                      'Test only valid for Linux')
+-class LibPathFindTest(unittest.TestCase):
++class FindLibraryLinux(unittest.TestCase):
+     def test_find_on_libpath(self):
+         import subprocess
+         import tempfile
+@@ -111,6 +112,15 @@ def test_find_on_libpath(self):
+                 # LD_LIBRARY_PATH)
+                 self.assertEqual(find_library(libname), 'lib%s.so' % libname)
+ 
++    def test_find_library_with_gcc(self):
++        with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
++            self.assertNotEqual(find_library('c'), None)
++
++    def test_find_library_with_ld(self):
++        with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
++             unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
++            self.assertNotEqual(find_library('c'), None)
++
+ 
+ if __name__ == "__main__":
+     unittest.main()
+diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
+index 97973bce001d9..0c2510e1619c8 100644
+--- a/Lib/ctypes/util.py
++++ b/Lib/ctypes/util.py
+@@ -93,6 +93,12 @@ def find_library(name):
+     # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
+     import re, tempfile
+ 
++    def _is_elf(filename):
++        "Return True if the given file is an ELF file"
++        elf_header = b'\x7fELF'
++        with open(filename, 'br') as thefile:
++            return thefile.read(4) == elf_header
++
+     def _findLib_gcc(name):
+         # Run GCC's linker with the -t (aka --trace) option and examine the
+         # library name it prints out. The GCC command will fail because we
+@@ -299,17 +312,22 @@ def _findLib_ld(name):
+                                      stderr=subprocess.PIPE,
+                                      universal_newlines=True)
+                 out, _ = p.communicate()
+-                res = re.search(expr, os.fsdecode(out))
+-                if res:
+-                    result = res.group(0)
+-            except Exception as e:
++                res = re.findall(expr, os.fsdecode(out))
++                for file in res:
++                    # Check if the given file is an elf file: gcc can report
++                    # some files that are linker scripts and not actual
++                    # shared objects. See bpo-41976 for more details
++                    if not _is_elf(file):
++                        continue
++                    return os.fsdecode(file)
++            except Exception:
+                 pass  # result will be None
+             return result
+ 
+         def find_library(name):
+             # See issue #9998
+             return _findSoname_ldconfig(name) or \
+-                   _get_soname(_findLib_gcc(name) or _findLib_ld(name))
++                   _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
+ 
+ ################################################################
+ # test code
+diff --git a/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst b/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
+new file mode 100644
+index 0000000000000..c8b3fc771845e
+--- /dev/null
++++ b/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
+@@ -0,0 +1,3 @@
++Fixed a bug that was causing :func:`ctypes.util.find_library` to return
++``None`` when triying to locate a library in an environment when gcc>=9 is
++available and ``ldconfig`` is not. Patch by Pablo Galindo
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index cd06c2b6367..b9f1820df3e 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -35,7 +35,7 @@
 , rebuildBytecode ? true
 , stripBytecode ? false
 , includeSiteCustomize ? true
-, static ? false
+, static ? stdenv.hostPlatform.isStatic
 # Not using optimizations on Darwin
 # configure: error: llvm-profdata is required for a --enable-optimizations build but could not be found.
 , enableOptimizations ? (!stdenv.isDarwin)
@@ -165,6 +165,9 @@ in with passthru; stdenv.mkDerivation {
   ] ++ [
     # LDSHARED now uses $CC instead of gcc. Fixes cross-compilation of extension modules.
     ./3.8/0001-On-all-posix-systems-not-just-Darwin-set-LDSHARED-if.patch
+  ] ++ optionals (isPy37 || isPy38) [
+    # Backport a fix for ctypes.util.find_library.
+    ./3.7/find_library.patch
   ];
 
   postPatch = ''