From 561bc25fa450073b634ea82cfae25d70e1e2ef8d Mon Sep 17 00:00:00 2001 From: Nikola Knezevic Date: Fri, 17 Dec 2021 23:09:19 +0100 Subject: [PATCH 1/3] fix: Python 3.10 doesn't need ctypes.util.find_library() patch This patch is only needed on Python 3.9 version, as it is included in 3.10.0 release. --- pkgs/development/interpreters/python/cpython/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index bcfe2b8cd965..da585308a00f 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -240,6 +240,7 @@ in with passthru; stdenv.mkDerivation { ] ++ optionals (pythonAtLeast "3.9" && stdenv.isDarwin) [ # Stop checking for TCL/TK in global macOS locations ./3.9/darwin-tcl-tk.patch + ] ++ optionals (isPy39 && stdenv.isDarwin) [ # ctypes.util.find_library() now finds macOS 11+ system libraries when built on older macOS systems # https://github.com/python/cpython/pull/28053 ./3.9/bpo-44689-ctypes.util.find_library-now-finds-macOS-1.patch From a1c205ba8fd20b0eff4ec24f32ea4f8512bb0caa Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sun, 9 Jan 2022 12:20:41 +1300 Subject: [PATCH 2/3] emacs.pkgs.melpa*: Fix version numbers with negative numbers (cherry picked from commit 7f7252093ffdd080d0e3f3faa7a4a9ccda51e616) --- .../editors/emacs/elisp-packages/libgenerated.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix b/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix index 8ecce11a7421..d49e18c8a3e0 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix @@ -69,7 +69,10 @@ in { melpaBuild { inherit pname ename commit; version = if isNull version then "" else - lib.concatStringsSep "." (map toString version); + lib.concatStringsSep "." (map toString + # Hack: Melpa archives contains versions with parse errors such as [ 4 4 -4 413 ] which should be 4.4-413 + # This filter method is still technically wrong, but it's computationally cheap enough and tapers over the issue + (builtins.filter (n: n > 0) version)); # TODO: Broken should not result in src being null (hack to avoid eval errors) src = if (isNull sha256 || broken) then null else lib.getAttr fetcher (fetcherGenerators args sourceArgs); From 965cf11d3561ef4baac7fd012b644413ca2ec823 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sun, 9 Jan 2022 12:49:16 +1300 Subject: [PATCH 3/3] emacs.pkgs.melpa*: Fix version number checks if number is zero (cherry picked from commit 8c161f6a62852e7e36b3dbb2ca3168e07a3e5ec8) --- pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix b/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix index d49e18c8a3e0..1b131750c69c 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix @@ -72,7 +72,7 @@ in { lib.concatStringsSep "." (map toString # Hack: Melpa archives contains versions with parse errors such as [ 4 4 -4 413 ] which should be 4.4-413 # This filter method is still technically wrong, but it's computationally cheap enough and tapers over the issue - (builtins.filter (n: n > 0) version)); + (builtins.filter (n: n >= 0) version)); # TODO: Broken should not result in src being null (hack to avoid eval errors) src = if (isNull sha256 || broken) then null else lib.getAttr fetcher (fetcherGenerators args sourceArgs);