diff options
author | swills <swills@FreeBSD.org> | 2011-07-29 09:50:34 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2011-07-29 09:50:34 +0800 |
commit | 9b6eb8e084f3dc7e222517a389e5db34695f355f (patch) | |
tree | e995a8a5a6d9e7b18e635967379f38e701678a0d /sysutils/usbhotkey | |
parent | 966425b7c11efe61486f2e95e98c9401d2e747f1 (diff) | |
download | freebsd-ports-graphics-9b6eb8e084f3dc7e222517a389e5db34695f355f.tar.gz freebsd-ports-graphics-9b6eb8e084f3dc7e222517a389e5db34695f355f.tar.zst freebsd-ports-graphics-9b6eb8e084f3dc7e222517a389e5db34695f355f.zip |
- Fix build with Ruby 1.9
PR: ports/159198
Approved by: Nikos Ntarmos <ntarmos@cs.uoi.gr> (maintainer)
Diffstat (limited to 'sysutils/usbhotkey')
-rw-r--r-- | sysutils/usbhotkey/Makefile | 12 | ||||
-rw-r--r-- | sysutils/usbhotkey/files/extra-patch-main.c | 26 |
2 files changed, 35 insertions, 3 deletions
diff --git a/sysutils/usbhotkey/Makefile b/sysutils/usbhotkey/Makefile index 5fbbf7821c9..11388bbd364 100644 --- a/sysutils/usbhotkey/Makefile +++ b/sysutils/usbhotkey/Makefile @@ -7,7 +7,7 @@ PORTNAME= usbhotkey PORTVERSION= 0.3.1 -PORTREVISION= 5 +PORTREVISION= 5 CATEGORIES= sysutils MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} @@ -26,10 +26,12 @@ HAS_CONFIGURE= yes .include <bsd.port.pre.mk> .if !defined(WITHOUT_PTHREADS) -CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS} -I${LOCALBASE}/include" \ +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS} -I${LOCALBASE}/include \ + -I${LOCALBASE}/include/ruby-${RUBY_VER} -I${LOCALBASE}/include/ruby-${RUBY_VER}/${RUBY_ARCH}" \ LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS} -L${LOCALBASE}/lib" .else -CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \ +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include \ + -I${LOCALBASE}/include/ruby-${RUBY_VER} -I${LOCALBASE}/include/ruby-${RUBY_VER}/${RUBY_ARCH}" \ LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" .endif @@ -39,4 +41,8 @@ LIB_DEPENDS+= Imlib.5:${PORTSDIR}/graphics/imlib CONFIGURE_ARGS+= --without-Imlib .endif +.if ${RUBY_VER} == 1.9 +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-main.c +.endif + .include <bsd.port.post.mk> diff --git a/sysutils/usbhotkey/files/extra-patch-main.c b/sysutils/usbhotkey/files/extra-patch-main.c new file mode 100644 index 00000000000..5b3d4075471 --- /dev/null +++ b/sysutils/usbhotkey/files/extra-patch-main.c @@ -0,0 +1,26 @@ +--- main.c.orig 2011-07-26 02:17:43.000000000 +0000 ++++ main.c 2011-07-26 02:20:01.000000000 +0000 +@@ -167,18 +167,18 @@ + unsigned c; + VALUE lasterr = rb_gv_get("$!"); + VALUE message = rb_obj_as_string(lasterr); +- VALUE ary = rb_funcall( ruby_errinfo, rb_intern("backtrace"), 0); ++ VALUE ary = rb_funcall( rb_errinfo, rb_intern("backtrace"), 0); + +- if( ! strcmp(RSTRING(message)->ptr, "exit")) ++ if( ! strcmp(RSTRING_PTR(message), "exit")) + { + quitMe(1); + return; + } + +- printf( "usbhotkey: %s\n", RSTRING(message)->ptr); ++ printf( "usbhotkey: %s\n", RSTRING_PTR(message)); + printf( "usbhotkey: Backtrace:\n"); +- for( c=0; c<RARRAY(ary)->len; c++) +- printf( "usbhotkey: \tfrom %s\n", RSTRING(RARRAY(ary)->ptr[c])->ptr); ++ for( c=0; c<RARRAY_LEN(ary); c++) ++ printf( "usbhotkey: \tfrom %s\n", RSTRING_PTR(RARRAY_PTR(ary)[c])); + errorHelp( "Error executing start script\n"); + } + } |