mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 09:04:17 +00:00
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" ```
91 lines
1.8 KiB
Nix
91 lines
1.8 KiB
Nix
{ lib
|
|
, stdenv
|
|
, python3Packages
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, nixosTests
|
|
, enableDbusUi ? true
|
|
, wrapGAppsHook3
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "pantalaimon";
|
|
version = "0.10.5";
|
|
pyproject = true;
|
|
|
|
# pypi tarball miss tests
|
|
src = fetchFromGitHub {
|
|
owner = "matrix-org";
|
|
repo = "pantalaimon";
|
|
rev = version;
|
|
hash = "sha256-yMhE3wKRbFHoL0vdFR8gMkNU7Su4FHbAwKQYADaaWpk=";
|
|
};
|
|
|
|
build-system = [
|
|
installShellFiles
|
|
] ++ (with python3Packages; [
|
|
setuptools
|
|
]);
|
|
|
|
pythonRelaxDeps = [
|
|
"matrix-nio"
|
|
];
|
|
|
|
dependencies = with python3Packages; [
|
|
aiohttp
|
|
appdirs
|
|
attrs
|
|
cachetools
|
|
click
|
|
janus
|
|
keyring
|
|
logbook
|
|
(matrix-nio.override { withOlm = true; })
|
|
peewee
|
|
prompt-toolkit
|
|
]
|
|
++ lib.optionals enableDbusUi optional-dependencies.ui;
|
|
|
|
optional-dependencies.ui = with python3Packages; [
|
|
dbus-python
|
|
notify2
|
|
pygobject3
|
|
pydbus
|
|
];
|
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
aioresponses
|
|
faker
|
|
pytest-aiohttp
|
|
pytestCheckHook
|
|
]
|
|
++ lib.flatten (lib.attrValues optional-dependencies);
|
|
|
|
nativeBuildInputs = lib.optionals enableDbusUi [
|
|
wrapGAppsHook3
|
|
];
|
|
|
|
dontWrapGApps = enableDbusUi;
|
|
makeWrapperArgs = lib.optionals enableDbusUi [
|
|
"\${gappsWrapperArgs[@]}"
|
|
];
|
|
|
|
# darwin has difficulty communicating with server, fails some integration tests
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
postInstall = ''
|
|
installManPage docs/man/*.[1-9]
|
|
'';
|
|
|
|
passthru.tests = {
|
|
inherit (nixosTests) pantalaimon;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "End-to-end encryption aware Matrix reverse proxy daemon";
|
|
homepage = "https://github.com/matrix-org/pantalaimon";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ valodim ];
|
|
};
|
|
}
|