From 5451b89b28b707ea8970d8a303512e624c36628e Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Fri, 17 Mar 2023 12:08:25 +0900 Subject: [PATCH] ankisyncd: use bundled anki version Updating anki in the next commit will break it otherwise. --- pkgs/servers/ankisyncd/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/ankisyncd/default.nix b/pkgs/servers/ankisyncd/default.nix index 45a43669502b..b5e91bc1bb63 100644 --- a/pkgs/servers/ankisyncd/default.nix +++ b/pkgs/servers/ankisyncd/default.nix @@ -1,7 +1,6 @@ { lib , fetchFromGitHub , python3 -, anki }: python3.pkgs.buildPythonApplication rec { @@ -11,7 +10,8 @@ python3.pkgs.buildPythonApplication rec { owner = "ankicommunity"; repo = "anki-sync-server"; rev = version; - sha256 = "196xhd6vzp1ncr3ahz0bv0gp1ap2s37j8v48dwmvaywzayakqdab"; + hash = "sha256-RXrdJGJ+HMSpDGQBuVPPqsh3+uwAgE6f7ZJ0yFRMI8I="; + fetchSubmodules = true; }; format = "other"; @@ -21,6 +21,7 @@ python3.pkgs.buildPythonApplication rec { mkdir -p $out/${python3.sitePackages} cp -r ankisyncd utils ankisyncd.conf $out/${python3.sitePackages} + cp -r anki-bundled/anki $out/${python3.sitePackages} mkdir $out/share cp ankisyncctl.py $out/share/ @@ -28,7 +29,7 @@ python3.pkgs.buildPythonApplication rec { ''; fixupPhase = '' - PYTHONPATH="$PYTHONPATH:$out/${python3.sitePackages}:${anki}" + PYTHONPATH="$PYTHONPATH:$out/${python3.sitePackages}" makeWrapper "${python3.interpreter}" "$out/bin/ankisyncd" \ --set PYTHONPATH $PYTHONPATH \ @@ -46,14 +47,14 @@ python3.pkgs.buildPythonApplication rec { buildInputs = [ ]; - propagatedBuildInputs = [ anki ]; + propagatedBuildInputs = with python3.pkgs; [ + decorator + requests + ]; checkPhase = '' - # Exclude tests that require sqlite's sqldiff command, since - # it isn't yet packaged for NixOS, although 2 PRs exist: - # - https://github.com/NixOS/nixpkgs/pull/69112 - # - https://github.com/NixOS/nixpkgs/pull/75784 - # Once this is merged, these tests can be run as well. + # skip these tests, our files are too young: + # tests/test_web_media.py::SyncAppFunctionalMediaTest::test_sync_mediaChanges ValueError: ZIP does not support timestamps before 1980 pytest --ignore tests/test_web_media.py tests/ '';