From 231c94edfb8b62388f25e95c95e4ec342c4f89ba Mon Sep 17 00:00:00 2001 From: Alejandro Pulver Date: Thu, 3 Aug 2006 23:53:41 +0000 Subject: [PATCH] - Fix building. --- graphics/grx/Makefile | 31 ++++++++++------- .../grx/files/patch-src__include__libgrx.h | 34 +++++++++++++++++++ graphics/grx/pkg-plist | 4 +-- 3 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 graphics/grx/files/patch-src__include__libgrx.h diff --git a/graphics/grx/Makefile b/graphics/grx/Makefile index 6df5b92b2559..b86bbd6f4a5b 100644 --- a/graphics/grx/Makefile +++ b/graphics/grx/Makefile @@ -14,14 +14,11 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/.//g} MAINTAINER= alepulver@FreeBSD.org COMMENT= A 2D graphics library -BROKEN= does not build - USE_GMAKE= yes USE_LDCONFIG= yes -GNU_CONFIGURE= yes -CONFIGURE_ARGS= --with-fontpath=${DATADIR}/fonts -CONFIGURE_TARGET= - +USE_XLIB= yes +HAS_CONFIGURE= yes +CONFIGURE_ARGS= --prefix=${PREFIX} --with-fontpath=${DATADIR}/fonts CPPFLAGS= -I${LOCALBASE}/include LDFLAGS= -L${LOCALBASE}/lib ALL_TARGET= libs @@ -42,8 +39,10 @@ INFO= grx .if defined(WITH_BGI) CONFIGURE_ARGS+=--enable-bgi +PLIST_SUB+= BGI="" .else CONFIGURE_ARGS+=--disable-bgi +PLIST_SUB+= BGI="@comment " .endif .if defined(WITH_BMP) @@ -54,13 +53,17 @@ CONFIGURE_ARGS+=--disable-bmp .if defined(WITH_GPC) RUN_DEPENDS+= gpc:${PORTSDIR}/lang/gpc -PLIST_SUB+= GPC="" +GCC_VER!= cd ${PORTSDIR}/lang/gpc && ${MAKE} -V GCC_VER +GNU_HOST!= cd ${PORTSDIR}/lang/gpc && ${MAKE} -V GNU_HOST +PLIST_SUB+= GPC="" \ + GCC_VER="${GCC_VER}" \ + GNU_HOST="${GNU_HOST}" .else -PLIST_SUB+= GPC="" +PLIST_SUB+= GPC="@comment " .endif .if defined(WITH_JPEG) -LIB_DEPENDS+= jpeg.9${PORTSDIR}/graphics/jpeg +LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg CONFIGURE_ARGS+=--enable-jpeg .else CONFIGURE_ARGS+=--disable-jpeg @@ -82,7 +85,7 @@ PLIST_SUB+= PRINT="@comment " .endif .if defined(WITH_TIFF) -LIB_DEPENDS+= tiff.4${PORTSDIR}/graphics/tiff +LIB_DEPENDS+= tiff.4:${PORTSDIR}/graphics/tiff CONFIGURE_ARGS+=--enable-tiff .else CONFIGURE_ARGS+=--disable-tiff @@ -106,10 +109,12 @@ post-patch: post-install: .if defined(WITH_GPC) - ${INSTALL_DATA} ${WRKSRC}/pascal/grx.pas ${PREFIX}/lib/gpc/units + ${INSTALL_DATA} ${WRKSRC}/pascal/grx.pas \ + ${PREFIX}/lib/gpc/gcc/${GNU_HOST}/${GCC_VER}/units +.if defined(WITH_BGI) + ${INSTALL_DATA} ${WRKSRC}/pascal/bgi/graph.pas \ + ${PREFIX}/lib/gpc/gcc/${GNU_HOST}/${GCC_VER}/units .endif -.if defined(WITH_GPC) && defined(WITH_BGI) - ${INSTALL_DATA} ${WRKSRC}/pascal/bgi/graph.pas ${PREFIX}/lib/gpc/units .endif .include diff --git a/graphics/grx/files/patch-src__include__libgrx.h b/graphics/grx/files/patch-src__include__libgrx.h new file mode 100644 index 000000000000..7edbd856c99f --- /dev/null +++ b/graphics/grx/files/patch-src__include__libgrx.h @@ -0,0 +1,34 @@ +--- src/include/libgrx.h.orig Sun Mar 4 17:45:26 2001 ++++ src/include/libgrx.h Thu Aug 3 20:43:31 2006 +@@ -132,6 +132,9 @@ + /* + ** get system endian + */ ++#include ++ ++#if 0 + #if !defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) + # if defined(__TURBOC__) \ + || defined(__WATCOMC__) \ +@@ -144,7 +147,9 @@ + # include + # endif + #endif ++#endif + ++#if 0 + #if defined(__BYTE_ORDER__) && !defined(BYTE_ORDER) + # define BYTE_ORDER __BYTE_ORDER__ + # define LITTLE_ENDIAN __LITTLE_ENDIAN__ +@@ -163,6 +168,11 @@ + #ifndef BYTE_ORDER + #error Unknown byte ordering ! + #endif ++#endif ++ ++#define BYTE_ORDER _BYTE_ORDER ++#define LITTLE_ENDIAN _LITTLE_ENDIAN ++#define BIG_ENDIAN _BIG_ENDIAN + + #ifndef HARDWARE_BYTE_ORDER + #define HARDWARE_BYTE_ORDER BYTE_ORDER diff --git a/graphics/grx/pkg-plist b/graphics/grx/pkg-plist index 8589765832b1..4f745d9a74aa 100644 --- a/graphics/grx/pkg-plist +++ b/graphics/grx/pkg-plist @@ -5,8 +5,8 @@ include/grx20.h include/grxkeys.h %%PRINT%%include/grxprint.h include/libbcc.h -%%GPC%%%%BGI%%lib/gpc/units/graph.pas -%%GPC%%lib/gpc/units/grx.pas +%%GPC%%%%BGI%%lib/gpc/gcc/%%GNU_HOST%%/%%GCC_VER%%/units/graph.pas +%%GPC%%lib/gpc/gcc/%%GNU_HOST%%/%%GCC_VER%%/units/grx.pas lib/libgrx20X.a lib/libgrx20X.so lib/libgrx20X.so.2