Index: Portfile
===================================================================
--- Portfile	(Revision 111973)
+++ Portfile	(Arbeitskopie)
@@ -4,53 +4,57 @@
 PortSystem      1.0
 
 name                qucs
-version             0.0.16
+version             0.0.17
 categories          science electronics
 license             GPL-2+
 maintainers         rowue openmaintainer
 platforms           darwin
-supported_archs     i386 ppc
+
 description         an integrated circuit simulator
 long_description    Qucs is an integrated circuit simulator. \
-    You can setup an circut with graphical user interface. \
-    It's based on QT
+                    You can set up a circuit with a graphical user interface.
+
 homepage            http://qucs.sourceforge.net/
-master_sites        sourceforge
-checksums           md5     c916502171d422ab168fe5fc681b29d8 \
-                    sha1    453143d511d2d75e115f4e03d32457446586d4ab \
-                    rmd160  77624106f891d700c123d7a3f38b47ea2a0d60e1
+master_sites        sourceforge:project/qucs/qucs/${version}
 
+checksums           rmd160  4ac2056bd097155ec73bb119f6ffcaeb6848ba69 \
+                    sha256  1fa0e6f2e8068c0800aa4dd3a25b41d18a6060619914c9787a20d21934089a70
 
-depends_lib         port:qt3-mac \
+depends_build       port:pkgconfig
+
+depends_lib         port:qt4-mac \
                     port:freehdl \
                     port:libtool \
-                    port:iverilog \
-                    port:asco
+                    port:iverilog
+
+# iverilog is not universal
+universal_variant   no
+
 use_parallel_build  yes
-patchfiles          patch-configure.diff \
+
+patchfiles          patch-Makefile.in.diff \
                     patch-qucs_qucsdigi.diff \
                     patch-qucs_qucsveri.diff \
                     patch-qucs-main.cpp.diff \
+                    patch-qucs-filter-qf_filter.cpp.diff \
+                    patch-asco-configure.diff \
                     patch-qucs-main.h.diff \
-                    patch-qucs-qucs_actions.cpp.diff 
-#                    patch-Makefile.in.diff
+                    patch-qucs-qucs_actions.cpp.diff
 
 post-patch {
     reinplace "s|@APPDIR@|${applications_dir}|g" ${worksrcpath}/qucs/main.cpp
-    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/qucs/qucsdigi
-    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/qucs/qucsveri
+    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/qucs/qucsdigi ${worksrcpath}/qucs/qucsveri
 }
 
 post-destroot {
     foreach Program {qucs qucsedit qucsfilter qucshelp qucslib qucstrans qucsattenuator} {
-        xinstall -m 755 -d ${destroot}${applications_dir}/${Program}.app/Contents/MacOS
+        xinstall -m 755 -d  ${destroot}${applications_dir}/${Program}.app/Contents/MacOS
         move ${destroot}${prefix}/bin/${Program} ${destroot}${applications_dir}/${Program}.app/Contents/MacOS/
-        xinstall -m 755 -d ${destroot}${applications_dir}/${Program}.app/Contents/Resources
+        xinstall -m 755 -d  ${destroot}${applications_dir}/${Program}.app/Contents/Resources
         xinstall -m 0644 ${filespath}/${Program}.icns ${destroot}${applications_dir}/${Program}.app/Contents/Resources
         xinstall -m 0644 ${filespath}/Info.plist ${destroot}${applications_dir}/${Program}.app/Contents/
         reinplace "s|@VERSION@|${version}|" ${destroot}${applications_dir}/${Program}.app/Contents/Info.plist
         reinplace "s|@EXECUTABLE@|${Program}|" ${destroot}${applications_dir}/${Program}.app/Contents/Info.plist
-        system "echo 'APPL????' > ${destroot}${applications_dir}/${Program}.app/Contents/PkgInfo"
+        system "printf 'APPL????' > ${destroot}${applications_dir}/${Program}.app/Contents/PkgInfo"
     }
 }
