2024-06-05 15:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, libde265
|
|
|
|
, libheif
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "matrix-media-repo";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.3.6";
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "t2bot";
|
|
|
|
repo = "matrix-media-repo";
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-Yrw+6WKHm9Y31YvW5iXnUDhIg0TcSctaouIGhAN4iBo=";
|
2024-06-05 15:53:02 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-fKDdL7C3L33caoXxlutzoND2izB5GH+5qTeojTskIUg=";
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
asset-compiler = buildGoModule {
|
|
|
|
pname = "${pname}-compile_assets";
|
|
|
|
inherit version src vendorHash;
|
|
|
|
|
|
|
|
subPackages = [
|
|
|
|
"cmd/utilities/compile_assets"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
buildGoModule {
|
|
|
|
inherit pname version src vendorHash;
|
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
}
|