2022-07-15 16:38:59 +00:00
|
|
|
{ lib, stdenv, requireFile, avahi, obs-studio-plugins }:
|
2019-11-18 09:15:52 +00:00
|
|
|
|
2022-07-15 16:38:59 +00:00
|
|
|
let
|
2023-05-05 19:39:20 +00:00
|
|
|
versionJSON = lib.importJSON ./version.json;
|
2022-07-15 16:38:59 +00:00
|
|
|
in
|
2019-11-18 09:15:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ndi";
|
2022-07-15 16:38:59 +00:00
|
|
|
version = versionJSON.version;
|
|
|
|
majorVersion = builtins.head (builtins.splitVersion version);
|
|
|
|
installerName = "Install_NDI_SDK_v${majorVersion}_Linux";
|
2019-11-18 09:15:52 +00:00
|
|
|
|
|
|
|
src = requireFile rec {
|
2022-07-15 16:38:59 +00:00
|
|
|
name = "${installerName}.tar.gz";
|
|
|
|
sha256 = versionJSON.hash;
|
2019-11-18 09:15:52 +00:00
|
|
|
message = ''
|
2022-07-15 16:38:59 +00:00
|
|
|
In order to use NDI SDK version ${version}, you need to comply with
|
2020-03-13 11:37:15 +00:00
|
|
|
NewTek's license and download the appropriate Linux tarball from:
|
2019-11-18 09:15:52 +00:00
|
|
|
|
2020-03-13 11:37:15 +00:00
|
|
|
${meta.homepage}
|
2019-11-18 09:15:52 +00:00
|
|
|
|
|
|
|
Once you have downloaded the file, please use the following command and
|
|
|
|
re-run the installation:
|
|
|
|
|
2020-03-13 11:37:15 +00:00
|
|
|
\$ nix-prefetch-url file://\$PWD/${name}
|
2019-11-18 09:15:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ avahi ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
2023-06-11 20:11:45 +00:00
|
|
|
unpackFile $src
|
2022-07-15 16:38:59 +00:00
|
|
|
echo y | ./${installerName}.sh
|
2019-11-18 09:15:52 +00:00
|
|
|
sourceRoot="NDI SDK for Linux";
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
mv bin/x86_64-linux-gnu $out/bin
|
|
|
|
for i in $out/bin/*; do
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$i"
|
|
|
|
done
|
|
|
|
patchelf --set-rpath "${avahi}/lib:${stdenv.cc.libc}/lib" $out/bin/ndi-record
|
|
|
|
mv lib/x86_64-linux-gnu $out/lib
|
|
|
|
for i in $out/lib/*; do
|
|
|
|
if [ -L "$i" ]; then continue; fi
|
|
|
|
patchelf --set-rpath "${avahi}/lib:${stdenv.cc.libc}/lib" "$i"
|
|
|
|
done
|
|
|
|
mv include examples $out/
|
|
|
|
mkdir -p $out/share/doc/${pname}-${version}
|
|
|
|
mv licenses $out/share/doc/${pname}-${version}/licenses
|
|
|
|
mv logos $out/share/doc/${pname}-${version}/logos
|
|
|
|
mv documentation/* $out/share/doc/${pname}-${version}/
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Stripping breaks ndi-record.
|
|
|
|
dontStrip = true;
|
|
|
|
|
2022-07-15 16:38:59 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (obs-studio-plugins) obs-ndi;
|
|
|
|
};
|
|
|
|
passthru.updateScript = ./update.py;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-11-18 09:15:52 +00:00
|
|
|
homepage = "https://ndi.tv/sdk/";
|
|
|
|
description = "NDI Software Developer Kit";
|
|
|
|
platforms = ["x86_64-linux"];
|
|
|
|
hydraPlatforms = [];
|
2022-06-16 22:11:43 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2019-11-18 09:15:52 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
};
|
|
|
|
}
|