-
Index: files/patch-Makefile.in.diff
===================================================================
--- files/patch-Makefile.in.diff	(Revision 111973)
+++ files/patch-Makefile.in.diff	(Arbeitskopie)
@@ -1,44 +1,11 @@
---- Makefile.in.orig	2009-06-09 20:14:07.000000000 +0200
-+++ Makefile.in	2009-06-09 21:35:12.000000000 +0200
-@@ -105,8 +105,6 @@
- CC = @CC@
- CCDEPMODE = @CCDEPMODE@
- CFLAGS = @CFLAGS@
--COND_MACOSX_FALSE = @COND_MACOSX_FALSE@
--COND_MACOSX_TRUE = @COND_MACOSX_TRUE@
- COND_WIN32_FALSE = @COND_WIN32_FALSE@
- COND_WIN32_TRUE = @COND_WIN32_TRUE@
- CPP = @CPP@
-@@ -219,15 +217,6 @@
+--- Makefile.in.orig	2013-10-07 20:43:47.000000000 +0200
++++ Makefile.in	2013-10-07 20:45:52.000000000 +0200
+@@ -795,54 +795,6 @@
+ 	tags-recursive uninstall uninstall-am uninstall-hook
  
- EXTRA_DIST = autogen.sh depcomp PLATFORMS RELEASE Info.plist
  
--# MacOSX specific installation of applications
--@COND_MACOSX_TRUE@app_PROGS = $(top_builddir)/qucs/qucs \
--@COND_MACOSX_TRUE@  $(top_builddir)/qucs-attenuator/qucsattenuator \
--@COND_MACOSX_TRUE@  $(top_builddir)/qucs-filter/qucsfilter \
--@COND_MACOSX_TRUE@  $(top_builddir)/qucs-help/qucshelp \
--@COND_MACOSX_TRUE@  $(top_builddir)/qucs-lib/qucslib \
--@COND_MACOSX_TRUE@  $(top_builddir)/qucs-edit/qucsedit \
--@COND_MACOSX_TRUE@  $(top_builddir)/qucs-transcalc/qucstrans
+-@COND_MACOSX_TRUE@install-exec-hook: mac-install-apps mac-deploy-framework
 -
- CLEANFILES = *~ *.rej *.orig
- MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
-         stamp-h.in stamp-h[0-9].in
-@@ -603,7 +592,6 @@
- 
- install-exec-am:
- 	@$(NORMAL_INSTALL)
--	$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
- 
- install-info: install-info-recursive
- 
-@@ -651,65 +639,6 @@
- 	uninstall-info-am
- 
- 
--@COND_MACOSX_TRUE@install-exec-hook: mac-install-apps mac-install-framework
--
 -@COND_MACOSX_TRUE@mac-install-apps:
 -@COND_MACOSX_TRUE@	@echo "Creating MacOSX applications...";
 -@COND_MACOSX_TRUE@	@list='$(app_PROGS)'; for file in $$list; do \
@@ -69,25 +36,13 @@
 -@COND_MACOSX_TRUE@	chmod +x $(bindir)/$$app; \
 -@COND_MACOSX_TRUE@	done
 -
--@COND_MACOSX_TRUE@mac-install-framework:
+-@COND_MACOSX_TRUE@mac-deploy-framework:
 -@COND_MACOSX_TRUE@	@echo "Copying and setting up MacOSX/Qt framework...";
