2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, boto3
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, humanize
|
|
|
|
, matrix-synapse-unwrapped
|
|
|
|
, pythonOlder
|
|
|
|
, tqdm
|
|
|
|
, twisted
|
|
|
|
, psycopg2
|
|
|
|
}:
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "matrix-synapse-s3-storage-provider";
|
|
|
|
version = "1.2.1";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matrix-org";
|
|
|
|
repo = "synapse-s3-storage-provider";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-92Xkq54jrUE2I9uVOxI72V9imLNU6K4JqDdOZb+4f+Y=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "humanize>=0.5.1,<0.6" "humanize>=0.5.1"
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = [
|
|
|
|
matrix-synapse-unwrapped
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
boto3
|
|
|
|
humanize
|
|
|
|
tqdm
|
|
|
|
twisted
|
|
|
|
psycopg2
|
|
|
|
]
|
|
|
|
# For the s3_media_upload script
|
|
|
|
++ matrix-synapse-unwrapped.propagatedBuildInputs;
|
|
|
|
|
|
|
|
# Tests need network access
|
2023-08-04 22:07:22 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"s3_storage_provider"
|
|
|
|
];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Synapse storage provider to fetch and store media in Amazon S3";
|
|
|
|
homepage = "https://github.com/matrix-org/synapse-s3-storage-provider";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/matrix-org/synapse-s3-storage-provider/releases/tag/v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ yuka ];
|
|
|
|
};
|
|
|
|
}
|