mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 04:13:12 +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" ```
86 lines
1.9 KiB
Nix
86 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
buildPythonPackage,
|
|
rustPlatform,
|
|
cargo,
|
|
pkg-config,
|
|
rustc,
|
|
rustfmt,
|
|
setuptools-rust,
|
|
openssl,
|
|
Security,
|
|
msgpack,
|
|
fetchpatch,
|
|
nixosTests,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "etebase";
|
|
version = "0.31.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "etesync";
|
|
repo = "etebase-py";
|
|
rev = "v${version}";
|
|
hash = "sha256-ZNUUp/0fGJxL/Rt8sAZ864rg8uCcNybIYSk4POt0vqg=";
|
|
};
|
|
|
|
# https://github.com/etesync/etebase-py/pull/54
|
|
patches = [
|
|
# fix python 3.12 build
|
|
(fetchpatch {
|
|
url = "https://github.com/etesync/etebase-py/commit/898eb3aca1d4eb30d4aeae15e35d0bc45dd7b3c8.patch";
|
|
hash = "sha256-0BDUTztiC4MiwwNEDFtfc5ruc69Qk+svepQZRixNJgA=";
|
|
})
|
|
# replace flapigen git dependency in Cargo.lock
|
|
(fetchpatch {
|
|
url = "https://github.com/etesync/etebase-py/commit/7e9e4244a144dd46383d8be950d3df79e28eb069.patch";
|
|
hash = "sha256-8EH8Sc3UnmuCrSwDf3+as218HiG2Ed3r+FCMrUi5YrI=";
|
|
})
|
|
];
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-We19laZd6b2fLSPNLegyNp0eQSeCvUJeTIXqvG7o08c=";
|
|
inherit patches;
|
|
};
|
|
|
|
format = "pyproject";
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
rustfmt
|
|
setuptools-rust
|
|
rustPlatform.cargoSetupHook
|
|
cargo
|
|
rustc
|
|
];
|
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
|
|
|
|
propagatedBuildInputs = [ msgpack ];
|
|
|
|
postPatch = ''
|
|
# Use system OpenSSL, which gets security updates.
|
|
substituteInPlace Cargo.toml \
|
|
--replace ', features = ["vendored"]' ""
|
|
'';
|
|
|
|
pythonImportsCheck = [ "etebase" ];
|
|
|
|
passthru.tests = {
|
|
inherit (nixosTests) etebase-server;
|
|
};
|
|
|
|
meta = with lib; {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
homepage = "https://www.etebase.com/";
|
|
description = "Python client library for Etebase";
|
|
license = licenses.bsd3;
|
|
maintainers = with maintainers; [ _3699n ];
|
|
};
|
|
}
|