Ticket #40231: libcxx_wip.diff
File libcxx_wip.diff, 9.0 KB (added by ecronin (Eric Cronin), 11 years ago) |
---|
-
dports/devel/boost/Portfile
commit 939cf5427120ec6b0e857e67e955db8b36adb217 Author: Eric Cronin <ecronin@macports.org> Date: Sat Aug 24 19:45:35 2013 -0400 mkvtoolnix: WIP compiling with clang --- dports/devel/boost/Portfile | 5 ++- dports/multimedia/mkvtoolnix/Portfile | 32 +++++++++-------- .../mkvtoolnix/files/patch-clang_errors.diff | 31 ++++++++++++++++ .../multimedia/mkvtoolnix/files/patch-df750c2.diff | 41 ++++++++++++++++++++++ .../mkvtoolnix/files/patch-src-common-logger.cpp | 41 ---------------------- 5 files changed, 93 insertions(+), 57 deletions(-) diff --git a/dports/devel/boost/Portfile b/dports/devel/boost/Portfile index 70433e8..872e5c5 100644
a b PortGroup compiler_blacklist_versions 1.0 6 6 7 7 name boost 8 8 version 1.54.0 9 revision 1 9 10 license Boost-1 10 11 categories devel 11 12 platforms darwin … … build.args -d2 \ 118 119 -sICU_PATH=${prefix} \ 119 120 variant=release \ 120 121 threading=single,multi \ 121 link=static,shared 122 link=static,shared \ 123 cxxflags="-std=c++11 -stdlib=libc++" \ 124 linkflags="-stdlib=libc++" 122 125 123 126 destroot.cmd ${worksrcpath}/bjam 124 127 destroot.post_args -
dports/multimedia/mkvtoolnix/Portfile
diff --git a/dports/multimedia/mkvtoolnix/Portfile b/dports/multimedia/mkvtoolnix/Portfile index 891c10d..000ea22 100644
a b 2 2 # $Id$ 3 3 4 4 PortSystem 1.0 5 PortGroup compiler_blacklist_versions 1.0 5 6 PortGroup muniversal 1.0 6 7 7 8 name mkvtoolnix 8 9 version 6.3.0 10 revision 1 9 11 categories multimedia 10 12 maintainers nomaintainer 11 13 license GPL-2+ LGPL-2.1+ … … depends_lib port:boost \ 41 43 port:ruby \ 42 44 port:zlib 43 45 44 # http://lists.freebsd.org/pipermail/freebsd-multimedia/2013-July/014157.html 45 patchfiles patch-src-common-logger.cpp 46 patch.pre_args -p1 47 patchfiles patch-clang_errors.diff 48 # Remove when version > 6.3.0 is released 49 patchfiles-append patch-df750c2.diff 46 50 47 # configure complains about gcc < 4.6 and clang 48 compiler.whitelist macports-gcc-4.7 macports-gcc-4.8 macports-gcc-4.9 51 # Only recent versions of Clang support C++11 fully 52 # TODO: start by trying to get it working with the latest, then try 53 # older compilers 54 compiler.whitelist macports-clang-3.4 55 56 # Blacklist compilers that don't have the needed C++11 features 57 #compiler.blacklist {clang < 421} macports-clang-2.9 macports-clang-3.0 \ 58 # apple-gcc-4.0 apple-gcc-4.2 gcc-3.3 gcc-4.0 gcc-4.2 llvm-gcc-4.2 macports-llvm-gcc-4.2 \ 59 # macports-gcc-4.2 macports-gcc-4.3 macports-gcc-4.4 macports-gcc-4.5 49 60 50 platform darwin {51 if {${os.major} >= 13} {52 # This project needs to be updated to build with clang++ against libc++53 depends_lib54 depends_run55 pre-fetch {56 ui_error "$name does not build on Mavericks or later."57 error "unsupported platform"58 }59 }60 }61 61 62 62 build.cmd ./drake 63 63 build.target default … … configure.args --mandir=${prefix}/share/man \ 69 69 --with-extra-includes=${prefix}/include \ 70 70 --disable-gui \ 71 71 --disable-wxwidgets 72 configure.cxxflags-append -stdlib=libc++ -std=c++0x 73 configure.ldflags-append -stdlib=libc++ 72 74 73 75 variant wxwidgets description {Build with the wxWidgets GUI} { 74 76 depends_lib-append port:wxWidgets30 -
new file dports/multimedia/mkvtoolnix/files/patch-clang_errors.diff
diff --git a/dports/multimedia/mkvtoolnix/files/patch-clang_errors.diff b/dports/multimedia/mkvtoolnix/files/patch-clang_errors.diff new file mode 100644 index 0000000..25c111a
- + 1 diff -pur mkvtoolnix-6.3.0.orig/src/common/command_line.cpp mkvtoolnix-6.3.0/src/common/command_line.cpp 2 --- mkvtoolnix-6.3.0.orig/src/common/command_line.cpp 2013-08-24 18:35:22.000000000 -0400 3 +++ mkvtoolnix-6.3.0/src/common/command_line.cpp 2013-08-24 18:36:30.000000000 -0400 4 @@ -285,6 +285,7 @@ handle_common_cli_args(std::vector<std:: 5 } else if ((args[i] == "-h") || (args[i] == "-?") || (args[i] == "--help")) 6 usage(); 7 8 +#if 0 9 #if defined(HAVE_CURL_EASY_H) 10 else if (args[i] == "--check-for-updates") { 11 mtx_release_version_t rel = get_latest_release_version(); 12 @@ -304,6 +305,7 @@ handle_common_cli_args(std::vector<std:: 13 mxexit(rel.current_version < rel.latest_source ? 1 : 0); 14 } 15 #endif // defined(HAVE_CURL_EASY_H) 16 +#endif 17 18 else 19 ++i; 20 diff -pur mkvtoolnix-6.3.0.orig/src/common/version.cpp mkvtoolnix-6.3.0/src/common/version.cpp 21 --- mkvtoolnix-6.3.0.orig/src/common/version.cpp 2013-08-24 18:35:22.000000000 -0400 22 +++ mkvtoolnix-6.3.0/src/common/version.cpp 2013-08-24 18:35:43.000000000 -0400 23 @@ -220,7 +220,7 @@ get_latest_release_version() { 24 std::stringstream urls; 25 brng::for_each(release.urls, [&](std::pair<std::string, std::string> const &kv) { urls << " " << kv.first << ":" << kv.second; }); 26 mxdebug(boost::format("update check: current %1% latest source %2% latest winpre %3% URLs%4%\n") 27 - % release.current_version.to_string() % release.latest_source.to_string() % release.latest_windows_build.to_string() % urls); 28 + % release.current_version.to_string() % release.latest_source.to_string() % release.latest_windows_build.to_string() % urls.str()); 29 } 30 31 return release; -
new file dports/multimedia/mkvtoolnix/files/patch-df750c2.diff
diff --git a/dports/multimedia/mkvtoolnix/files/patch-df750c2.diff b/dports/multimedia/mkvtoolnix/files/patch-df750c2.diff new file mode 100644 index 0000000..c92b012
- + 1 From df750c28b6f7258dd4c3037e1132c81300b8cdfa Mon Sep 17 00:00:00 2001 2 From: Moritz Bunkus <moritz@bunkus.org> 3 Date: Sun, 14 Jul 2013 17:25:42 +0200 4 Subject: [PATCH] Fix compilation with clang/libc++ on FreeBSD 5 6 On FreeBSD the high_resolution_clock is an alias for the steady_clock 7 -- which doesn't support converting into time_t. As we only need a 8 precision of seconds for outputting timestamps using system_clock 9 instead is enough. 10 --- 11 src/common/logger.cpp | 6 +++--- 12 1 file changed, 3 insertions(+), 3 deletions(-) 13 14 diff --git a/src/common/logger.cpp b/src/common/logger.cpp 15 index 7f6e5f2..04251d2 100644 16 --- a/src/common/logger.cpp 17 +++ b/src/common/logger.cpp 18 @@ -20,7 +20,7 @@ 19 20 logger_cptr logger_c::s_default_logger; 21 22 -static auto s_program_start_time = std::chrono::high_resolution_clock::now(); 23 +static auto s_program_start_time = std::chrono::system_clock::now(); 24 25 logger_c::logger_c(bfs::path const &file_name) 26 : m_file_name(file_name) 27 @@ -41,9 +41,9 @@ 28 mm_text_io_c out(new mm_file_io_c(m_file_name.string(), bfs::exists(m_file_name) ? MODE_WRITE : MODE_CREATE)); 29 out.setFilePointer(0, seek_end); 30 31 - auto now = std::chrono::high_resolution_clock::now(); 32 + auto now = std::chrono::system_clock::now(); 33 auto diff = now - s_program_start_time; 34 - auto tnow = std::chrono::high_resolution_clock::to_time_t(now); 35 + auto tnow = std::chrono::system_clock::to_time_t(now); 36 37 // 2013-03-02 15:42:32 38 char timestamp[30]; 39 -- 40 1.8.1.6 41 -
deleted file dports/multimedia/mkvtoolnix/files/patch-src-common-logger.cpp
diff --git a/dports/multimedia/mkvtoolnix/files/patch-src-common-logger.cpp b/dports/multimedia/mkvtoolnix/files/patch-src-common-logger.cpp deleted file mode 100644 index 20bb085..0000000
+ - 1 --- src/common/logger.cpp.orig 2013-06-27 23:02:44.000000000 +03002 +++ src/common/logger.cpp 2013-07-14 10:13:25.026646733 +03003 @@ -12,6 +12,7 @@4 5 #include <chrono>6 #include <ctime>7 +#include <ciso646>8 9 #include "common/logger.h"10 #include "common/fs_sys_helpers.h"11 @@ -20,7 +21,11 @@12 13 logger_cptr logger_c::s_default_logger;14 15 +#if defined( _LIBCPP_VERSION )16 +static auto s_program_start_time = std::chrono::system_clock::now();17 +#else18 static auto s_program_start_time = std::chrono::high_resolution_clock::now();19 +#endif20 21 logger_c::logger_c(bfs::path const &file_name)22 : m_file_name(file_name)23 @@ -41,9 +46,17 @@24 mm_text_io_c out(new mm_file_io_c(m_file_name.string(), bfs::exists(m_file_name) ? MODE_WRITE : MODE_CREATE));25 out.setFilePointer(0, seek_end);26 27 - auto now = std::chrono::high_resolution_clock::now();28 + #if defined( _LIBCPP_VERSION )29 + auto now = std::chrono::system_clock::now();30 + #else31 + auto now = std::chrono::high_resolution_clock::now();32 + #endif33 auto diff = now - s_program_start_time;34 + #if defined( _LIBCPP_VERSION )35 + auto tnow = std::chrono::system_clock::to_time_t(now);36 + #else37 auto tnow = std::chrono::high_resolution_clock::to_time_t(now);38 + #endif39 40 // 2013-03-02 15:42:3241 char timestamp[30];42 No newline at end of file