mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-16 13:00:41 +08:00
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" ```
70 lines
1.4 KiB
Nix
70 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
aiohttp,
|
|
async-timeout,
|
|
buildPythonPackage,
|
|
click,
|
|
construct,
|
|
dacite,
|
|
fetchFromGitHub,
|
|
paho-mqtt,
|
|
poetry-core,
|
|
pycryptodome,
|
|
pycryptodomex,
|
|
pytest-asyncio,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "python-roborock";
|
|
version = "2.6.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.10";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "humbertogontijo";
|
|
repo = "python-roborock";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-Mszy1p7TOEynCePCEiLhwdWiKXfFnlo3/a3vc9TxGeY=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace-fail "poetry-core==1.8.0" "poetry-core"
|
|
'';
|
|
|
|
pythonRelaxDeps = [ "pycryptodome" ];
|
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
aiohttp
|
|
async-timeout
|
|
click
|
|
construct
|
|
dacite
|
|
paho-mqtt
|
|
pycryptodome
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ pycryptodomex ];
|
|
|
|
nativeCheckInputs = [
|
|
pytest-asyncio
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [ "roborock" ];
|
|
|
|
meta = with lib; {
|
|
description = "Python library & console tool for controlling Roborock vacuum";
|
|
homepage = "https://github.com/humbertogontijo/python-roborock";
|
|
changelog = "https://github.com/humbertogontijo/python-roborock/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ fab ];
|
|
mainProgram = "roborock";
|
|
};
|
|
}
|