Unverified Commit fc9273ff authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #249278 from fabaff/matrix-synapse-s3-storage-provider-fix

matrix-synapse.plugins.matrix-synapse-s3-storage-provider: add missin…
parents cfb77410 7e8a5f34
Loading
Loading
Loading
Loading
+33 −8
Original line number Diff line number Diff line
{ lib, buildPythonPackage, fetchFromGitHub, matrix-synapse, twisted, humanize, boto3, tqdm }:
{ lib
, boto3
, buildPythonPackage
, fetchFromGitHub
, humanize
, matrix-synapse-unwrapped
, pythonOlder
, tqdm
, twisted
}:

buildPythonPackage rec {
  pname = "matrix-synapse-s3-storage-provider";
  version = "1.2.1";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "matrix-org";
    repo = "synapse-s3-storage-provider";
    rev = "v${version}";
    sha256 = "sha256-92Xkq54jrUE2I9uVOxI72V9imLNU6K4JqDdOZb+4f+Y=";
    rev = "refs/tags/v${version}";
    hash = "sha256-92Xkq54jrUE2I9uVOxI72V9imLNU6K4JqDdOZb+4f+Y=";
  };

  postPatch = ''
@@ -16,17 +28,30 @@ buildPythonPackage rec {
      --replace "humanize>=0.5.1,<0.6" "humanize>=0.5.1"
  '';

  buildInputs = [
    matrix-synapse-unwrapped
  ];

  propagatedBuildInputs = [
    boto3
    humanize
    tqdm
    twisted
  ]
  # For the s3_media_upload script
  ++ matrix-synapse-unwrapped.propagatedBuildInputs;

  # Tests need network access
  doCheck = false;
  pythonImportsCheck = [ "s3_storage_provider" ];

  buildInputs = [ matrix-synapse ];
  propagatedBuildInputs = [ twisted humanize boto3 tqdm ]
    # for the s3_media_upload script
    ++ matrix-synapse.propagatedBuildInputs;
  pythonImportsCheck = [
    "s3_storage_provider"
  ];

  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";
    changelog = "https://github.com/matrix-org/synapse-s3-storage-provider/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ yuka ];
  };