aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/cmockery.rb
diff options
context:
space:
mode:
authorRenaud (Nel) Morvan2010-07-23 20:09:34 +0100
committerAdam Vandenberg2010-07-24 20:23:15 -0700
commitac8f668023148442ecd06c27ee2d2b376290e42d (patch)
tree27d29540972707b2b59f027f919b64e8fc7bf78c /Library/Formula/cmockery.rb
parentfe9c418416e92ecc37407ba0a7cfcf9599cd3d72 (diff)
downloadhomebrew-ac8f668023148442ecd06c27ee2d2b376290e42d.tar.bz2
New formula: cmockery
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/cmockery.rb')
-rw-r--r--Library/Formula/cmockery.rb72
1 files changed, 72 insertions, 0 deletions
diff --git a/Library/Formula/cmockery.rb b/Library/Formula/cmockery.rb
new file mode 100644
index 000000000..6a912c4af
--- /dev/null
+++ b/Library/Formula/cmockery.rb
@@ -0,0 +1,72 @@
+require 'formula'
+
+class Cmockery <Formula
+ url 'http://cmockery.googlecode.com/files/cmockery-0.1.2.tar.gz'
+ homepage 'http://code.google.com/p/cmockery/'
+ sha1 '964ed1104a0cbbea8a9a34e88c6e79b546eff1bc'
+
+ def patches
+ # This patch will be integrated upstream in 0.1.3, this is due to malloc.h beeing already in stdlib on OSX
+ # It is safe to remove it on the next version
+ # More info on http://code.google.com/p/cmockery/issues/detail?id=3
+ DATA
+ end
+
+ def install
+ system "./configure", "--prefix=#{prefix}"
+ system "make install"
+ end
+end
+
+__END__
+
+diff -uNr cmockery-0.1.2.orig/src/cmockery.c cmockery-0.1.2/src/cmockery.c
+--- cmockery-0.1.2.orig/src/cmockery.c 2008-08-29 19:55:53.000000000 -0600
++++ cmockery-0.1.2/src/cmockery.c 2009-05-31 15:29:25.000000000 -0600
+@@ -13,7 +13,12 @@
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++#ifdef HAVE_MALLOC_H
+ #include <malloc.h>
++#endif
+ #include <setjmp.h>
+ #ifndef _WIN32
+ #include <signal.h>
+diff -uNr cmockery-0.1.2.orig/src/example/allocate_module.c cmockery-0.1.2/src/example/allocate_module.c
+--- cmockery-0.1.2.orig/src/example/allocate_module.c 2008-08-29 16:23:29.000000000 -0600
++++ cmockery-0.1.2/src/example/allocate_module.c 2009-05-31 15:29:48.000000000 -0600
+@@ -13,7 +13,13 @@
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++#ifdef HAVE_MALLOC_H
+ #include <malloc.h>
++#endif
++#include <sys/types.h>
+
+ #if UNIT_TESTING
+ extern void* _test_malloc(const size_t size, const char* file, const int line);
+diff -uNr cmockery-0.1.2.orig/src/example/calculator.c cmockery-0.1.2/src/example/calculator.c
+--- cmockery-0.1.2.orig/src/example/calculator.c 2008-08-29 16:23:29.000000000 -0600
++++ cmockery-0.1.2/src/example/calculator.c 2009-05-31 15:30:08.000000000 -0600
+@@ -16,8 +16,13 @@
+
+ // A calculator example used to demonstrate the cmockery testing library.
+
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ #include <assert.h>
++#ifdef HAVE_MALLOC_H
+ #include <malloc.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>