depot/third_party/nixpkgs/pkgs/by-name/ma/matrix-media-repo/package.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

68 lines
1.3 KiB
Nix

{ 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";
};
}