-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c1b370a update nixpkgs (Jonas Nick) Pull request description: ACKs for top commit: erikarvstedt: ACK c1b370a Tree-SHA512: a8b0c2d9a54286a899950172e62a6c6a84b5d255a0dee5227d6c39d969080a2c42e5999da26a1b00651937f36caf23fce9396eb8d9f6f8dabd368d6d90aa28e6
- Loading branch information
Showing
15 changed files
with
592 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ lib, stdenv, python, makePythonHook, setuptools-rust, rust }: | ||
makePythonHook { | ||
name = "setuptools-rust-setup-hook"; | ||
propagatedBuildInputs = [ setuptools-rust ]; | ||
substitutions = { | ||
pyLibDir = "${python}/lib/${python.libPrefix}"; | ||
cargoBuildTarget = rust.toRustTargetSpec stdenv.hostPlatform; | ||
cargoLinkerVar = lib.toUpper ( | ||
builtins.replaceStrings ["-"] ["_"] ( | ||
rust.toRustTarget stdenv.hostPlatform)); | ||
targetLinker = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; | ||
}; | ||
} ./setuptools-rust-hook.sh |
18 changes: 18 additions & 0 deletions
18
pkgs/python-packages/setuptools-rust-hook/setuptools-rust-hook.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
echo "Sourcing setuptools-rust-hook" | ||
|
||
setuptoolsRustSetup() { | ||
# This can work only if rustPlatform.cargoSetupHook is also included | ||
if ! command -v cargoSetupPostPatchHook >/dev/null; then | ||
echo "ERROR: setuptools-rust has to be used alongside with rustPlatform.cargoSetupHook!" | ||
exit 1 | ||
fi | ||
|
||
export PYO3_CROSS_LIB_DIR="@pyLibDir@" | ||
export CARGO_BUILD_TARGET=@cargoBuildTarget@ | ||
# TODO theoretically setting linker should not be required because it is | ||
# already set in pkgs/build-support/rust/hooks/default.nix but build fails | ||
# on missing linker without this. | ||
export CARGO_TARGET_@cargoLinkerVar@_LINKER=@targetLinker@ | ||
} | ||
|
||
preConfigureHooks+=(setuptoolsRustSetup) |
116 changes: 116 additions & 0 deletions
116
pkgs/python-packages/specific-versions/cryptography_41/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ lib | ||
, stdenv | ||
, buildPythonPackage | ||
, callPackage | ||
, cargo | ||
, cffi | ||
, fetchPypi | ||
, hypothesis | ||
, iso8601 | ||
, isPyPy | ||
, libiconv | ||
, libxcrypt | ||
, openssl | ||
, pkg-config | ||
, pretend | ||
, py | ||
, pytest-subtests | ||
, pytestCheckHook | ||
, pythonOlder | ||
, pytz | ||
, rustc | ||
, rustPlatform | ||
, Security | ||
, setuptoolsRustBuildHook | ||
}: | ||
|
||
let | ||
cryptography-vectors = callPackage ./vectors.nix { }; | ||
in | ||
buildPythonPackage rec { | ||
pname = "cryptography"; | ||
version = "41.0.3"; # Also update the hash in vectors.nix | ||
format = "pyproject"; | ||
disabled = pythonOlder "3.7"; | ||
|
||
src = fetchPypi { | ||
inherit pname version; | ||
hash = "sha256-bRknQRE+9eMNidy1uVbvThV48wRwhwG4tz044+FGHzQ="; | ||
}; | ||
|
||
cargoDeps = rustPlatform.fetchCargoTarball { | ||
inherit src; | ||
sourceRoot = "${pname}-${version}/${cargoRoot}"; | ||
name = "${pname}-${version}"; | ||
hash = "sha256-LQu7waympGUs+CZun2yDQd2gUUAgyisKBG5mddrfSo0="; | ||
}; | ||
|
||
postPatch = '' | ||
substituteInPlace pyproject.toml \ | ||
--replace "--benchmark-disable" "" | ||
''; | ||
|
||
cargoRoot = "src/rust"; | ||
|
||
nativeBuildInputs = [ | ||
rustPlatform.cargoSetupHook | ||
setuptoolsRustBuildHook | ||
cargo | ||
rustc | ||
pkg-config | ||
] ++ lib.optionals (!isPyPy) [ | ||
cffi | ||
]; | ||
|
||
buildInputs = [ | ||
openssl | ||
] ++ lib.optionals stdenv.isDarwin [ | ||
Security | ||
libiconv | ||
] ++ lib.optionals (pythonOlder "3.9") [ | ||
libxcrypt | ||
]; | ||
|
||
propagatedBuildInputs = lib.optionals (!isPyPy) [ | ||
cffi | ||
]; | ||
|
||
nativeCheckInputs = [ | ||
cryptography-vectors | ||
# Work around `error: infinite recursion encountered` | ||
(hypothesis.override { enableDocumentation = false; }) | ||
iso8601 | ||
pretend | ||
py | ||
pytestCheckHook | ||
pytest-subtests | ||
pytz | ||
]; | ||
|
||
pytestFlagsArray = [ | ||
"--disable-pytest-warnings" | ||
]; | ||
|
||
disabledTestPaths = [ | ||
# save compute time by not running benchmarks | ||
"tests/bench" | ||
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ | ||
# aarch64-darwin forbids W+X memory, but this tests depends on it: | ||
# * https://cffi.readthedocs.io/en/latest/using.html#callbacks | ||
"tests/hazmat/backends/test_openssl_memleak.py" | ||
]; | ||
|
||
meta = with lib; { | ||
description = "A package which provides cryptographic recipes and primitives"; | ||
longDescription = '' | ||
Cryptography includes both high level recipes and low level interfaces to | ||
common cryptographic algorithms such as symmetric ciphers, message | ||
digests, and key derivation functions. | ||
''; | ||
homepage = "https://github.com/pyca/cryptography"; | ||
changelog = "https://cryptography.io/en/latest/changelog/#v" | ||
+ replaceStrings [ "." ] [ "-" ] version; | ||
license = with licenses; [ asl20 bsd3 psfl ]; | ||
maintainers = with maintainers; [ SuperSandro2000 ]; | ||
}; | ||
} |
38 changes: 38 additions & 0 deletions
38
pkgs/python-packages/specific-versions/cryptography_41/vectors.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ lib | ||
, buildPythonPackage | ||
, fetchPypi | ||
, cryptography | ||
, setuptools | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "cryptography-vectors"; | ||
# The test vectors must have the same version as the cryptography package | ||
inherit (cryptography) version; | ||
format = "pyproject"; | ||
|
||
src = fetchPypi { | ||
pname = "cryptography_vectors"; | ||
inherit version; | ||
hash = "sha256-gN4EUsSzT1b1UY6B69dba5BfVyiq7VIdQuQfTryKQ/s="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
setuptools | ||
]; | ||
|
||
# No tests included | ||
doCheck = false; | ||
|
||
pythonImportsCheck = [ | ||
"cryptography_vectors" | ||
]; | ||
|
||
meta = with lib; { | ||
description = "Test vectors for the cryptography package"; | ||
homepage = "https://cryptography.io/en/latest/development/test-vectors/"; | ||
downloadPage = "https://github.com/pyca/cryptography/tree/master/vectors"; | ||
license = with licenses; [ asl20 bsd3 ]; | ||
maintainers = with maintainers; [ SuperSandro2000 ]; | ||
}; | ||
} |
Oops, something went wrong.