2021-05-03 20:48:10 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, autoPatchelfHook, fixDarwinDylibNames, zlib, krb5, openssl, icu, nixosTests }:
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
let
|
2024-09-26 11:04:55 +00:00
|
|
|
os = if stdenv.hostPlatform.isDarwin then "osx" else "linux";
|
2021-04-05 15:23:46 +00:00
|
|
|
arch = {
|
|
|
|
x86_64-linux = "x64";
|
|
|
|
aarch64-linux = "arm64";
|
|
|
|
x86_64-darwin = "x64";
|
|
|
|
}."${stdenv.hostPlatform.system}" or (throw
|
|
|
|
"Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
hash = {
|
2024-09-19 14:19:46 +00:00
|
|
|
x64-linux_hash = "sha256-wyGvTXsXSsfTrlWVBaqbeDhj5s6w31+Ixi0sxsHcOjA=";
|
|
|
|
arm64-linux_hash = "sha256-iqgyCNY62FBIyjcHXDk1zZY0RzFhUA5IQ8EDzAonKRE=";
|
|
|
|
x64-osx_hash = "sha256-h9qKe1GL2DSBAFhtztS254ILMCeIZqlCXyO0AvSA5Zo=";
|
2021-04-05 15:23:46 +00:00
|
|
|
}."${arch}-${os}_hash";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "ombi";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "4.44.1";
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/Ombi-app/Ombi/releases/download/v${version}/${os}-${arch}.tar.gz";
|
|
|
|
sha256 = hash;
|
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
|
|
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook
|
2021-05-03 20:48:10 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ stdenv.cc.cc zlib krb5 ];
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,share/${pname}-${version}}
|
|
|
|
cp -r * $out/share/${pname}-${version}
|
|
|
|
|
|
|
|
makeWrapper $out/share/${pname}-${version}/Ombi $out/bin/Ombi \
|
2021-05-03 20:48:10 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl icu ]} \
|
2022-04-27 09:35:20 +00:00
|
|
|
--chdir "$out/share/${pname}-${version}"
|
2021-04-05 15:23:46 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
tests.smoke-test = nixosTests.ombi;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Self-hosted web application that automatically gives your shared Plex or Emby users the ability to request content by themselves";
|
|
|
|
homepage = "https://ombi.io/";
|
2022-07-14 12:49:19 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-04-05 15:23:46 +00:00
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ woky ];
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "Ombi";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
}
|