summary refs log tree commit diff
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2022-06-02 18:26:50 -0400
committerDarius Jahandarie <djahandarie@gmail.com>2022-06-02 18:26:50 -0400
commita871c5996b7b162568dfa794c7de3078b249b947 (patch)
tree508affa98a7c958b62cbdb37bb9c4bd362dd9ec5
parent6042a2221e782a51ce2d4b38106e99cbf3b6c937 (diff)
downloadnixpkgs-a871c5996b7b162568dfa794c7de3078b249b947.tar
nixpkgs-a871c5996b7b162568dfa794c7de3078b249b947.tar.gz
nixpkgs-a871c5996b7b162568dfa794c7de3078b249b947.tar.bz2
nixpkgs-a871c5996b7b162568dfa794c7de3078b249b947.tar.lz
nixpkgs-a871c5996b7b162568dfa794c7de3078b249b947.tar.xz
nixpkgs-a871c5996b7b162568dfa794c7de3078b249b947.tar.zst
nixpkgs-a871c5996b7b162568dfa794c7de3078b249b947.zip
mwprocapture: fix compile on new GCC and new linux kernel
-rw-r--r--pkgs/os-specific/linux/mwprocapture/default.nix4
-rw-r--r--pkgs/os-specific/linux/mwprocapture/pci.patch20
2 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/mwprocapture/default.nix b/pkgs/os-specific/linux/mwprocapture/default.nix
index 8a04386a718..10fda92075b 100644
--- a/pkgs/os-specific/linux/mwprocapture/default.nix
+++ b/pkgs/os-specific/linux/mwprocapture/default.nix
@@ -33,6 +33,10 @@ stdenv.mkDerivation rec {
     "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
   ];
 
+  patches = [ ./pci.patch ];
+
+  NIX_CFLAGS_COMPILE="-Wno-error=implicit-fallthrough";
+
   postInstall = ''
     cd ../
     mkdir -p $out/bin
diff --git a/pkgs/os-specific/linux/mwprocapture/pci.patch b/pkgs/os-specific/linux/mwprocapture/pci.patch
new file mode 100644
index 00000000000..b6b22d6143b
--- /dev/null
+++ b/pkgs/os-specific/linux/mwprocapture/pci.patch
@@ -0,0 +1,20 @@
+diff --git a/src/sources/avstream/capture.c b/src/sources/avstream/capture.c
+index f5d256d..a104f62 100644
+--- a/src/sources/avstream/capture.c
++++ b/src/sources/avstream/capture.c
+@@ -288,12 +288,12 @@ static int xi_cap_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+     }
+ 
+     if ((sizeof(dma_addr_t) > 4) &&
+-            !pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
++            !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
+         xi_debug(1, "dma 64 OK!\n");
+     } else {
+         xi_debug(1, "dma 64 not OK!\n");
+-        if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) < 0) &&
+-                (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) < 0) {
++        if ((dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) < 0) &&
++                (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) < 0) {
+             xi_debug(0, "DMA configuration failed\n");
+             goto disable_pci;
+         }