2021-06-10 04:57:09 +02:00
|
|
|
{ lib, stdenv, fetchurl, kernel, alsa-lib }:
|
2017-02-18 15:44:31 +01:00
|
|
|
|
2021-01-15 15:45:37 +01:00
|
|
|
with lib;
|
2017-09-04 03:50:09 +02:00
|
|
|
|
2017-02-18 15:44:31 +01:00
|
|
|
let
|
|
|
|
bits =
|
2021-11-09 16:09:14 +01:00
|
|
|
if stdenv.is64bit then "64"
|
|
|
|
else "32";
|
2017-02-18 15:44:31 +01:00
|
|
|
|
2021-06-10 04:57:09 +02:00
|
|
|
libpath = makeLibraryPath [ stdenv.cc.cc stdenv.glibc alsa-lib ];
|
2017-02-18 15:44:31 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-11-09 16:09:14 +01:00
|
|
|
pname = "mwprocapture";
|
|
|
|
subVersion = "4236";
|
|
|
|
version = "1.3.0.${subVersion}-${kernel.version}";
|
2017-02-18 15:44:31 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-11-09 16:09:14 +01:00
|
|
|
url = "https://www.magewell.com/files/drivers/ProCaptureForLinux_${subVersion}.tar.gz";
|
2021-06-06 01:56:23 +02:00
|
|
|
sha256 = "1mfgj84km276sq5i8dny1vqp2ycqpvgplrmpbqwnk230d0w3qs74";
|
2017-02-18 15:44:31 +01:00
|
|
|
};
|
|
|
|
|
2021-06-06 01:56:23 +02:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
2018-01-02 01:01:44 +01:00
|
|
|
|
2021-11-09 16:09:14 +01:00
|
|
|
preConfigure = ''
|
2017-02-18 15:44:31 +01:00
|
|
|
cd ./src
|
|
|
|
export INSTALL_MOD_PATH="$out"
|
|
|
|
'';
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" "format" ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cd ../
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/mwcap-control_${bits} $out/bin/mwcap-control
|
|
|
|
cp bin/mwcap-info_${bits} $out/bin/mwcap-info
|
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
# source has a filename typo
|
|
|
|
cp scripts/10-procatpure-event-dev.rules $out/lib/udev/rules.d/10-procapture-event-dev.rules
|
|
|
|
cp -r src/res $out
|
|
|
|
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
|
|
--set-rpath "${libpath}" \
|
|
|
|
"$out"/bin/mwcap-control
|
|
|
|
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
|
|
--set-rpath "${libpath}" \
|
|
|
|
"$out"/bin/mwcap-info
|
|
|
|
'';
|
|
|
|
|
2017-09-04 03:50:09 +02:00
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.magewell.com/";
|
2017-02-18 15:44:31 +01:00
|
|
|
description = "Linux driver for the Magewell Pro Capture family";
|
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
maintainers = with maintainers; [ MP2E ];
|
|
|
|
platforms = platforms.linux;
|
2021-06-06 01:56:23 +02:00
|
|
|
broken = kernel.kernelOlder "3.2.0";
|
2017-02-18 15:44:31 +01:00
|
|
|
};
|
|
|
|
}
|