2021-04-28 19:31:15 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, autoPatchelfHook, fixDarwinDylibNames, zlib, krb5, openssl, icu, nixosTests }:
|
2021-03-29 14:46:01 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
os = if stdenv.isDarwin then "osx" else "linux";
|
|
|
|
arch = {
|
|
|
|
x86_64-linux = "x64";
|
|
|
|
aarch64-linux = "arm64";
|
|
|
|
x86_64-darwin = "x64";
|
|
|
|
}."${stdenv.hostPlatform.system}" or (throw
|
|
|
|
"Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
hash = {
|
2023-05-19 04:40:15 +00:00
|
|
|
x64-linux_hash = "sha256-3gvR82JiWvw+jkF68Xm/UH7OsOPqmDlVwYDaNbNf7Jg=";
|
|
|
|
arm64-linux_hash = "sha256-4ckLs7vwTffB205Pa9BOkw+6PbVOb8tVp8S2D+Ic8fM=";
|
|
|
|
x64-osx_hash = "sha256-by2+rf/pODD7RuxTEeyh1pJ+kGYVmwlVSwxDPgeNzW4=";
|
2021-03-29 14:46:01 +00:00
|
|
|
}."${arch}-${os}_hash";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "ombi";
|
2023-05-19 04:40:15 +00:00
|
|
|
version = "4.39.1";
|
2021-03-29 14:46:01 +00:00
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/Ombi-app/Ombi/releases/download/v${version}/${os}-${arch}.tar.gz";
|
|
|
|
sha256 = hash;
|
|
|
|
};
|
|
|
|
|
2022-03-22 17:59:05 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
|
|
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook
|
2021-04-28 19:31:15 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ stdenv.cc.cc zlib krb5 ];
|
2021-03-29 14:46:01 +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-04-28 19:31:15 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl icu ]} \
|
2022-03-14 18:06:00 +00:00
|
|
|
--chdir "$out/share/${pname}-${version}"
|
2021-03-29 14:46:01 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
2021-03-29 14:51:53 +00:00
|
|
|
tests.smoke-test = nixosTests.ombi;
|
2021-03-29 14:46:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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-06-16 23:40:08 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-03-29 14:46:01 +00:00
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ woky ];
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
|
|
|
};
|
|
|
|
}
|