1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-30 05:40:06 +00:00

- Add QT frontend support

- Add support for Type1 fonts via T1 library
- Add NLS support (French localization)
- Fix GCC 4.1 compatiblity
- Fix comment
- Add OPTIONS
- Enable builds with optimized CFLAGS
- Fix patchname to make portlint happy
- Pass maintainership to submitter

Added file(s):
- files/patch-Makefile.in
- files/patch-src_graph_graphqtdlg.h
- files/patch-src_graph_graphunixx11.c
- files/patch-src_include_global.h

Removed file(s):
- files/patch-src::graph::graphunixx11.c

PR:		ports/100285
Submitted by:	Stanislav Sedov <ssedov@mbsd.msk.ru>
This commit is contained in:
Ion-Mihai Tetcu 2006-07-14 21:53:59 +00:00
parent 604b199874
commit 846a9729bd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=167833
6 changed files with 198 additions and 30 deletions

View File

@ -12,12 +12,40 @@ MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME= ${PORTNAME}-${PORTVERSION:C/^(...)\./\1/}
MAINTAINER= ports@FreeBSD.org
COMMENT= A Sophisticated electrical CAD system
MAINTAINER= ssedov@mbsd.msk.ru
COMMENT= A sophisticated electrical CAD system
USE_MOTIF= yes
GNU_CONFIGURE= yes
OPTIONS= QT "Use QT gui (instead of Motif)" off \
T1LIB "Use T1lib Type1 font library" on \
NLS "Build with internationalization support" on \
OPT "Build with optimized CFLAGS" off
.include <bsd.port.pre.mk>
.if defined(WITH_QT)
LIB_DEPENDS+= qt-mt:${PORTSDIR}/x11-toolkits/qt33
FEATURES+= QT
.else
USE_MOTIF= yes
FEATURES+= MOTIF
.endif
.if !defined(WITHOUT_T1LIB)
LIB_DEPENDS+= t1.5:${PORTSDIR}/devel/t1lib
FEATURES+= T1LIB
.endif
.if !defined(WITHOUT_NLS)
USE_GETTEXT= yes
FEATURES+= INT
.endif
.if defined(WITH_OPT)
FEATURES+= OPT
.endif
post-patch:
@${REINPLACE_CMD} -e 's|/usr/share/electric/lib/|${DATADIR}/lib/|; \
s|/usr/share/electric/doc/|${DOCSDIR}/|; \
@ -26,11 +54,15 @@ post-patch:
${WRKSRC}/src/include/config.h
@${REINPLACE_CMD} -e 's|/usr/share/electric/lib|${DATADIR}/lib|; \
s|/usr/share/electric/doc|${DOCSDIR}|; \
s|%%LOCALBASE%%|${LOCALBASE}|g; \
s|@PTHREAD_LIBS@|${PTHREAD_LIBS:S/"//g}|' \
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|/usr/X11R6/|${X11BASE}/|' ${WRKSRC}/configure
.for FEATURE in ${FEATURES}
@${REINPLACE_CMD} -e 's|#%%${FEATURE}%%||g' ${WRKSRC}/Makefile.in
.endfor
post-install:
${STRIP_CMD} ${PREFIX}/bin/electric
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View File

