Loading pkgs/development/python-modules/kornia-rs/Cargo.lock 0 → 100644 +1598 −0 File added.Preview size limit exceeded, changes collapsed. Show changes pkgs/development/python-modules/kornia-rs/default.nix 0 → 100644 +56 −0 Original line number Diff line number Diff line { lib , fetchFromGitHub , buildPythonPackage , rustPlatform , cmake , nasm , substituteAll }: buildPythonPackage rec { pname = "kornia-rs"; version = "0.1.2"; pyproject = true; src = fetchFromGitHub { owner = "kornia"; repo = "kornia-rs"; rev = "refs/tags/v${version}"; hash = "sha256-7toCMaHzFAzm6gThVLBxKLgQVgFJatdJseDlfdeS8RE="; }; nativeBuildInputs = [ rustPlatform.maturinBuildHook rustPlatform.cargoSetupHook cmake # Only for dependencies. nasm # Only for dependencies. ]; cargoRoot = "py-kornia"; cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; # The path dependency doesn't vendor the dependencies correctly, so get kornia-rs from crates instead. patches = [ (substituteAll { src = ./kornia-rs-from-crates.patch; inherit version; }) ]; prePatch = '' cp ${./Cargo.lock} py-kornia/Cargo.lock ''; maturinBuildFlags = [ "-m" "py-kornia/Cargo.toml" ]; dontUseCmakeConfigure = true; # We only want to use CMake to build some Rust dependencies. meta = with lib; { homepage = "https://github.com/kornia/kornia-rs"; description = "Python bindings to Low-level Computer Vision library in Rust"; license = licenses.asl20; maintainers = with maintainers; [ chpatrick ]; }; } pkgs/development/python-modules/kornia-rs/kornia-rs-from-crates.patch 0 → 100644 +12 −0 Original line number Diff line number Diff line diff --git a/py-kornia/Cargo.toml b/py-kornia/Cargo.toml index e0563f3..e192654 100644 --- a/py-kornia/Cargo.toml +++ b/py-kornia/Cargo.toml @@ -9,6 +9,6 @@ crate-type = ["cdylib"] [dependencies] anyhow = "1.0.80" -kornia-rs = { path = ".." } +kornia-rs = { version = "@version@" } pyo3 = { version = "0.20", features = ["extension-module"] } numpy = { version = "0.20.0" } pkgs/top-level/python-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -6380,6 +6380,8 @@ self: super: with self; { kornia = callPackage ../development/python-modules/kornia { }; kornia-rs = callPackage ../development/python-modules/kornia-rs { }; krakenex = callPackage ../development/python-modules/krakenex { }; krfzf-py = callPackage ../development/python-modules/krfzf-py { }; Loading Loading
pkgs/development/python-modules/kornia-rs/Cargo.lock 0 → 100644 +1598 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
pkgs/development/python-modules/kornia-rs/default.nix 0 → 100644 +56 −0 Original line number Diff line number Diff line { lib , fetchFromGitHub , buildPythonPackage , rustPlatform , cmake , nasm , substituteAll }: buildPythonPackage rec { pname = "kornia-rs"; version = "0.1.2"; pyproject = true; src = fetchFromGitHub { owner = "kornia"; repo = "kornia-rs"; rev = "refs/tags/v${version}"; hash = "sha256-7toCMaHzFAzm6gThVLBxKLgQVgFJatdJseDlfdeS8RE="; }; nativeBuildInputs = [ rustPlatform.maturinBuildHook rustPlatform.cargoSetupHook cmake # Only for dependencies. nasm # Only for dependencies. ]; cargoRoot = "py-kornia"; cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; # The path dependency doesn't vendor the dependencies correctly, so get kornia-rs from crates instead. patches = [ (substituteAll { src = ./kornia-rs-from-crates.patch; inherit version; }) ]; prePatch = '' cp ${./Cargo.lock} py-kornia/Cargo.lock ''; maturinBuildFlags = [ "-m" "py-kornia/Cargo.toml" ]; dontUseCmakeConfigure = true; # We only want to use CMake to build some Rust dependencies. meta = with lib; { homepage = "https://github.com/kornia/kornia-rs"; description = "Python bindings to Low-level Computer Vision library in Rust"; license = licenses.asl20; maintainers = with maintainers; [ chpatrick ]; }; }
pkgs/development/python-modules/kornia-rs/kornia-rs-from-crates.patch 0 → 100644 +12 −0 Original line number Diff line number Diff line diff --git a/py-kornia/Cargo.toml b/py-kornia/Cargo.toml index e0563f3..e192654 100644 --- a/py-kornia/Cargo.toml +++ b/py-kornia/Cargo.toml @@ -9,6 +9,6 @@ crate-type = ["cdylib"] [dependencies] anyhow = "1.0.80" -kornia-rs = { path = ".." } +kornia-rs = { version = "@version@" } pyo3 = { version = "0.20", features = ["extension-module"] } numpy = { version = "0.20.0" }
pkgs/top-level/python-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -6380,6 +6380,8 @@ self: super: with self; { kornia = callPackage ../development/python-modules/kornia { }; kornia-rs = callPackage ../development/python-modules/kornia-rs { }; krakenex = callPackage ../development/python-modules/krakenex { }; krfzf-py = callPackage ../development/python-modules/krfzf-py { }; Loading