[95250] trunk/dports/audio/ncmpcpp

jmr at macports.org jmr at macports.org
Sat Jul 7 14:23:52 PDT 2012


Revision: 95250
          https://trac.macports.org/changeset/95250
Author:   jmr at macports.org
Date:     2012-07-07 14:23:51 -0700 (Sat, 07 Jul 2012)
Log Message:
-----------
ncmpcpp: clang buildfix (#33677)

Modified Paths:
--------------
    trunk/dports/audio/ncmpcpp/Portfile

Added Paths:
-----------
    trunk/dports/audio/ncmpcpp/files/
    trunk/dports/audio/ncmpcpp/files/fix_clang_errors.diff

Modified: trunk/dports/audio/ncmpcpp/Portfile
===================================================================
--- trunk/dports/audio/ncmpcpp/Portfile	2012-07-07 19:21:52 UTC (rev 95249)
+++ trunk/dports/audio/ncmpcpp/Portfile	2012-07-07 21:23:51 UTC (rev 95250)
@@ -27,10 +27,9 @@
                     port:libmpdclient \
                     port:ncurses \
                     port:taglib
-if {${configure.compiler} == "clang"} {
-    configure.compiler  llvm-gcc-4.2
-}
 
+patchfiles          fix_clang_errors.diff
+
 variant visualizer description "Enable Visualizer" {
     configure.args-append --enable-visualizer
 }

Added: trunk/dports/audio/ncmpcpp/files/fix_clang_errors.diff
===================================================================
--- trunk/dports/audio/ncmpcpp/files/fix_clang_errors.diff	                        (rev 0)
+++ trunk/dports/audio/ncmpcpp/files/fix_clang_errors.diff	2012-07-07 21:23:51 UTC (rev 95250)
@@ -0,0 +1,95 @@
+--- src/strbuffer.h.orig	2012-04-02 02:49:09.000000000 +1000
++++ src/strbuffer.h	2012-07-08 07:15:47.000000000 +1000
+@@ -29,6 +29,42 @@
+ 
+ namespace NCurses
+ {
++
++    template <typename C> class basic_buffer;
++
++    template <typename C> Window &operator<<(Window &w, const basic_buffer<C> &buf)
++    {
++        const std::basic_string<C> &s = buf.itsTempString ? *buf.itsTempString : buf.itsString.str();
++        if (buf.itsFormat.empty())
++        {
++            w << s;
++        }
++        else
++        {
++            std::basic_string<C> tmp;
++            typename std::list<typename basic_buffer<C>::FormatPos>::const_iterator b = buf.itsFormat.begin();
++            typename std::list<typename basic_buffer<C>::FormatPos>::const_iterator e = buf.itsFormat.end();
++            for (size_t i = 0; i < s.length() || b != e; ++i)
++            {
++                while (b != e && i == b->Position)
++                {
++                    if (!tmp.empty())
++                    {
++                        w << tmp;
++                        tmp.clear();
++                    }
++                    buf.LoadAttribute(w, b->Value);
++                    b++;
++                }
++                if (i < s.length())
++                    tmp += s[i];
++            }
++            if (!tmp.empty())
++                w << tmp;
++        }
++        return w;
++    }
++
+ 	/// Buffer template class that can store text along with its
+ 	/// format attributes. The content can be easily printed to
+ 	/// window or taken as raw string at any time.
+@@ -364,38 +400,5 @@ template <typename C> NCurses::basic_buf
+ 	return *this;
+ }
+ 
+-template <typename C> NCurses::Window &operator<<(NCurses::Window &w, const NCurses::basic_buffer<C> &buf)
+-{
+-	const std::basic_string<C> &s = buf.itsTempString ? *buf.itsTempString : buf.itsString.str();
+-	if (buf.itsFormat.empty())
+-	{
+-		w << s;
+-	}
+-	else
+-	{
+-		std::basic_string<C> tmp;
+-		typename std::list<typename NCurses::basic_buffer<C>::FormatPos>::const_iterator b = buf.itsFormat.begin();
+-		typename std::list<typename NCurses::basic_buffer<C>::FormatPos>::const_iterator e = buf.itsFormat.end();
+-		for (size_t i = 0; i < s.length() || b != e; ++i)
+-		{
+-			while (b != e && i == b->Position)
+-			{
+-				if (!tmp.empty())
+-				{
+-					w << tmp;
+-					tmp.clear();
+-				}
+-				buf.LoadAttribute(w, b->Value);
+-				b++;
+-			}
+-			if (i < s.length())
+-				tmp += s[i];
+-		}
+-		if (!tmp.empty())
+-			w << tmp;
+-	}
+-	return w;
+-}
+-
+ #endif
+ 
+--- src/browser.cpp.orig	2012-04-02 02:49:09.000000000 +1000
++++ src/browser.cpp	2012-07-08 06:27:35.000000000 +1000
+@@ -532,7 +532,7 @@ void Browser::ChangeBrowseMode()
+ 	
+ 	itsBrowseLocally = !itsBrowseLocally;
+ 	ShowMessage("Browse mode: %s", itsBrowseLocally ? "Local filesystem" : "MPD music dir");
+-	itsBrowsedDir = itsBrowseLocally ? Config.GetHomeDirectory() : "/";
++	itsBrowsedDir = itsBrowseLocally ? (Config.GetHomeDirectory()) : "/";
+ 	if (itsBrowseLocally && *itsBrowsedDir.rbegin() == '/')
+ 		itsBrowsedDir.resize(itsBrowsedDir.length()-1);
+ 	w->Reset();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120707/f697406e/attachment.html>


More information about the macports-changes mailing list