1 { lib, runCommand, fetchFromGitHub, rustPlatform, protobuf }:
7 # anki-sync-server-rs expects anki sources in the 'anki' folder
8 # of its own source tree, with a patch applied (mostly to make
9 # some modules public): prepare our own 'src' manually
10 src = runCommand "anki-sync-server-rs-src" {
11 src = fetchFromGitHub {
12 owner = "ankicommunity";
13 repo = "anki-sync-server-rs";
15 hash = "sha256-iL4lJJAV4SrNeRX3s0ZpJ//lrwoKjLsltlX4d2wP6O0=";
20 cp -r "${ankiSrc}" "$out/anki"
21 chmod -R +w "$out/anki"
22 patch -d "$out/anki" -Np1 < "$src/anki_patch/d9d36078f17a2b4b8b44fcb802eb274911ebabe7_anki_rslib.patch"
25 # Note we do not use anki.src because the patch in ankisyncd's
26 # sources expect a fixed version, so we pin it here.
27 ankiSrc = fetchFromGitHub {
31 hash = "sha256-hNrf6asxF7r7QK2XO150yiRjyHAYKN8OFCFYX0SAiwA=";
32 fetchSubmodules = true;
34 in rustPlatform.buildRustPackage {
35 inherit pname version src;
38 lockFile = ./Cargo.lock;
40 "csv-1.1.6" = "sha256-w728ffOVkI+IfK6FbmkGhr0CjuyqgJnPB1kutMJIUYg=";
44 nativeBuildInputs = [ protobuf ];
47 description = "Standalone unofficial anki sync server";
48 homepage = "https://github.com/ankicommunity/anki-sync-server-rs";
49 license = with licenses; [ agpl3Only ];
50 maintainers = with maintainers; [ martinetd ];
51 mainProgram = "ankisyncd";