aboutsummaryrefslogtreecommitdiff
path: root/cad/electric
diff options
context:
space:
mode:
authorIon-Mihai Tetcu <itetcu@FreeBSD.org>2006-07-14 21:53:59 +0000
committerIon-Mihai Tetcu <itetcu@FreeBSD.org>2006-07-14 21:53:59 +0000
commit846a9729bd51369f8f13c5da349b8709f736596d (patch)
treeeac93c5d27805e8a14d1d17d6119d83d060d1d43 /cad/electric
parent604b19987486db6e56959a15259f2f24c71c1c09 (diff)
downloadports-846a9729bd51369f8f13c5da349b8709f736596d.tar.gz
ports-846a9729bd51369f8f13c5da349b8709f736596d.zip
- 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>
Notes
Notes: svn path=/head/; revision=167833
Diffstat (limited to 'cad/electric')
-rw-r--r--cad/electric/Makefile40
-rw-r--r--cad/electric/files/patch-Makefile.in90
-rw-r--r--cad/electric/files/patch-src::graph::graphunixx11.c26
-rw-r--r--cad/electric/files/patch-src_graph_graphqtdlg.h10
-rw-r--r--cad/electric/files/patch-src_graph_graphunixx11.c51
-rw-r--r--cad/electric/files/patch-src_include_global.h11
6 files changed, 198 insertions, 30 deletions
diff --git a/cad/electric/Makefile b/cad/electric/Makefile
index 4ce3c1b965f5..2d6663414099 100644
--- a/cad/electric/Makefile
+++ b/cad/electric/Makefile
@@ -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>
diff --git a/cad/electric/files/patch-Makefile.in b/cad/electric/files/patch-Makefile.in
new file mode 100644
index 000000000000..832ce013fc35
--- /dev/null
+++ b/cad/electric/files/patch-Makefile.in
@@ -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 =
diff --git a/cad/electric/files/patch-src::graph::graphunixx11.c b/cad/electric/files/patch-src::graph::graphunixx11.c
deleted file mode 100644
index cb008da2ba80..000000000000
--- a/cad/electric/files/patch-src::graph::graphunixx11.c
+++ /dev/null
@@ -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);
- }
-
diff --git a/cad/electric/files/patch-src_graph_graphqtdlg.h b/cad/electric/files/patch-src_graph_graphqtdlg.h
new file mode 100644
index 000000000000..09fb306abf51
--- /dev/null
+++ b/cad/electric/files/patch-src_graph_graphqtdlg.h
@@ -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
+ {
diff --git a/cad/electric/files/patch-src_graph_graphunixx11.c b/cad/electric/files/patch-src_graph_graphunixx11.c
new file mode 100644
index 000000000000..ae22971ccb6f
--- /dev/null
+++ b/cad/electric/files/patch-src_graph_graphunixx11.c
@@ -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);
diff --git a/cad/electric/files/patch-src_include_global.h b/cad/electric/files/patch-src_include_global.h
new file mode 100644
index 000000000000..7827ed756d3e
--- /dev/null
+++ b/cad/electric/files/patch-src_include_global.h
@@ -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 */