about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/cproto
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc/cproto')
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cproto/cproto.patch11
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cproto/default.nix34
2 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/cproto/cproto.patch b/nixpkgs/pkgs/development/tools/misc/cproto/cproto.patch
new file mode 100644
index 000000000000..3743fef977b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cproto/cproto.patch
@@ -0,0 +1,11 @@
+diff -Naur cproto-4.6-old/cproto.h cproto-4.6/cproto.h
+--- cproto-4.6-old/cproto.h	1998-01-18 19:49:16.000000000 -0500
++++ cproto-4.6/cproto.h	2004-03-14 00:02:32.148070032 -0500
+@@ -117,6 +117,7 @@
+     Declarator *declarator;
+     DeclaratorList decl_list;
+ } YYSTYPE;
++#define YYSTYPE_IS_DECLARED 1
+ 
+ /* Prototype styles */
+ #if OPT_LINTLIBRARY
diff --git a/nixpkgs/pkgs/development/tools/misc/cproto/default.nix b/nixpkgs/pkgs/development/tools/misc/cproto/default.nix
new file mode 100644
index 000000000000..84890f166235
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cproto/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, flex, bison }:
+
+stdenv.mkDerivation rec {
+  pname = "cproto";
+  version = "4.7r";
+
+  src = fetchurl {
+    urls = [
+      "mirror://debian/pool/main/c/cproto/cproto_${version}.orig.tar.gz"
+      # No version listings and apparently no versioned tarball over http(s).
+      "ftp://ftp.invisible-island.net/cproto/cproto-${version}.tgz"
+    ];
+    sha256 = "sha256-bgRg2yVZXHobUz8AUaV4ZKBkp2KjP+2oXbDXmPTUX8U=";
+  };
+
+  # patch made by Joe Khoobyar copied from gentoo bugs
+  patches = [ ./cproto.patch ];
+
+  nativeBuildInputs = [ flex bison ];
+
+  doCheck = true;
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    [ "$("$out/bin/cproto" -V 2>&1)" = '${version}' ]
+  '';
+
+  meta = with lib; {
+    description = "Tool to generate C function prototypes from C source code";
+    homepage = "https://invisible-island.net/cproto/";
+    license = licenses.publicDomain;
+    platforms = platforms.all;
+  };
+}