summary refs log tree commit diff
path: root/pkgs/os-specific/linux/mwprocapture
diff options
context:
space:
mode:
authorCray Elliott <MP2E@archlinux.us>2017-05-03 00:05:08 -0700
committerCray Elliott <MP2E@archlinux.us>2017-05-03 00:11:22 -0700
commitcebce78be926f936ac3bd3a9f813c961b5d2d4a4 (patch)
tree0cfc5acac51848c28bec416cb9751b19afb517e2 /pkgs/os-specific/linux/mwprocapture
parenta6175a477cee80ae0dafeecc10fef2f200644de4 (diff)
downloadnixpkgs-cebce78be926f936ac3bd3a9f813c961b5d2d4a4.tar
nixpkgs-cebce78be926f936ac3bd3a9f813c961b5d2d4a4.tar.gz
nixpkgs-cebce78be926f936ac3bd3a9f813c961b5d2d4a4.tar.bz2
nixpkgs-cebce78be926f936ac3bd3a9f813c961b5d2d4a4.tar.lz
nixpkgs-cebce78be926f936ac3bd3a9f813c961b5d2d4a4.tar.xz
nixpkgs-cebce78be926f936ac3bd3a9f813c961b5d2d4a4.tar.zst
nixpkgs-cebce78be926f936ac3bd3a9f813c961b5d2d4a4.zip
mwprocapture: fix compile on linux 4.11
Diffstat (limited to 'pkgs/os-specific/linux/mwprocapture')
-rw-r--r--pkgs/os-specific/linux/mwprocapture/default.nix2
-rw-r--r--pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch30
2 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/mwprocapture/default.nix b/pkgs/os-specific/linux/mwprocapture/default.nix
index f09e9543c48..bed40fd02e4 100644
--- a/pkgs/os-specific/linux/mwprocapture/default.nix
+++ b/pkgs/os-specific/linux/mwprocapture/default.nix
@@ -23,6 +23,8 @@ stdenv.mkDerivation rec {
     sha256 = "0i1y50mf559flhxgaxy2gdpa7dvpp12ix9xfzgxa61rc135x0im4";
   };
 
+  patches = [ ./linux_4_11_include_fix.patch ];
+
   preConfigure =
   ''
     cd ./src
diff --git a/pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch b/pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch
new file mode 100644
index 00000000000..726efd9f537
--- /dev/null
+++ b/pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch
@@ -0,0 +1,30 @@
+diff -Naur ProCaptureForLinux_3269/src/sources/avstream/capture.c ProCaptureForLinux_3269_new/src/sources/avstream/capture.c
+--- ProCaptureForLinux_3269/src/sources/avstream/capture.c	2016-12-12 17:17:18.000000000 -0800
++++ ProCaptureForLinux_3269_new/src/sources/avstream/capture.c	2017-05-02 23:58:28.270827491 -0700
+@@ -154,7 +154,9 @@
+     if (IS_ERR_OR_NULL(fp))
+         return IS_ERR(fp) ? PTR_ERR(fp) : -1;
+
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++    ret = vfs_getattr(&fp->f_path, &stat, STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
+     ret = vfs_getattr(&fp->f_path, &stat);
+ #else
+     ret = vfs_getattr(fp->f_path.mnt, fp->f_path.dentry, &stat);
+diff -Naur ProCaptureForLinux_3269/src/sources/ospi/ospi-linux.c ProCaptureForLinux_3269_new/src/sources/ospi/ospi-linux.c
+--- ProCaptureForLinux_3269/src/sources/ospi/ospi-linux.c	2016-12-12 17:17:18.000000000 -0800
++++ ProCaptureForLinux_3269_new/src/sources/ospi/ospi-linux.c	2017-05-02 23:51:02.197633628 -0700
+@@ -21,6 +21,12 @@
+ #include <linux/freezer.h>
+ #include <linux/pci.h>
+
++// some functions were moved from linux/sched.h out to their own headers in 4.11.x
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#include <linux/sched/signal.h>
++#include <linux/sched/debug.h>
++#endif
++
+ unsigned int debug_level = 0;
+
+ struct kmem_cache *g_spin_cache = NULL;