about summary refs log tree commit diff
path: root/pkgs/development/python-modules/cryptg/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/cryptg/default.nix')
-rw-r--r--pkgs/development/python-modules/cryptg/default.nix44
1 files changed, 26 insertions, 18 deletions
diff --git a/pkgs/development/python-modules/cryptg/default.nix b/pkgs/development/python-modules/cryptg/default.nix
index 52fec2afc231..73d5258efbe3 100644
--- a/pkgs/development/python-modules/cryptg/default.nix
+++ b/pkgs/development/python-modules/cryptg/default.nix
@@ -1,19 +1,21 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, fetchFromGitHub
-, pythonOlder
-, cargo
-, rustPlatform
-, rustc
-, setuptools-rust
-, libiconv
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  fetchFromGitHub,
+  pythonOlder,
+  cargo,
+  rustPlatform,
+  rustc,
+  setuptools,
+  setuptools-rust,
+  libiconv,
 }:
 
 buildPythonPackage rec {
   pname = "cryptg";
-  version = "0.4";
-  format = "setuptools";
+  version = "0.5.post0";
+  pyproject = true;
 
   disabled = pythonOlder "3.7";
 
@@ -21,30 +23,36 @@ buildPythonPackage rec {
     owner = "cher-nov";
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-2HP1mKGPr8wOL5B0APJks3EVBicX2iMFI7vLJGTa1PM=";
+    hash = "sha256-GCTVxCJQvpvHpzaU+OaFM/AKoRvxLyA0u6VIV+94UTY=";
   };
 
   cargoDeps = rustPlatform.fetchCargoTarball {
     inherit src;
-    hash = "sha256-AqSVFOB9Lfvk9h3GtoYlEOXBEt7YZYLhCDNKM9upQ2U=";
+    hash = "sha256-BqtswBTurZoKw7DR3S7woDKLqAqIjKdSS5TBwCI+Bps=";
   };
 
-  nativeBuildInputs = [
+  build-system = [
+    setuptools
     setuptools-rust
+  ];
+
+  nativeBuildInputs = [
     rustPlatform.cargoSetupHook
     rustc
     cargo
   ];
 
-  buildInputs = lib.optionals stdenv.isDarwin [
-    libiconv
-  ];
+  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
 
   # has no tests
   doCheck = false;
 
   pythonImportsCheck = [ "cryptg" ];
 
+  postPatch = ''
+    substituteInPlace pyproject.toml --replace-fail "setuptools[core]" "setuptools"
+  '';
+
   meta = with lib; {
     description = "Official Telethon extension to provide much faster cryptography for Telegram API requests";
     homepage = "https://github.com/cher-nov/cryptg";