From 73ac41146bd325ca0b0e32fc203486e3764215ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Fri, 12 Feb 2021 16:54:50 +0100
Subject: [PATCH 1/8] smenu: format, add SuperSandro2000 as maintainer

---
 pkgs/tools/misc/smenu/default.nix | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/pkgs/tools/misc/smenu/default.nix b/pkgs/tools/misc/smenu/default.nix
index dbfb5fb1cf8..1d1ed78b2fa 100644
--- a/pkgs/tools/misc/smenu/default.nix
+++ b/pkgs/tools/misc/smenu/default.nix
@@ -5,25 +5,24 @@ stdenv.mkDerivation rec {
   pname = "smenu";
 
   src = fetchFromGitHub {
-    owner  = "p-gen";
-    repo   = "smenu";
-    rev    = "v${version}";
+    owner = "p-gen";
+    repo = "smenu";
+    rev = "v${version}";
     sha256 = "1p8y1fgrfb7jxmv5ycvvnqaz7ghdi50paisgzk71169fqwp1crfa";
   };
 
   buildInputs = [ ncurses ];
 
   meta = with lib; {
-    homepage        = "https://github.com/p-gen/smenu";
-    description     = "Terminal selection utility";
+    homepage = "https://github.com/p-gen/smenu";
+    description = "Terminal selection utility";
     longDescription = ''
       Terminal utility that allows you to use words coming from the standard
       input to create a nice selection window just below the cursor. Once done,
       your selection will be sent to standard output.
     '';
-    license     = licenses.gpl2;
-    maintainers = [ maintainers.matthiasbeyer ];
-    platforms   = platforms.unix;
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ matthiasbeyer SuperSandro2000 ];
+    platforms = platforms.unix;
   };
 }
-

From 231ad4ac169c315691de59715b0e51db35fa768a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Fri, 12 Feb 2021 19:43:48 +0100
Subject: [PATCH 2/8] thefuck: Fix tests, add SuperSandro2000 as maintainer

---
 pkgs/tools/misc/thefuck/default.nix | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/pkgs/tools/misc/thefuck/default.nix b/pkgs/tools/misc/thefuck/default.nix
index d26c750a0c7..ff6a22cef8e 100644
--- a/pkgs/tools/misc/thefuck/default.nix
+++ b/pkgs/tools/misc/thefuck/default.nix
@@ -1,6 +1,6 @@
 { lib, fetchFromGitHub, buildPythonApplication
 , colorama, decorator, psutil, pyte, six
-, pytest, pytest-mock
+, go, mock, pytestCheckHook, pytest-mock
 }:
 
 buildPythonApplication rec {
@@ -16,22 +16,12 @@ buildPythonApplication rec {
 
   propagatedBuildInputs = [ colorama decorator psutil pyte six ];
 
-  checkInputs = [ pytest pytest-mock ];
-
-  checkPhase = ''
-    export HOME=$TMPDIR
-    export LANG=en_US.UTF-8
-    export XDG_CACHE_HOME=$TMPDIR/cache
-    export XDG_CONFIG_HOME=$TMPDIR/config
-    py.test
-  '';
-
-  doCheck = false; # The above is only enough for tests to pass outside the sandbox.
+  checkInputs = [ go mock pytestCheckHook pytest-mock ];
 
   meta = with lib; {
     homepage = "https://github.com/nvbn/thefuck";
     description = "Magnificent app which corrects your previous console command";
     license = licenses.mit;
-    maintainers = with maintainers; [ ma27 ];
+    maintainers = with maintainers; [ ma27 SuperSandro2000 ];
   };
 }

From 2e00a2cf5062b11cd89c2247854e76baed2569d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Fri, 12 Feb 2021 20:02:02 +0100
Subject: [PATCH 3/8] pythonPackages.img2pdf: Disable tests

---
 pkgs/development/python-modules/img2pdf/default.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pkgs/development/python-modules/img2pdf/default.nix b/pkgs/development/python-modules/img2pdf/default.nix
index 7e9a6b5daa8..eb8605c45dd 100644
--- a/pkgs/development/python-modules/img2pdf/default.nix
+++ b/pkgs/development/python-modules/img2pdf/default.nix
@@ -15,6 +15,9 @@ buildPythonPackage rec {
     pillow
   ];
 
+  # no tests exectuted
+  doCheck = false;
+
   meta = with lib; {
     description = "Convert images to PDF via direct JPEG inclusion";
     homepage = "https://gitlab.mister-muffin.de/josch/img2pdf";

From 17d71aeacacef2e9784b199f14a6c585115c82c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Fri, 12 Feb 2021 20:13:46 +0100
Subject: [PATCH 4/8] ranger: cleanup stale substituteInPlace

---
 pkgs/applications/misc/ranger/default.nix | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/pkgs/applications/misc/ranger/default.nix b/pkgs/applications/misc/ranger/default.nix
index 619b2ba9955..fe41c6a1e32 100644
--- a/pkgs/applications/misc/ranger/default.nix
+++ b/pkgs/applications/misc/ranger/default.nix
@@ -32,18 +32,12 @@ python3Packages.buildPythonApplication rec {
         ranger/data/scope.sh
     ''}
 
-    substituteInPlace ranger/data/scope.sh \
-      --replace "/bin/echo" "echo"
-
     substituteInPlace ranger/__init__.py \
       --replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin less}/bin/less'"
 
-    for i in ranger/config/rc.conf doc/config/rc.conf ; do
-      substituteInPlace $i --replace /usr/share $out/share
-    done
-
     # give file previews out of the box
     substituteInPlace ranger/config/rc.conf \
+      --replace /usr/share $out/share \
       --replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh"
   '' + optionalString imagePreviewSupport ''
     substituteInPlace ranger/ext/img_display.py \

From b1ce6cffc07892172e4aed1ee79157b317b25842 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Fri, 12 Feb 2021 20:14:03 +0100
Subject: [PATCH 5/8] e2fsprogs: mark broken on darwin

---
 pkgs/tools/filesystems/e2fsprogs/default.nix | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pkgs/tools/filesystems/e2fsprogs/default.nix b/pkgs/tools/filesystems/e2fsprogs/default.nix
index ffe716dceea..154b0006663 100644
--- a/pkgs/tools/filesystems/e2fsprogs/default.nix
+++ b/pkgs/tools/filesystems/e2fsprogs/default.nix
@@ -71,5 +71,7 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2;
     platforms = platforms.unix;
     maintainers = [ maintainers.eelco ];
+    # imager.c:70:2: error: unknown type name 'loff_t'; did you mean 'off_t'?
+    broken = stdenv.isDarwin;
   };
 }