@ -0,0 +1,90 @@
--- Makefile.in.orig Fri Jul 16 05:59:50 2004
+++ Makefile.in Fri Jul 14 13:19:06 2006
@@ -1,14 +1,14 @@
########################################################## USING QT
##### If using Qt, uncomment these five lines
-# GRAPH_FLAGS = -DUSEQT -DQT_THREAD_SUPPORT -I$(QTDIR)/include $(QUI_CFLAGS)
-# GRAPH_LIBS = -L$(QTDIR)/lib $(QUI_LIBS) $(QT_LIB_EXTRAS)
-# GRAPH_OBJS = $(GRAPH_OBJS_QT)
-# GRAPH_SRC = $(GRAPH_SRC_QT)
-# CCOMPILER = @CXX@
+#%%QT%% GRAPH_FLAGS = -DUSEQT `pkg-config --cflags qt-mt` $(QUI_CFLAGS)
+#%%QT%% GRAPH_LIBS = -L$(QTDIR)/lib $(QUI_LIBS) $(QT_LIB_EXTRAS)
+#%%QT%% GRAPH_OBJS = $(GRAPH_OBJS_QT)
+#%%QT%% GRAPH_SRC = $(GRAPH_SRC_QT)
+#%%QT%% CCOMPILER = @CXX@
##### Qt on UNIX/Linux: uncomment the next two lines:
ELECTRIC_TARGET = electric-target-unix
-QT_LIB_EXTRAS = -lqt-mt -lX11
+QT_LIB_EXTRAS = `pkg-config --libs qt-mt`
##### Qt on Macintosh: uncomment the next two lines (for Qt Evaluation, change "-lqt" to "-lqt-mt"):
# ELECTRIC_TARGET = electric-target-mac
@@ -20,11 +20,11 @@
########################################################### USING MOTIF
##### If using Motif (or OpenMotif/Lesstif), uncomment these five lines
-GRAPH_FLAGS = @X_CFLAGS@
-GRAPH_LIBS = -lXm @XMULIB@ -lXt @XPLIB@ @XEXTLIB@ -lX11
-GRAPH_OBJS = $(GRAPH_OBJS_XT)
-GRAPH_SRC = $(GRAPH_SRC_XT)
-CCOMPILER = @PTHREAD_CC@
+#%%MOTIF%% GRAPH_FLAGS = @X_CFLAGS@
+#%%MOTIF%% GRAPH_LIBS = -lXm @XMULIB@ -lXt @XPLIB@ @XEXTLIB@ -lX11
+#%%MOTIF%% GRAPH_OBJS = $(GRAPH_OBJS_XT)
+#%%MOTIF%% GRAPH_SRC = $(GRAPH_SRC_XT)
+#%%MOTIF%% CCOMPILER = @PTHREAD_CC@
##### For the general-purpose X facility, uncomment this line
XPOWER = -DANYDEPTH
@@ -32,8 +32,8 @@
# XPOWER =
##### For the T1lib TrueType, uncomment these two lines and set them to the proper location
-# TRUETYPE_LIBS = /usr/local/lib/libt1.a
-# TRUETYPECFLAGS = -DTRUETYPE -I/usr/local/include
+#%%T1LIB%% TRUETYPE_LIBS = -L%%LOCALBASE%%/lib -lt1
+#%%T1LIB%% TRUETYPECFLAGS = -DTRUETYPE -I%%LOCALBASE%%/include
###########################################################
@@ -61,8 +61,8 @@
########################################################### TCL INTERPRETER
##### If building with a TCL interpreter, uncomment these two lines
-# LANGTCLCFLAGS = -DFORCETCL=1
-# LANGTCLLIBS = -ltcl
+#%%TCL%% LANGTCLCFLAGS = -DFORCETCL=1
+#%%TCL%% LANGTCLLIBS = -ltcl
###########################################################
@@ -164,7 +164,8 @@
########################################################### MISCELLANEOUS EXTRAS
##### If building with Internationalization, uncomment this line
-# INTERNATIONALCFLAGS = -DINTERNATIONAL
+#%%INT%% INTERNATIONALCFLAGS = -DINTERNATIONAL -I%%LOCALBASE%%/include
+#%%INT%% INTERNATIONALLIBS = -L%%LOCALBASE%%/lib -lintl
##### If building with Unicode text, uncomment this line
# UNICODECFLAGS = -D_UNICODE
@@ -179,7 +180,7 @@
# FORTECFLAGS = -compat
##### If optimizing, uncomment this line (modify optimizations to taste)
-# OPTIMIZE = -O3
+#%%OPT%% OPTIMIZE = -O3 -ffast-math -fomit-frame-pointer
##### If debugging, uncomment this line (modify debug options to taste)
# DEBUG = -g3
@@ -801,7 +802,7 @@
$(CADENCECFLAGS) $(SUNCFLAGS) $(INTERNATIONALCFLAGS) $(UNICODECFLAGS) @PTHREAD_CFLAGS@
XCFLAGS = $(CFLAGS) $(XPOWER) $(TRUETYPECFLAGS) $(QT_CFLAGS)
LIBS = @X_PRE_LIBS@ @X_LIBS@ $(TRUETYPE_LIBS) $(FSDB_LIBS) $(GRAPH_LIBS) -lm @X_EXTRA_LIBS@ \
- $(LANGTCLLIBS) $(LANGJAVALIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
+ $(LANGTCLLIBS) $(LANGJAVALIBS) $(INTERNATIONALLIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
FIND = find
INSTALL = install
DESTDIR =

View File

@ -1,26 +0,0 @@
--- src/graph/graphunixx11.c.orig Fri Jun 14 20:01:11 2002
+++ src/graph/graphunixx11.c Thu Sep 19 23:30:14 2002
@@ -149,6 +149,8 @@
INTBIG gra_initializetcl(void);
#endif
+#include <sys/sysctl.h>
+
/****** windows ******/
#define WMLEFTBORDER 8 /* size of left border for windows */
@@ -2889,8 +2891,13 @@
INTBIG enumprocessors(void)
{
INTBIG numproc;
+ size_t proclen;
+
+ proclen = sizeof(numproc);
+ if ((sysctlbyname("hw.ncpu", &numproc, &proclen, NULL, 0) < 0) ||
+ (proclen != sizeof(numproc)))
+ numproc = 1;
- numproc = sysconf(_SC_NPROCESSORS_ONLN);
return(numproc);
}

View File

@ -0,0 +1,10 @@
--- src/graph/graphqtdlg.h.orig Fri Jul 14 00:33:51 2006
+++ src/graph/graphqtdlg.h Fri Jul 14 00:34:01 2006
@@ -59,6 +59,7 @@
class QSignalMapper;
class EScrollField;
class EDialogPrivate;
+class EDialog;
class EDialogPrivate: public QDialog
{

View File

@ -0,0 +1,51 @@
--- src/graph/graphunixx11.c.orig Fri Jul 16 05:59:53 2004
+++ src/graph/graphunixx11.c Fri Jul 14 01:11:20 2006
@@ -167,6 +167,8 @@
#define TRUESTRLEN strlen
+#include <sys/sysctl.h>
+
/****** windows ******/
#define WMLEFTBORDER 8 /* size of left border for windows */
@@ -1518,13 +1520,13 @@
gra_truetypeon = 1;
/* Preload T1 fonts here, because T1_LoadFont spoils memory */
- for(j=0; j<T1_Get_no_fonts(); j++) T1_LoadFont(j);
+ for(j=0; j<T1_GetNoFonts(); j++) T1_LoadFont(j);
gra_truetypedeffont = 0; /* presume that the first font is good to use */
ptr = egetenv(x_("ELECTRIC_TRUETYPE_FONT"));
if (ptr != NULL)
{
- j = T1_Get_no_fonts();
+ j = T1_GetNoFonts();
for(gra_truetypedeffont=0; gra_truetypedeffont<j; gra_truetypedeffont++)
{
T1_LoadFont(gra_truetypedeffont);
@@ -3088,8 +3090,13 @@
INTBIG enumprocessors(void)
{
INTBIG numproc;
+ size_t proclen;
+
+ proclen = sizeof(numproc);
+ if ((sysctlbyname("hw.ncpu", &numproc, &proclen, NULL, 0) < 0) ||
+ (proclen != sizeof(numproc)))
+ numproc = 1;
- numproc = sysconf(_SC_NPROCESSORS_ONLN);
return(numproc);
}
@@ -4758,7 +4765,7 @@
if (gra_numfaces == 0)
{
- total = T1_Get_no_fonts();
+ total = T1_GetNoFonts();
gra_numfaces = total + 1;
gra_facelist = (CHAR **)emalloc(gra_numfaces * (sizeof (CHAR *)), us_tool->cluster);
if (gra_facelist == 0) return(0);

View File

@ -0,0 +1,11 @@
--- src/include/global.h.orig Fri Jul 14 12:43:20 2006
+++ src/include/global.h Fri Jul 14 12:45:34 2006
@@ -204,7 +204,7 @@
#define INTSML short /* at least 16 bits */
#define UINTSML unsigned short
#define INTHUGE int64_t /* at least 64 bits */
-#define UINTHUGE u_int64_t
+#define UINTHUGE uint64_t
#define SIZEOFCHAR (sizeof (CHAR)) /* bytes per character */
#define SIZEOFINTSML (sizeof (INTSML)) /* bytes per short integer */
#define SIZEOFINTBIG (sizeof (INTBIG)) /* bytes per long integer */