···1+{ stdenv, fetchurl, kernel, alsaLib }:
2+3+# The Magewell Pro Capture drivers are not supported for kernels older than 3.2
4+assert stdenv.lib.versionAtLeast kernel.version "3.2.0";
5+6+# this package currently only supports x86 and x86_64, as I have no ARM device to test on
7+assert (stdenv.system == "x86_64-linux") || (stdenv.system == "i686-linux");
8+9+let
10+ bits =
11+ if stdenv.is64bit then "64"
12+ else "32";
13+14+ libpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc stdenv.glibc alsaLib ];
15+16+in
17+stdenv.mkDerivation rec {
18+ name = "mwprocapture-1.2.${version}-${kernel.version}";
19+ version = "3269";
20+21+ src = fetchurl {
22+ url = "http://www.magewell.com/files/ProCaptureForLinux_${version}.tar.gz";
23+ sha256 = "0i1y50mf559flhxgaxy2gdpa7dvpp12ix9xfzgxa61rc135x0im4";
24+ };
25+26+ preConfigure =
27+ ''
28+ cd ./src
29+ export INSTALL_MOD_PATH="$out"
30+ '';
31+32+ hardeningDisable = [ "pic" "format" ];
33+34+ makeFlags = [
35+ "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
36+ ];
37+38+ postInstall = ''
39+ cd ../
40+ mkdir -p $out/bin
41+ cp bin/mwcap-control_${bits} $out/bin/mwcap-control
42+ cp bin/mwcap-info_${bits} $out/bin/mwcap-info
43+ mkdir -p $out/lib/udev/rules.d
44+ # source has a filename typo
45+ cp scripts/10-procatpure-event-dev.rules $out/lib/udev/rules.d/10-procapture-event-dev.rules
46+ cp -r src/res $out
47+48+ patchelf \
49+ --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
50+ --set-rpath "${libpath}" \
51+ "$out"/bin/mwcap-control
52+53+ patchelf \
54+ --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
55+ --set-rpath "${libpath}" \
56+ "$out"/bin/mwcap-info
57+ '';
58+59+ meta = with stdenv.lib; {
60+ homepage = http://www.magewell.com/;
61+ description = "Linux driver for the Magewell Pro Capture family";
62+ license = licenses.unfreeRedistributable;
63+ maintainers = with maintainers; [ MP2E ];
64+ platforms = platforms.linux;
65+ };
66+}
+2
pkgs/top-level/all-packages.nix
···1142511426 mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { };
114270011428 mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };
1142911430 /* compiles but has to be integrated into the kernel somehow
···1142511426 mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { };
1142711428+ mwprocapture = callPackage ../os-specific/linux/mwprocapture { };
11429+11430 mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };
1143111432 /* compiles but has to be integrated into the kernel somehow