2021-06-28 23:13:55 +00:00
|
|
|
{ lib, stdenv, fetchurl, kernel, alsa-lib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
bits =
|
2021-12-06 16:07:01 +00:00
|
|
|
if stdenv.is64bit then "64"
|
|
|
|
else "32";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
libpath = makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc alsa-lib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "mwprocapture";
|
2024-04-21 15:54:59 +00:00
|
|
|
subVersion = "4390";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.3.0.${subVersion}-${kernel.version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://www.magewell.com/files/drivers/ProCaptureForLinux_${subVersion}.tar.gz";
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-a2cU7PYQh1KR5eeMhMNx2Sc3HHd7QvCG9+BoJyVPp1Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
preConfigure = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
cd ./src
|
|
|
|
export INSTALL_MOD_PATH="$out"
|
|
|
|
'';
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" "format" ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://www.magewell.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Linux driver for the Magewell Pro Capture family";
|
|
|
|
license = licenses.unfreeRedistributable;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ flexiondotorg ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|