2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2022-06-26 10:26:21 +00:00
|
|
|
, fetchpatch
|
|
|
|
, python3
|
2022-04-27 09:35:20 +00:00
|
|
|
, ffmpeg
|
|
|
|
}:
|
2022-06-26 10:26:21 +00: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-04-12 18:23:04 +00:00
|
|
|
pname = "gphotos-sync";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "3.04";
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
2021-04-12 18:23:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gilesknap";
|
|
|
|
repo = "gphotos-sync";
|
|
|
|
rev = version;
|
2022-06-26 10:26:21 +00:00
|
|
|
sha256 = "0mnlnqmlh3n1b6fjwpx2byl1z41vgghjb95598kz5gvdi95iirrs";
|
2021-04-12 18:23:04 +00:00
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
patches = [
|
|
|
|
./skip-network-tests.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
2021-04-12 18:23:04 +00:00
|
|
|
appdirs
|
|
|
|
attrs
|
|
|
|
exif
|
2022-06-26 10:26:21 +00:00
|
|
|
google-auth-oauthlib
|
2021-04-12 18:23:04 +00:00
|
|
|
psutil
|
|
|
|
pyyaml
|
2022-04-27 09:35:20 +00:00
|
|
|
requests-oauthlib
|
2022-06-26 10:26:21 +00:00
|
|
|
types-pyyaml
|
|
|
|
types-requests
|
2021-04-12 18:23:04 +00:00
|
|
|
];
|
2021-08-11 14:56:57 +00:00
|
|
|
|
2022-06-26 10:26:21 +00: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-04-27 09:35:20 +00:00
|
|
|
buildInputs = [
|
|
|
|
ffmpeg
|
|
|
|
];
|
2021-08-11 14:56:57 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with py.pkgs; [
|
2021-04-12 18:23:04 +00:00
|
|
|
mock
|
2022-06-26 10:26:21 +00:00
|
|
|
pytestCheckHook
|
|
|
|
setuptools-scm
|
2021-04-12 18:23:04 +00:00
|
|
|
];
|
2021-08-11 14:56:57 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
preCheck = ''
|
2021-04-12 18:23:04 +00:00
|
|
|
export HOME=$(mktemp -d)
|
2022-06-26 10:26:21 +00:00
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "--cov=gphotos_sync --cov-report term --cov-report xml:cov.xml" ""
|
2021-04-12 18:23:04 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Google Photos and Albums backup with Google Photos Library API";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://github.com/gilesknap/gphotos-sync";
|
2022-06-26 10:26:21 +00:00
|
|
|
license = licenses.asl20;
|
2021-04-12 18:23:04 +00:00
|
|
|
maintainers = with maintainers; [ dnr ];
|
|
|
|
};
|
|
|
|
}
|