matrix-media-repo: init at 1.3.4 (#313195)
This commit is contained in:
parent
c8c07f2c84
commit
a7cc3c6ad3
68
pkgs/by-name/ma/matrix-media-repo/package.nix
Normal file
68
pkgs/by-name/ma/matrix-media-repo/package.nix
Normal file
@ -0,0 +1,68 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, libde265
|
||||
, libheif
|
||||
}:
|
||||
let
|
||||
pname = "matrix-media-repo";
|
||||
version = "1.3.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "t2bot";
|
||||
repo = "matrix-media-repo";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-wC69OiB3HjRs/i46+E1YS+M4zKmvH5vENHyfgU7nt1I=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-STzpKqn47qS0iogVYhFl4QBfKUtnqgxobqv1WaW6UtQ=";
|
||||
|
||||
asset-compiler = buildGoModule {
|
||||
pname = "${pname}-compile_assets";
|
||||
inherit version src vendorHash;
|
||||
|
||||
subPackages = [
|
||||
"cmd/utilities/compile_assets"
|
||||
];
|
||||
};
|
||||
in
|
||||
|
||||
buildGoModule {
|
||||
inherit pname version src vendorHash;
|
||||
|
||||
patches = [
|
||||
./synapse-import-u+x.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
asset-compiler
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libde265
|
||||
libheif
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
compile_assets
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X" "github.com/t2bot/matrix-media-repo/common/version.Version=${version}"
|
||||
];
|
||||
|
||||
doCheck = false; # requires docker
|
||||
|
||||
meta = with lib; {
|
||||
description = "Highly configurable multi-domain media repository for Matrix";
|
||||
homepage = "https://github.com/t2bot/matrix-media-repo";
|
||||
changelog = "https://github.com/t2bot/matrix-media-repo/blob/${src.rev}/CHANGELOG.md";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
mainProgram = "media_repo";
|
||||
};
|
||||
}
|
22
pkgs/by-name/ma/matrix-media-repo/synapse-import-u+x.patch
Normal file
22
pkgs/by-name/ma/matrix-media-repo/synapse-import-u+x.patch
Normal file
@ -0,0 +1,22 @@
|
||||
diff --git a/cmd/homeserver_offline_exporters/import_to_synapse/main.go b/cmd/homeserver_offline_exporters/import_to_synapse/main.go
|
||||
index 3c7db1e..c6cba4f 100644
|
||||
--- a/cmd/homeserver_offline_exporters/import_to_synapse/main.go
|
||||
+++ b/cmd/homeserver_offline_exporters/import_to_synapse/main.go
|
||||
@@ -78,7 +78,7 @@ func main() {
|
||||
|
||||
ctx.Log.Infof("Copying %s", mxc)
|
||||
directories := path.Join(cfg.ExportPath, "local_content", record.MediaId[0:2], record.MediaId[2:4])
|
||||
- err = os.MkdirAll(directories, 0655)
|
||||
+ err = os.MkdirAll(directories, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -134,7 +134,7 @@ func main() {
|
||||
dirLock.Lock()
|
||||
defer dirLock.Unlock()
|
||||
thumbDir := path.Join(cfg.ExportPath, "local_thumbnails", record.MediaId[0:2], record.MediaId[2:4], record.MediaId[4:])
|
||||
- err = os.MkdirAll(thumbDir, 0655)
|
||||
+ err = os.MkdirAll(thumbDir, 0755)
|
||||
if err != nil {
|
||||
ctx.Log.Warn("Error creating thumbnail directories. ", s, err)
|
||||
return
|
Loading…
Reference in New Issue
Block a user