Index: files/patch-qucs-main.cpp.diff
===================================================================
--- files/patch-qucs-main.cpp.diff	(revision 111745)
+++ files/patch-qucs-main.cpp.diff	(working copy)
@@ -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-configure.diff
===================================================================
--- files/patch-configure.diff	(revision 111745)
+++ files/patch-configure.diff	(working copy)
@@ -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-qucs_actions.cpp.diff
===================================================================
--- files/patch-qucs-qucs_actions.cpp.diff	(revision 111745)
+++ files/patch-qucs-qucs_actions.cpp.diff	(working copy)
@@ -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()) {
Index: Portfile
===================================================================
--- Portfile	(revision 111745)
+++ Portfile	(working copy)
@@ -4,41 +4,44 @@
 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
+
+# iverilog is not universal
+universal_variant   no
+
 use_parallel_build  yes
-patchfiles          patch-configure.diff \
-                    patch-qucs_qucsdigi.diff \
+
+patchfiles          patch-qucs_qucsdigi.diff \
                     patch-qucs_qucsveri.diff \
                     patch-qucs-main.cpp.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 {
@@ -50,7 +53,6 @@
         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"
     }
 }
-
