nixpkgs/pkgs/tools/backup/gphotos-sync/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
1.8 KiB
Nix
Raw Normal View History

2022-02-25 15:58:24 +01:00
{ lib
, fetchFromGitHub
2022-06-06 01:21:01 +02:00
, fetchpatch
, python3
2022-02-25 15:58:24 +01:00
, ffmpeg
}:
2022-06-06 01:21:01 +02:00
let
py = python3.override {
packageOverrides = self: super: {
google-auth-oauthlib = super.google-auth-oauthlib.overridePythonAttrs (oldAttrs: rec {
version = "0.5.2b1";
src = fetchFromGitHub {
owner = "gilesknap";
repo = "google-auth-library-python-oauthlib";
rev = "v${version}";
hash = "sha256-o4Jakm/JgLszumrSoTTnU+nc79Ei70abjpmn614qGyc=";
};
});
};
};
in
py.pkgs.buildPythonApplication rec {
2021-03-17 01:12:17 +01:00
pname = "gphotos-sync";
2022-06-06 01:21:01 +02:00
version = "3.04";
format = "pyproject";
SETUPTOOLS_SCM_PRETEND_VERSION = version;
2021-03-17 01:12:17 +01:00
src = fetchFromGitHub {
owner = "gilesknap";
repo = "gphotos-sync";
rev = version;
2022-06-06 01:21:01 +02:00
sha256 = "0mnlnqmlh3n1b6fjwpx2byl1z41vgghjb95598kz5gvdi95iirrs";
2021-03-17 01:12:17 +01:00
};
2022-06-06 01:21:01 +02:00
patches = [
./skip-network-tests.patch
];
propagatedBuildInputs = with py.pkgs; [
2021-03-17 01:12:17 +01:00
appdirs
attrs
exif
2022-06-06 01:21:01 +02:00
google-auth-oauthlib
2021-03-17 01:12:17 +01:00
psutil
pyyaml
2022-02-25 15:58:24 +01:00
requests-oauthlib
2022-06-06 01:21:01 +02:00
types-pyyaml
types-requests
2021-03-17 01:12:17 +01:00
];
2021-07-25 20:56:50 +02:00
2022-06-06 01:21:01 +02:00
postPatch = ''
# this is a patched release that we include via packageOverrides above
substituteInPlace setup.cfg \
--replace " @ https://github.com/gilesknap/google-auth-library-python-oauthlib/archive/refs/tags/v0.5.2b1.zip" ""
'';
2022-02-25 15:58:24 +01:00
buildInputs = [
ffmpeg
];
2021-07-25 20:56:50 +02:00
2022-06-06 01:21:01 +02:00
checkInputs = with py.pkgs; [
2021-03-17 01:12:17 +01:00
mock
2022-06-06 01:21:01 +02:00
pytestCheckHook
setuptools-scm
2021-03-17 01:12:17 +01:00
];
2021-07-25 20:56:50 +02:00
2022-06-06 01:21:01 +02:00
preCheck = ''
2021-03-17 01:12:17 +01:00
export HOME=$(mktemp -d)
2022-06-06 01:21:01 +02:00
substituteInPlace setup.cfg \
--replace "--cov=gphotos_sync --cov-report term --cov-report xml:cov.xml" ""
2021-03-17 01:12:17 +01:00
'';
meta = with lib; {
description = "Google Photos and Albums backup with Google Photos Library API";
2022-02-25 15:58:24 +01:00
homepage = "https://github.com/gilesknap/gphotos-sync";
2022-06-06 01:21:01 +02:00
license = licenses.asl20;
2021-03-17 01:12:17 +01:00
maintainers = with maintainers; [ dnr ];
};
}