2021-01-27 05:24:12 +00:00
|
|
|
{ stdenv, requireFile, fetchpatch, kernel }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "decklink";
|
2021-06-09 21:58:06 +00:00
|
|
|
version = "12.0";
|
2021-01-27 05:24:12 +00:00
|
|
|
|
|
|
|
src = requireFile {
|
2021-06-11 06:22:54 +00:00
|
|
|
name = "Blackmagic_Desktop_Video_Linux_12.1.tar.gz";
|
|
|
|
url = "https://www.blackmagicdesign.com/support/download/d99c3a1740b546f094ffbb30ddf1f4c1";
|
|
|
|
sha256 = "51febf247d22412beea2d637fcc34cc19b1a46df9a5bf0e157d95705bf7c7b73";
|
2021-01-27 05:24:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
|
|
|
INSTALL_MOD_PATH = placeholder "out";
|
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
setSourceRoot = ''
|
2021-06-11 06:22:54 +00:00
|
|
|
tar xf Blackmagic_Desktop_Video_Linux_12.1/other/x86_64/desktopvideo-12.1a9-x86_64.tar.gz
|
|
|
|
sourceRoot=$NIX_BUILD_TOP/desktopvideo-12.1a9-x86_64/usr/src
|
2021-01-27 05:24:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
2021-06-11 06:22:54 +00:00
|
|
|
make -C $sourceRoot/blackmagic-12.1a9 -j$NIX_BUILD_CORES
|
|
|
|
make -C $sourceRoot/blackmagic-io-12.1a9 -j$NIX_BUILD_CORES
|
2021-01-27 05:24:12 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2021-06-11 06:22:54 +00:00
|
|
|
make -C $KERNELDIR M=$sourceRoot/blackmagic-12.1a9 modules_install
|
|
|
|
make -C $KERNELDIR M=$sourceRoot/blackmagic-io-12.1a9 modules_install
|
2021-01-27 05:24:12 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "https://www.blackmagicdesign.com/support/family/capture-and-playback";
|
|
|
|
maintainers = [ maintainers.hexchen ];
|
|
|
|
license = licenses.unfree;
|
|
|
|
description = "Kernel module for the Blackmagic Design Decklink cards";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|