From 5bf5284c21af27cdd870137cf76428f3e0b78a1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Fri, 12 Feb 2021 21:28:22 +0100
Subject: [PATCH 6/8] yosys: mark broken on darwin

---
 pkgs/development/compilers/yosys/default.nix | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pkgs/development/compilers/yosys/default.nix b/pkgs/development/compilers/yosys/default.nix
index 7d2191f8f45..9ac7603ea20 100644
--- a/pkgs/development/compilers/yosys/default.nix
+++ b/pkgs/development/compilers/yosys/default.nix
@@ -103,5 +103,12 @@ stdenv.mkDerivation rec {
     license     = licenses.isc;
     platforms   = platforms.all;
     maintainers = with maintainers; [ shell thoughtpolice emily ];
+    #In file included from kernel/driver.cc:20:
+    #./kernel/yosys.h:42:10: fatal error: 'map' file not found
+    ##include <map>
+
+    #https://github.com/YosysHQ/yosys/issues/681
+    #https://github.com/YosysHQ/yosys/issues/2011
+    broken = stdenv.isDarwin;
   };
 }

From 2a342932d3f9ee8f1f3f452e9567af4f1163516d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Fri, 12 Feb 2021 21:33:52 +0100
Subject: [PATCH 7/8] verilog: Disable tests on darwin

---
 pkgs/applications/science/electronics/verilog/default.nix | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkgs/applications/science/electronics/verilog/default.nix b/pkgs/applications/science/electronics/verilog/default.nix
index dd76e9364c5..4cb8048df67 100644
--- a/pkgs/applications/science/electronics/verilog/default.nix
+++ b/pkgs/applications/science/electronics/verilog/default.nix
@@ -38,7 +38,9 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  doCheck = true;
+  # tests try to access /proc/ which does not exist on darwin
+  # Cannot locate IVL modules : couldn't get command path from OS.
+  doCheck = !stdenv.isDarwin;
 
   installCheckInputs = [ perl ];
 

From 206e998c067ef9fd6c7e28fd8c7d9f504f3d8bb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
Date: Sat, 13 Feb 2021 02:34:26 +0100
Subject: [PATCH 8/8] python3Packages.cocotb: Mark broken on darwin, remove
 stale substituteInPlace

---
 pkgs/development/python-modules/cocotb/default.nix | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/pkgs/development/python-modules/cocotb/default.nix b/pkgs/development/python-modules/cocotb/default.nix
index 9cbf86ab1cf..ec5cbe82776 100644
--- a/pkgs/development/python-modules/cocotb/default.nix
+++ b/pkgs/development/python-modules/cocotb/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildPythonPackage, fetchFromGitHub, setuptools, swig, verilog }:
+{ lib, stdenv, buildPythonPackage, fetchFromGitHub, setuptools, swig, verilog }:
 
 buildPythonPackage rec {
   pname = "cocotb";
@@ -25,9 +25,6 @@ buildPythonPackage rec {
     do
       substituteInPlace $f --replace 'shell which' 'shell command -v'
     done
-
-    # This can perhaps be removed in the next update after 1.3.2?
-    substituteInPlace cocotb/share/makefiles/Makefile.inc --replace "-Werror" ""
   '';
 
   checkInputs = [ swig verilog ];
@@ -36,8 +33,7 @@ buildPythonPackage rec {
     # test expected failures actually pass because of a fix in our icarus version
     # https://github.com/cocotb/cocotb/issues/1952
     substituteInPlace tests/test_cases/test_discovery/test_discovery.py \
-      --replace 'def access_single_bit' $'def foo(x): pass\ndef foo' \
-      --replace 'def access_single_bit_assignment' $'def foo(x): pass\ndef foo'
+      --replace 'def access_single_bit' $'def foo(x): pass\ndef foo'
 
     export PATH=$out/bin:$PATH
     make test
@@ -48,5 +44,6 @@ buildPythonPackage rec {
     homepage = "https://github.com/cocotb/cocotb";
     license = licenses.bsd3;
     maintainers = with maintainers; [ matthuszagh ];
+    broken = stdenv.isDarwin;
   };
 }