--@COND_MACOSX_TRUE@	@if test -e "$(QTDIR)/lib/libqt.3.dylib"; then \
--@COND_MACOSX_TRUE@	  qtlib="$(QTDIR)/lib/libqt.3.dylib"; fi && \
--@COND_MACOSX_TRUE@	if test -e "$(QTDIR)/lib/libqt-mt.3.dylib"; then \
--@COND_MACOSX_TRUE@	  qtlib="$(QTDIR)/lib/libqt-mt.3.dylib"; fi && \
--@COND_MACOSX_TRUE@	if ! test -z "$$qtlib"; then \
--@COND_MACOSX_TRUE@	  $(mkinstalldirs) "$(bindir)/qucs.app/Contents/Frameworks"; \
--@COND_MACOSX_TRUE@	  cp "$$qtlib" "$(bindir)/qucs.app/Contents/Frameworks/"; \
--@COND_MACOSX_TRUE@	  qtlib=`basename $$qtlib`; \
--@COND_MACOSX_TRUE@	  install_name_tool -id "@executable_path/../Frameworks/$$qtlib" \
--@COND_MACOSX_TRUE@	    "$(bindir)/qucs.app/Contents/Frameworks/$$qtlib"; \
--@COND_MACOSX_TRUE@	  list='$(app_PROGS)'; for file in $$list; do \
--@COND_MACOSX_TRUE@	  app=`basename $$file` && \
--@COND_MACOSX_TRUE@	  install_name_tool -change $$qtlib \
--@COND_MACOSX_TRUE@	    "@executable_path/../../../qucs.app/Contents/Frameworks/$$qtlib" \
--@COND_MACOSX_TRUE@	    "$(bindir)/$$app.app/Contents/MacOS/$$app"; \
--@COND_MACOSX_TRUE@	  done; \
--@COND_MACOSX_TRUE@	fi
+-@COND_MACOSX_TRUE@	@list='$(app_PROGS)'; for file in $$list; do \
+-@COND_MACOSX_TRUE@	app=`basename $$file`; \
+-@COND_MACOSX_TRUE@	echo "running: macdeployqt $(bindir)/$${app}.app"; \
+-@COND_MACOSX_TRUE@	macdeployqt $(bindir)/$$app.app; \
+-@COND_MACOSX_TRUE@	done
 -
 -@COND_MACOSX_TRUE@uninstall-hook:
 -@COND_MACOSX_TRUE@	@list='$(app_PROGS)'; for file in $$list; do \
@@ -96,6 +51,7 @@
 -@COND_MACOSX_TRUE@	done
 -@COND_MACOSX_FALSE@install-exec-hook:
 -@COND_MACOSX_FALSE@uninstall-hook:
+-
  # Tell versions [3.59,3.63) of GNU make to not export all variables.
  # Otherwise a system limit (for SysV at least) may be exceeded.
  .NOEXPORT:
