From b31e4206d90ca4e280355115f1fccd0c85a06166 Mon Sep 17 00:00:00 2001 From: Benjamin Sparks Date: Tue, 23 Jun 2026 16:05:50 +0200 Subject: [PATCH] python3Packages.nltk: 3.9.2 -> 3.9.4 Diff: https://github.com/nltk/nltk/compare/3.9.2...3.9.4 --- .../python-modules/nltk/default.nix | 42 ++++++++----------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/pkgs/development/python-modules/nltk/default.nix b/pkgs/development/python-modules/nltk/default.nix index 129b09cd84ff..f51db1e810d6 100644 --- a/pkgs/development/python-modules/nltk/default.nix +++ b/pkgs/development/python-modules/nltk/default.nix @@ -1,12 +1,12 @@ { lib, pkgs, - fetchPypi, - fetchpatch, + fetchFromGitHub, buildPythonPackage, click, joblib, regex, + setuptools, tqdm, # preInstallCheck @@ -20,33 +20,25 @@ pytest-mock, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "nltk"; - version = "3.9.2"; - format = "setuptools"; + version = "3.9.4"; + pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-D0CemwacpBd8GQPD6EPu+Qx+kpkvpJMa5gfabeSeFBk="; + src = fetchFromGitHub { + owner = "nltk"; + repo = "nltk"; + tag = finalAttrs.version; + hash = "sha256-kDfMiqXgLq91zzDjv/qDn0XwQkYRn2sITI6E4pgWe/8="; }; - patches = [ - # https://github.com/nltk/nltk/security/advisories/GHSA-jm6w-m3j8-898g - # https://github.com/NixOS/nixpkgs/issues/502599 - (fetchpatch { - name = "fix-unauthed-shutdown"; - url = "https://github.com/nltk/nltk/commit/bbaae83db86a0f49e00f5b0db44a7254c268de9b.patch"; - hash = "sha256-1ZzOQXiNxZ6o7JQs0b9FpsUjZtuUAjXEmDkc9mV3dYU="; - }) + postPatch = '' + # In the nix store we trust + substituteInPlace nltk/pathsec.py \ + --replace-fail 'if not (target == scoped_root or target.is_relative_to(scoped_root)):' 'if not (target == scoped_root or target.is_relative_to(scoped_root) or target.is_relative_to("/nix/store")):' + ''; - # https://github.com/nltk/nltk/security/advisories/GHSA-469j-vmhf-r6v7 - # https://github.com/NixOS/nixpkgs/issues/502535 - (fetchpatch { - name = "fix-downloader-path-traversal"; - url = "https://github.com/nltk/nltk/commit/89fe2ec2c6bae6e2e7a46dad65cc34231976ed8a.patch"; - hash = "sha256-hQJmVEDDcio4Ew+Y10WzMV53mpYZuuDsFcEZKEzl7nk="; - }) - ]; + build-system = [ setuptools ]; dependencies = [ click @@ -122,4 +114,4 @@ buildPythonPackage rec { license = lib.licenses.asl20; maintainers = [ lib.maintainers.bengsparks ]; }; -} +})