2023-10-15 00:23:34 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, anki
|
|
|
|
, darwin
|
|
|
|
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, protobuf
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
pname = "anki-sync-server";
|
|
|
|
inherit (anki) version src cargoLock;
|
|
|
|
|
2024-08-10 04:32:46 +00:00
|
|
|
patches = [
|
|
|
|
./patches/Cargo.lock-update-time-for-rust-1.80.patch
|
|
|
|
];
|
|
|
|
|
2023-10-15 00:23:34 +00:00
|
|
|
# only build sync server
|
|
|
|
cargoBuildFlags = [
|
|
|
|
"--bin"
|
|
|
|
"anki-sync-server"
|
|
|
|
];
|
|
|
|
|
2024-08-13 06:07:09 +00:00
|
|
|
checkFlags = [
|
|
|
|
# these two tests are flaky, see https://github.com/ankitects/anki/issues/3353
|
|
|
|
# Also removed from anki when removing this.
|
|
|
|
"--skip=media::check::test::unicode_normalization"
|
|
|
|
"--skip=scheduler::answering::test::state_application"
|
|
|
|
];
|
|
|
|
|
2023-10-15 00:23:34 +00:00
|
|
|
nativeBuildInputs = [ protobuf pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
|
|
];
|
|
|
|
|
|
|
|
env.PROTOC = lib.getExe protobuf;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Standalone official anki sync server";
|
|
|
|
homepage = "https://apps.ankiweb.net";
|
|
|
|
license = with licenses; [ agpl3Plus ];
|
|
|
|
maintainers = with maintainers; [ martinetd ];
|
|
|
|
mainProgram = "anki-sync-server";
|
|
|
|
};
|
|
|
|
}
|