about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/tools/misc/pmccabe/default.nix6
-rw-r--r--pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch15
2 files changed, 20 insertions, 1 deletions
diff --git a/pkgs/development/tools/misc/pmccabe/default.nix b/pkgs/development/tools/misc/pmccabe/default.nix
index 77066cfc8e15..fbb21a8b7c65 100644
--- a/pkgs/development/tools/misc/pmccabe/default.nix
+++ b/pkgs/development/tools/misc/pmccabe/default.nix
@@ -9,6 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0a3h1b9fb87c82d5fbql5lc4gp338pa5s9i66dhw7zk8jdygx474";
   };
 
+  patches = [
+    ./getopt_on_darwin.patch
+  ];
+
   configurePhase = ''
     sed -i -r Makefile \
       -e 's,/usr/,/,g' \
@@ -38,7 +42,7 @@ stdenv.mkDerivation rec {
       trees or files; and vifn, to invoke vi given a function name rather
       than a file name.
     '';
-    platforms = platforms.linux;
     maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch b/pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch
new file mode 100644
index 000000000000..534d6c1d6ef7
--- /dev/null
+++ b/pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch
@@ -0,0 +1,15 @@
+diff --git a/decomment.c b/decomment.c
+index 400707a..aea29fd 100644
+--- a/decomment.c
++++ b/decomment.c
+@@ -11,6 +11,10 @@
+ #include "getopt.h"
+ #endif
+ 
++#ifdef __APPLE__
++#include "getopt.h"
++#endif
++
+ #ifdef NEED_OPTIND
+ extern int optind;
+ #endif