diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix b/nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix new file mode 100644 index 000000000000..f6f6c10112a7 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix @@ -0,0 +1,67 @@ +{ stdenv, fetchurl, kernel, alsaLib }: + +with stdenv.lib; + +# The Magewell Pro Capture drivers are not supported for kernels older than 3.2 +assert versionAtLeast kernel.version "3.2.0"; + +let + bits = + if stdenv.is64bit then "64" + else "32"; + + libpath = makeLibraryPath [ stdenv.cc.cc stdenv.glibc alsaLib ]; + +in +stdenv.mkDerivation rec { + name = "mwprocapture-1.2.${version}-${kernel.version}"; + version = "3950"; + + src = fetchurl { + url = "http://www.magewell.com/files/drivers/ProCaptureForLinux_${version}.tar.gz"; + sha256 = "1im3k533r6c0dx08h9wjfbhadzk7zawrxxaz7v94c92m3q133ys6"; + }; + + nativeBuildInputs = [ kernel.moduleBuildDependencies ]; + + preConfigure = + '' + 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 + ''; + + meta = { + homepage = http://www.magewell.com/; + description = "Linux driver for the Magewell Pro Capture family"; + license = licenses.unfreeRedistributable; + maintainers = with maintainers; [ MP2E ]; + platforms = platforms.linux; + }; +} |