Ticket #47199: octave-interval_0.1.4.diff

File octave-interval_0.1.4.diff, 4.2 KB (added by michaelld (Michael Dickens), 10 years ago)
  • Portfile

     
    44PortSystem          1.0
    55PortGroup           octave 1.0
    66
    7 octave.setup        interval 0.1.3
     7octave.setup        interval 0.1.4
    88platforms           darwin
    99license             GPL-3+ Apache-2
    1010maintainers         nomaintainer
     
    1313    inf-sup format is based on interval boundaries represented by \
    1414    binary64 numbers and is standard conforming to IEEE 1788.
    1515
    16 checksums           rmd160 e377be8a80cd0904b750fb903153341bb9e68a4b \
    17                     sha256 d76313934f464d8b92f9b4a0dd07d55a18967df145c4cdbd9c5958c900599a0c
     16checksums           rmd160 284ba65f2e73fb0393efe3877b36fb962f5b5d62 \
     17                    sha256 6fe7a8deaf212fcd586f802db43ff8ab4192471b2946f982f449d16f6552cec9
    1818
    1919depends_lib-append  port:mpfr port:gmp
     20
     21patchfiles-append \
     22    patch-src_Makefile.diff \
     23    patch-src_mpfr_function_d.cc.diff
     24
     25# octave-interval requires <cfenv>, which is part of C++0x and newer.
     26
     27if {${configure.cxx_stdlib} eq "libstdc++"} {
     28
     29    # *clang* when using libstdc++ do not seem to support C++11;
     30    # C++11 support seems to need GCC 4.7+;
     31    # could use C++0x support on GCC4.[56], but just ignore it since
     32    # there are newer compilers already in place as defaults.
     33
     34    variant gcc49 conflicts gcc47 gcc48 \
     35        description {build using macports-gcc-4.9} \
     36    {
     37        configure.compiler macports-gcc-4.9
     38    }
     39
     40    variant gcc48 conflicts gcc47 gcc49 \
     41        description {build using macports-gcc-4.8} \
     42    {
     43        configure.compiler macports-gcc-4.8
     44    }
     45
     46    variant gcc47 conflicts gcc48 gcc49 \
     47        description {build using macports-gcc-4.7} \
     48    {
     49        configure.compiler macports-gcc-4.7
     50    }
     51
     52    # default to +gcc49
     53    if {![variant_isset gcc47] &&
     54        ![variant_isset gcc48] &&
     55        ![variant_isset gcc49]} {
     56        default_variants +gcc49
     57    }
     58
     59    # make sure some +gcc4X is selected
     60    if {![variant_isset gcc47] &&
     61        ![variant_isset gcc48] &&
     62        ![variant_isset gcc49]} {
     63        ui_error "\n\nYou must select one of the following variants: +gcc47, +gcc48, +gcc49.\n"
     64        return -code error "Invalid variant selection"
     65    }
     66
     67} else {
     68
     69    # using libc++;
     70    # Blacklist compilers not supporting C++11 in some form.
     71
     72    PortGroup compiler_blacklist_versions 1.0
     73    compiler.blacklist-append *gcc-4.0 *gcc-4.2 {clang < 300}
     74
     75}
  • files/patch-src_Makefile.diff

     
     1--- src/Makefile.orig   2015-03-19 11:08:20.000000000 -0400
     2+++ src/Makefile        2015-03-19 11:08:29.000000000 -0400
     3@@ -12,8 +12,8 @@
     4 
     5 ## MPFR api oct-files
     6 mpfr_%.oct: mpfr_%.cc mpfr_commons.cc
     7-       $(MKOCTFILE)  -o $@ $(LDFLAGS_MPFR)  $<
     8+       $(MKOCTFILE) -v -o $@ $(LDFLAGS_MPFR)  $<
     9 
     10 ## cfenv api oct-file
     11 __setround__.oct: __setround__.cc
     12-       CXXFLAGS="$(CPP11_CXXFLAGS)"  $(MKOCTFILE)  -o $@  $<
     13+       CXXFLAGS="$(CPP11_CXXFLAGS)"  $(MKOCTFILE) -v -o $@  $<
  • files/patch-src_mpfr_function_d.cc.diff

     
     1--- src/mpfr_function_d.cc.orig 2015-03-19 11:07:25.000000000 -0400
     2+++ src/mpfr_function_d.cc      2015-03-19 11:07:30.000000000 -0400
     3@@ -106,19 +106,19 @@
     4   bool scalar2 = arg2.numel () == 1;
     5   bool scalar3 = arg3.numel () == 1;
     6   
     7-  if (scalar1)
     8+  if (scalar1) {
     9     // arg1 shall contain the result and must possibly be resized
     10     if (!scalar2)
     11       {
     12         arg1 = Matrix (arg2.dims (), arg1.elem (0));
     13         scalar1 = false;
     14       }
     15-    else if (!scalar3)
     16+    else { if (!scalar3)
     17       {
     18         arg1 = Matrix (arg3.dims (), arg1.elem (0));
     19         scalar1 = false;
     20       }
     21-
     22+  } }
     23   const unsigned int n = std::max (std::max (arg1.numel (), arg2.numel ()),
     24                                    arg3.numel ());
     25   for (octave_idx_type i = 0; i < n; i ++)