e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
52 lines
1.1 KiB
Nix
52 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
rustPlatform,
|
|
libiconv,
|
|
numpy,
|
|
unittestCheckHook,
|
|
pythonOlder,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "nutils-poly";
|
|
version = "1.0.1";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "nutils";
|
|
repo = "poly-py";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-dxFv4Az3uz6Du5dk5KZJ+unVbt3aZjxXliAQZhmBWDM=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
name = "${pname}-${version}";
|
|
inherit src;
|
|
hash = "sha256-+fnKvlSwM197rsyusFH7rs1W6livxel45UGbi1sB05k=";
|
|
};
|
|
|
|
nativeBuildInputs = [ rustPlatform.cargoSetupHook ];
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
|
|
|
build-system = [ rustPlatform.maturinBuildHook ];
|
|
|
|
dependencies = [ numpy ];
|
|
|
|
nativeCheckInputs = [ unittestCheckHook ];
|
|
|
|
pythonImportsCheck = [ "nutils_poly" ];
|
|
|
|
meta = {
|
|
description = "Low-level functions for evaluating and manipulating polynomials";
|
|
homepage = "https://github.com/nutils/poly-py";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ tomasajt ];
|
|
};
|
|
}
|