2022-12-26 23:27:19 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitLab
|
|
|
|
, fetchzip
|
|
|
|
, ffmpeg
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
2022-11-30 04:06:11 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "olaris-server";
|
2022-12-26 23:27:19 +00:00
|
|
|
version = "unstable-2022-06-11";
|
2022-11-30 04:06:11 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
2022-12-26 23:27:19 +00:00
|
|
|
owner = "olaris";
|
2022-11-30 04:06:11 +00:00
|
|
|
repo = pname;
|
2022-12-26 23:27:19 +00:00
|
|
|
rev = "bdb2aeb1595c941210249164a97c12404c1ae0d8";
|
|
|
|
hash = "sha256-Uhnh6GC85ORKnfHeYNtbSA40osuscxXDF5/kXJrF2Cs=";
|
2022-11-30 04:06:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preBuild = let
|
|
|
|
olaris-react = fetchzip {
|
|
|
|
url = "https://gitlab.com/api/v4/projects/olaris%2Folaris-react/jobs/artifacts/v${version}/download?job=build";
|
|
|
|
extension = "zip";
|
|
|
|
hash = "sha256-MkxBf/mGvtiOu0e79bMpd9Z/D0eOxhzPE+bKic//viM=";
|
|
|
|
};
|
|
|
|
in ''
|
|
|
|
# cannot build olaris-react https://github.com/NixOS/nixpkgs/issues/203708
|
|
|
|
cp -r ${olaris-react} react/build
|
|
|
|
make generate
|
|
|
|
'';
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X gitlab.com/olaris/olaris-server/helpers.Version=${version}"
|
|
|
|
];
|
|
|
|
|
2022-12-26 23:27:19 +00:00
|
|
|
vendorHash = "sha256-bw8zvDGFBci9bELsxAD0otpNocBnO8aAcgyohLZ3Mv0=";
|
2022-11-30 04:06:11 +00:00
|
|
|
|
2022-12-26 23:27:19 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2022-11-30 04:06:11 +00:00
|
|
|
|
|
|
|
# integration tests require network access
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd olaris-server \
|
|
|
|
--bash <($out/bin/olaris-server completion bash) \
|
|
|
|
--fish <($out/bin/olaris-server completion fish) \
|
|
|
|
--zsh <($out/bin/olaris-server completion zsh)
|
2022-12-26 23:27:19 +00:00
|
|
|
wrapProgram $out/bin/olaris-server --prefix PATH : ${lib.makeBinPath [ffmpeg]}
|
2022-11-30 04:06:11 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Media manager and transcoding server";
|
|
|
|
homepage = "https://gitlab.com/olaris/olaris-server";
|
|
|
|
changelog = "https://gitlab.com/olaris/olaris-server/-/releases/v${version}";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ urandom ];
|
|
|
|
};
|
|
|
|
}
|