Index: files/patch-asco-configure.diff
===================================================================
--- files/patch-asco-configure.diff	(Revision 0)
+++ files/patch-asco-configure.diff	(Arbeitskopie)
@@ -0,0 +1,15 @@
+--- asco/configure	2013-10-07 19:16:20.000000000 +0200
++++ asco/configure	2013-10-07 19:16:30.000000000 +0200
+@@ -4042,6 +4211,12 @@
+   fi
+ fi
+ 
++case $host_os in
++  *darwin*)
++  CFLAGS="$CFLAGS -DUNIX -I/usr/include/malloc"
++  ;;
++esac
++
+ # Extract the first word of "mpicc", so it can be a program name with args.
+ set dummy mpicc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Index: files/patch-configure.diff
===================================================================
--- files/patch-configure.diff	(Revision 111973)
+++ files/patch-configure.diff	(Arbeitskopie)
@@ -1,23 +0,0 @@
---- configure.orig	2009-06-09 23:25:33.000000000 +0200
-+++ configure	2009-06-09 23:26:55.000000000 +0200
-@@ -6214,7 +6214,7 @@
- $as_echo_n "checking for Qt headers... " >&6; }
- paths="$QTDIR/include /usr/local/qt/include /usr/include/qt /usr/include/qt3 \
-   /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/X11/qt \
--  /usr/X11R6/include/qt /usr/X11R6/include /sw/include/qt \
-+  /usr/X11R6/include/qt /usr/X11R6/include \
-   /usr/X11R6/include/qt2 $prefix/include/qt3"
- for path in $paths; do
-   if test -f "$path/qapplication.h"; then
-@@ -6278,9 +6278,9 @@
- $as_echo "checking for Qt... $QT_VER ($QT_MTS)" >&6; }
- { $as_echo "$as_me:$LINENO: checking for Qt library" >&5
- $as_echo_n "checking for Qt library... " >&6; }
--paths="$QTDIR/lib $QTDIR/lib64 /usr/local/qt/lib /usr/lib/qt /usr/lib \
-+paths="$QTDIR/lib $QTDIR/lib64 /usr/lib/qt /usr/lib \
-   /usr/X11R6/lib/X11/qt /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt \
--  /usr/X11R6/lib /sw/lib /usr/lib64/qt /usr/X11R6/lib/qt2"
-+  /usr/X11R6/lib /usr/lib64/qt /usr/X11R6/lib/qt2"
- ac_ext=cpp
- ac_cpp='$CXXCPP $CPPFLAGS'
- ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Index: files/patch-qucs-filter-qf_filter.cpp.diff
===================================================================
--- files/patch-qucs-filter-qf_filter.cpp.diff	(Revision 0)
+++ files/patch-qucs-filter-qf_filter.cpp.diff	(Arbeitskopie)
@@ -0,0 +1,25 @@
+--- qucs-filter/qf_filter.cpp
++++ qucs-filter/qf_filter.cpp
+@@ -43,19 +43,19 @@ qf_filter::qf_filter () :
+   ncomp (0), Comp (NULL) {
+ }
+ 
+-qf_filter::qf_filter (int n = 3, qfk k = UNDEF, qft t = LOWPASS) :
++qf_filter::qf_filter (int n, qfk k, qft t) :
+   type (t), kind (k), ord (n), fc (0), bw (0), imp (1),
+   ncomp (0), Comp (NULL) {
+ }
+ 
+-qf_filter::qf_filter (qfk k = UNDEF, qft t = LOWPASS, qf_double_t r = 1,
++qf_filter::qf_filter (qfk k, qft t, qf_double_t r,
+ 		      qf_double_t f = 1, qf_double_t b = 0) :
+   type (t), kind (k), fc (f), bw (b), imp (r), ncomp (0), Comp (NULL) {
+   fstart = fc - bw / 2;
+   fstop  = fc + bw / 2;
+ }
+ 
+-qf_filter::qf_filter (qfk k = UNDEF, qft t = LOWPASS) :
++qf_filter::qf_filter (qfk k, qft t) :
+   type (t), kind (k), ord (0), fc (0), bw (0), imp (1),
+   ncomp (0), Comp (NULL) {
+ }
Index: files/patch-qucs-main.cpp.diff
===================================================================
--- files/patch-qucs-main.cpp.diff	(Revision 111973)
+++ files/patch-qucs-main.cpp.diff	(Arbeitskopie)
@@ -1,18 +1,19 @@
---- qucs/main.cpp.orig	2009-03-24 22:33:05.000000000 +0100
-+++ qucs/main.cpp	2009-03-24 23:53:40.000000000 +0100
-@@ -563,13 +563,14 @@
-     QucsSettings.OctaveDir =
-       QDir::convertSeparators (QucsDirStr + "/share/qucs/octave/");
-   } else {
+--- qucs/main.cpp.orig	2013-06-23 00:59:40.000000000 -0500
++++ qucs/main.cpp	2013-10-01 01:54:19.000000000 -0500
+@@ -571,6 +571,7 @@
+   if (var != NULL) {
+     QDir QucsDir = QDir (var);
+     QString QucsDirStr = QucsDir.canonicalPath ();
 +    QucsSettings.AppDir = QDir::convertSeparators("@APPDIR@/");
-     QucsSettings.BinDir = BINARYDIR;
-     QucsSettings.BitmapDir = BITMAPDIR;
-     QucsSettings.LangDir = LANGUAGEDIR;
-     QucsSettings.LibDir = LIBRARYDIR;
-     QucsSettings.OctaveDir = OCTAVEDIR;
+     QucsSettings.BinDir =
+       QDir::convertSeparators (QucsDirStr + "/bin/");
+     QucsSettings.BitmapDir =
+@@ -594,7 +595,7 @@
+     QucsSettings.ExamplesDir = QDir(DOCDIR).canonicalPath()+"/examples/";
+     QucsSettings.DocDir = DOCDIR;
    }
 -  QucsSettings.Editor = QucsSettings.BinDir + "qucsedit";
 +  QucsSettings.Editor = QucsSettings.AppDir + "qucsedit.app/Contents/MacOS/qucsedit";
- 
    QucsWorkDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
    QucsHomeDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
+   loadSettings();
Index: files/patch-qucs-qucs_actions.cpp.diff
===================================================================
--- files/patch-qucs-qucs_actions.cpp.diff	(Revision 111973)
+++ files/patch-qucs-qucs_actions.cpp.diff	(Arbeitskopie)
@@ -1,47 +1,47 @@
---- qucs/qucs_actions.cpp.orig	2009-03-24 23:02:53.000000000 +0100
-+++ qucs/qucs_actions.cpp	2009-03-25 00:09:46.000000000 +0100
-@@ -609,7 +609,7 @@
+--- qucs/qucs_actions.cpp.orig	2013-06-23 00:59:40.000000000 -0500
++++ qucs/qucs_actions.cpp	2013-10-01 01:57:16.000000000 -0500
+@@ -622,7 +622,7 @@
  void QucsApp::slotCallFilter()
  {
-   QProcess *QucsFilter =
--    new QProcess(QString(QucsSettings.BinDir + "qucsfilter"));
-+    new QProcess(QString(QucsSettings.AppDir + "qucsfilter.app/Contents/MacOS/qucsfilter"));
+   Q3Process *QucsFilter =
+-    new Q3Process(QString(QucsSettings.BinDir + "qucsfilter"));
++    new Q3Process(QString(QucsSettings.AppDir + "qucsfilter.app/Contents/MacOS/qucsfilter"));
    if(!QucsFilter->start()) {
      QMessageBox::critical(this, tr("Error"),
                            tr("Cannot start filter synthesis program!"));
-@@ -626,7 +626,7 @@
+@@ -639,7 +639,7 @@
  void QucsApp::slotCallLine()
  {
-   QProcess *QucsLine =
--    new QProcess(QString(QucsSettings.BinDir + "qucstrans"));
-+    new QProcess(QString(QucsSettings.AppDir + "qucstrans.app/Contents/MacOS/qucstrans"));
+   Q3Process *QucsLine =
+-    new Q3Process(QString(QucsSettings.BinDir + "qucstrans"));
++    new Q3Process(QString(QucsSettings.AppDir + "qucstrans.app/Contents/MacOS/qucstrans"));
    if(!QucsLine->start()) {
      QMessageBox::critical(this, tr("Error"),
                            tr("Cannot start line calculation program!"));
-@@ -643,7 +643,7 @@
+@@ -656,7 +656,7 @@
  void QucsApp::slotCallLibrary()
  {
-   QProcess *QucsLibrary =
--    new QProcess(QString(QucsSettings.BinDir + "qucslib"));
-+    new QProcess(QString(QucsSettings.AppDir + "qucslib.app/Contents/MacOS/qucslib"));
+   Q3Process *QucsLibrary =
+-    new Q3Process(QString(QucsSettings.BinDir + "qucslib"));
++    new Q3Process(QString(QucsSettings.AppDir + "qucslib.app/Contents/MacOS/qucslib"));
    if(!QucsLibrary->start()) {
      QMessageBox::critical(this, tr("Error"),
                            tr("Cannot start library program!"));
-@@ -668,7 +668,7 @@
+@@ -681,7 +681,7 @@
  void QucsApp::slotCallAtt()
  {
-   QProcess *QucsAtt =
--    new QProcess(QString(QucsSettings.BinDir + "qucsattenuator"));
-+    new QProcess(QString(QucsSettings.AppDir + "qucsattenuator.app/Contents/MacOS/qucsattenuator"));
+   Q3Process *QucsAtt =
+-    new Q3Process(QString(QucsSettings.BinDir + "qucsattenuator"));
++    new Q3Process(QString(QucsSettings.AppDir + "qucsattenuator.app/Contents/MacOS/qucsattenuator"));
    if(!QucsAtt->start()) {
      QMessageBox::critical(this, tr("Error"),
                            tr("Cannot start attenuator calculation program!"));
-@@ -696,7 +696,7 @@
+@@ -709,7 +709,7 @@
  void QucsApp::showHTML(const QString& Page)
  {
    QStringList com;
 -  com << QucsSettings.BinDir + "qucshelp" << Page;
 +  com << QucsSettings.AppDir + "qucshelp.app/Contents/MacOS/qucshelp" << Page;
-   QProcess *QucsHelp = new QProcess(com);
+   Q3Process *QucsHelp = new Q3Process(com);
    QucsHelp->setCommunication(0);
    if(!QucsHelp->start()) {
