1 { lib, stdenv, fetchurl, kernel, alsa-lib }:
5 if stdenv.is64bit then "64"
8 libpath = lib.makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc alsa-lib ];
11 stdenv.mkDerivation rec {
12 pname = "mwprocapture";
14 version = "1.3.0.${subVersion}-${kernel.version}";
17 url = "https://www.magewell.com/files/drivers/ProCaptureForLinux_${subVersion}.tar.gz";
18 sha256 = "sha256-a2cU7PYQh1KR5eeMhMNx2Sc3HHd7QvCG9+BoJyVPp1Y=";
21 nativeBuildInputs = kernel.moduleBuildDependencies;
25 export INSTALL_MOD_PATH="$out"
28 hardeningDisable = [ "pic" "format" ];
31 "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
34 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
39 cp bin/mwcap-control_${bits} $out/bin/mwcap-control
40 cp bin/mwcap-info_${bits} $out/bin/mwcap-info
41 mkdir -p $out/lib/udev/rules.d
42 # source has a filename typo
43 cp scripts/10-procatpure-event-dev.rules $out/lib/udev/rules.d/10-procapture-event-dev.rules
47 --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
48 --set-rpath "${libpath}" \
49 "$out"/bin/mwcap-control
52 --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
53 --set-rpath "${libpath}" \
58 homepage = "https://www.magewell.com/";
59 description = "Linux driver for the Magewell Pro Capture family";
60 license = licenses.unfreeRedistributable;
61 maintainers = with maintainers; [ flexiondotorg ];
62 platforms = platforms.linux;