From a5b49f272ff1c4d6392385db2cbd4f764f46b85c Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 17 Dec 2021 11:12:34 +0000 Subject: [PATCH] Remove nimPackages.python Python 2 is deprecated. Ref #148669 --- .../nim-packages/python/default.nix | 25 ----------- .../development/nim-packages/spry/default.nix | 6 +-- .../nim-packages/spry/python.patch | 43 +++++++++++++++++++ pkgs/top-level/nim-packages.nix | 2 - 4 files changed, 46 insertions(+), 30 deletions(-) delete mode 100644 pkgs/development/nim-packages/python/default.nix create mode 100644 pkgs/development/nim-packages/spry/python.patch diff --git a/pkgs/development/nim-packages/python/default.nix b/pkgs/development/nim-packages/python/default.nix deleted file mode 100644 index 38002c15c939..000000000000 --- a/pkgs/development/nim-packages/python/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, buildNimPackage, fetchFromGitHub, python27 }: - -buildNimPackage rec { - pname = "python"; - version = "1.2"; - src = fetchFromGitHub { - owner = "nim-lang"; - repo = pname; - rev = "b7c3b2c447a69fdb0a974ba149062e52182fda08"; - hash = "sha256-Wl4on0rf4zbNxmwmq/ZkNiPIFCZY+1BdokPQoba2EVI="; - }; - postPatch = let pythonLib = "${python27}/lib/libpython2.7.so"; - in '' - substituteInPlace src/python.nim \ - --replace 'items(LibNames)' "[\"${pythonLib}\"]" \ - --replace 'dynlib: dllname' 'dynlib: "${pythonLib}"' - ''; - doCheck = true; - meta = with lib; - src.meta // { - description = "Nim wrapper for the Python 2 programming language"; - license = [ licenses.mit ]; - maintainers = [ maintainers.ehmry ]; - }; -} diff --git a/pkgs/development/nim-packages/spry/default.nix b/pkgs/development/nim-packages/spry/default.nix index 497431be1e86..ebb23de70144 100644 --- a/pkgs/development/nim-packages/spry/default.nix +++ b/pkgs/development/nim-packages/spry/default.nix @@ -1,4 +1,4 @@ -{ lib, buildNimPackage, fetchFromGitHub, python, rocksdb, snappy, spryvm, stew +{ lib, buildNimPackage, fetchFromGitHub, rocksdb, snappy, spryvm, stew , tempfile, ui }: buildNimPackage rec { @@ -10,8 +10,8 @@ buildNimPackage rec { rev = "098da7bb34a9113d5db5402fecfc76b1c3fa3b36"; hash = "sha256-PfWBrG2Z16tLgcN8JYpHaNMysBbbYX812Lkgk0ItMwE="; }; - buildInputs = [ python rocksdb snappy spryvm stew tempfile ui ]; - patches = [ ./nil.patch ]; + buildInputs = [ rocksdb snappy spryvm stew tempfile ui ]; + patches = [ ./nil.patch ./python.patch ]; doCheck = true; meta = with lib; src.meta // { diff --git a/pkgs/development/nim-packages/spry/python.patch b/pkgs/development/nim-packages/spry/python.patch new file mode 100644 index 000000000000..565e53c2ddcd --- /dev/null +++ b/pkgs/development/nim-packages/spry/python.patch @@ -0,0 +1,43 @@ +diff --git a/src/ispry.nim b/src/ispry.nim +index 23ad6c3..d2cfc89 100644 +--- a/src/ispry.nim ++++ b/src/ispry.nim +@@ -21,7 +21,7 @@ import spryvm/sprycore, spryvm/sprylib, spryvm/spryextend, spryvm/sprymath, + spryvm/spryos, spryvm/spryio, spryvm/sprymemfile, spryvm/sprythread, + spryvm/spryoo, spryvm/sprydebug, spryvm/sprycompress, spryvm/sprystring, + spryvm/sprymodules, spryvm/spryreflect, spryvm/spryblock, spryvm/sprynet, +- spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite, spryvm/sprypython, ++ spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite, + spryvm/spryrocksdb + + const Prompt = ">>> " +@@ -63,7 +63,6 @@ proc main() = + + spry.addMemfile() + spry.addThread() +- spry.addPython() + spry.addDebug() + spry.addCompress() + spry.addReflect() +diff --git a/src/spry.nim b/src/spry.nim +index 670a280..cda9027 100644 +--- a/src/spry.nim ++++ b/src/spry.nim +@@ -14,8 +14,7 @@ import spryvm/sprycore, spryvm/sprylib, spryvm/spryextend, spryvm/sprymath, + spryvm/spryos, spryvm/spryio, spryvm/sprymemfile, spryvm/sprythread, + spryvm/spryoo, spryvm/sprydebug, spryvm/sprycompress, spryvm/sprystring, + spryvm/sprymodules, spryvm/spryreflect, spryvm/spryui, spryvm/spryblock, spryvm/sprynet, +- spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite, spryvm/spryrocksdb, +- spryvm/sprypython ++ spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite, spryvm/spryrocksdb + + var spry = newInterpreter() + +@@ -34,7 +33,6 @@ spry.addOO() + + spry.addMemfile() + spry.addThread() +-spry.addPython() + spry.addDebug() + spry.addCompress() + spry.addReflect() diff --git a/pkgs/top-level/nim-packages.nix b/pkgs/top-level/nim-packages.nix index 6c8c5ff7cc70..fa78e6ed9aa9 100644 --- a/pkgs/top-level/nim-packages.nix +++ b/pkgs/top-level/nim-packages.nix @@ -48,8 +48,6 @@ lib.makeScope newScope (self: pixie = callPackage ../development/nim-packages/pixie { }; - python = callPackage ../development/nim-packages/python { }; - redis = callPackage ../development/nim-packages/redis { }; redpool = callPackage ../development/nim-packages/redpool { };