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 
    66
    77name            boost
    88version         1.54.0
     9revision        1
    910license         Boost-1
    1011categories      devel
    1112platforms       darwin
    build.args -d2 \ 
    118119                -sICU_PATH=${prefix} \
    119120                variant=release \
    120121                threading=single,multi \
    121                 link=static,shared
     122                link=static,shared \
     123                cxxflags="-std=c++11 -stdlib=libc++" \
     124                linkflags="-stdlib=libc++"
    122125
    123126destroot.cmd            ${worksrcpath}/bjam
    124127destroot.post_args
  • dports/multimedia/mkvtoolnix/Portfile

    diff --git a/dports/multimedia/mkvtoolnix/Portfile b/dports/multimedia/mkvtoolnix/Portfile
    index 891c10d..000ea22 100644
    a b  
    22# $Id$
    33
    44PortSystem          1.0
     5PortGroup           compiler_blacklist_versions 1.0
    56PortGroup           muniversal 1.0
    67
    78name                mkvtoolnix
    89version             6.3.0
     10revision            1
    911categories          multimedia
    1012maintainers         nomaintainer
    1113license             GPL-2+ LGPL-2.1+
    depends_lib port:boost \ 
    4143                    port:ruby \
    4244                    port:zlib
    4345
    44 # http://lists.freebsd.org/pipermail/freebsd-multimedia/2013-July/014157.html
    45 patchfiles          patch-src-common-logger.cpp
     46patch.pre_args      -p1
     47patchfiles          patch-clang_errors.diff
     48# Remove when version > 6.3.0 is released
     49patchfiles-append   patch-df750c2.diff
    4650
    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
     54compiler.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
    4960
    50 platform darwin {
    51     if {${os.major} >= 13} {
    52         # This project needs to be updated to build with clang++ against libc++
    53         depends_lib
    54         depends_run
    55         pre-fetch {
    56             ui_error "$name does not build on Mavericks or later."
    57             error "unsupported platform"
    58         }
    59     }
    60 }
    6161
    6262build.cmd           ./drake
    6363build.target        default
    configure.args --mandir=${prefix}/share/man \ 
    6969                    --with-extra-includes=${prefix}/include \
    7070                    --disable-gui \
    7171                    --disable-wxwidgets
     72configure.cxxflags-append -stdlib=libc++ -std=c++0x
     73configure.ldflags-append -stdlib=libc++
    7274
    7375variant wxwidgets description {Build with the wxWidgets GUI} {
    7476    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
    - +  
     1diff -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;
     20diff -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
    - +  
     1From df750c28b6f7258dd4c3037e1132c81300b8cdfa Mon Sep 17 00:00:00 2001
     2From: Moritz Bunkus <moritz@bunkus.org>
     3Date: Sun, 14 Jul 2013 17:25:42 +0200
     4Subject: [PATCH] Fix compilation with clang/libc++ on FreeBSD
     5
     6On 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
     8precision of seconds for outputting timestamps using system_clock
     9instead is enough.
     10---
     11 src/common/logger.cpp | 6 +++---
     12 1 file changed, 3 insertions(+), 3 deletions(-)
     13
     14diff --git a/src/common/logger.cpp b/src/common/logger.cpp
     15index 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--
     401.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 +0300
    2 +++ src/common/logger.cpp       2013-07-14 10:13:25.026646733 +0300
    3 @@ -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 +#else
    18  static auto s_program_start_time = std::chrono::high_resolution_clock::now();
    19 +#endif
    20  
    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 +    #else
    31 +    auto now  = std::chrono::high_resolution_clock::now();
    32 +    #endif
    33      auto diff = now - s_program_start_time;
    34 +    #if defined( _LIBCPP_VERSION )
    35 +    auto tnow = std::chrono::system_clock::to_time_t(now);
    36 +    #else
    37      auto tnow = std::chrono::high_resolution_clock::to_time_t(now);
    38 +    #endif
    39  
    40      // 2013-03-02 15:42:32
    41      char timestamp[30];
    42  No newline at end of file