diff options
author | jbeich <jbeich@FreeBSD.org> | 2016-10-09 12:32:45 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2016-10-09 12:32:45 +0800 |
commit | 05a05b5b1c59d363989b9e9585d11b7e86f32560 (patch) | |
tree | faa0f880442efcca30259ed9162739be56f50cb6 /astro/opencpn | |
parent | 09d4ba24a134f5793aacdf4f20e6c817c64d8011 (diff) | |
download | freebsd-ports-gnome-05a05b5b1c59d363989b9e9585d11b7e86f32560.tar.gz freebsd-ports-gnome-05a05b5b1c59d363989b9e9585d11b7e86f32560.tar.zst freebsd-ports-gnome-05a05b5b1c59d363989b9e9585d11b7e86f32560.zip |
astro/opencpn: minor fixup
- Unbreak plugins runtime [1]
- Better enumerate serial devices
- Reduce std namespace pollution even more
Obtained from: PkgSrc
PR: 211199
Diffstat (limited to 'astro/opencpn')
-rw-r--r-- | astro/opencpn/Makefile | 2 | ||||
-rw-r--r-- | astro/opencpn/files/patch-no-std | 29 | ||||
-rw-r--r-- | astro/opencpn/files/patch-plugins_grib__pi_src_GribUIDialog.cpp | 35 | ||||
-rw-r--r-- | astro/opencpn/files/patch-src_chart1.cpp | 18 |
4 files changed, 78 insertions, 6 deletions
diff --git a/astro/opencpn/Makefile b/astro/opencpn/Makefile index 2d0fdd8c14f3..84edf0f3148d 100644 --- a/astro/opencpn/Makefile +++ b/astro/opencpn/Makefile @@ -3,6 +3,7 @@ PORTNAME= opencpn PORTVERSION= 4.4.0 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= astro geography MAINTAINER= freebsd@netfence.it @@ -28,6 +29,7 @@ USE_XORG= x11 INSTALLS_ICONS= yes CMAKE_ARGS= -DBUNDLE_DOCS=ON -DBUNDLE_GSHHS=CRUDE -DBUNDLE_TCDATA=ON +LDFLAGS+= -Wl,-E # plugins LDFLAGS+= -Wl,--as-needed # ICE, SM, Xext post-patch: diff --git a/astro/opencpn/files/patch-no-std b/astro/opencpn/files/patch-no-std index c5c02b2bab4d..bbdc5f3625b9 100644 --- a/astro/opencpn/files/patch-no-std +++ b/astro/opencpn/files/patch-no-std @@ -47,19 +47,26 @@ inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, cons --- include/printtable.h.orig 2016-06-25 12:26:20 UTC +++ include/printtable.h -@@ -27,7 +27,11 @@ +@@ -27,8 +27,6 @@ */ #include <iostream> #include <vector> -using namespace std; -+using std::endl; +- + + #ifndef __PRINTTABLE_H__ + #define __PRINTTABLE_H__ +@@ -44,6 +42,10 @@ using namespace std; + #include "ocpn_types.h" + #include "navutil.h" + +using std::ostream; +using std::string; -+using std::stringstream; +using std::vector; - - - #ifndef __PRINTTABLE_H__ ++ + /** + * \brief + * Enumeration is used to notice the state of the table. --- include/routeprintout.h.orig 2016-06-25 12:26:20 UTC +++ include/routeprintout.h @@ -24,7 +24,6 @@ @@ -80,6 +87,16 @@ inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, cons #include "wx/wxprec.h" +@@ -74,6 +73,9 @@ using namespace std; + + #include "printtable.h" + ++using std::endl; ++using std::stringstream; ++ + void PrintCell::Init( const wxString& _content, wxDC* _dc, int _width, int _cellpadding, bool _bold_font ) + { + bold_font = _bold_font; --- src/routeprintout.cpp.orig 2016-06-25 12:26:20 UTC +++ src/routeprintout.cpp @@ -24,7 +24,6 @@ diff --git a/astro/opencpn/files/patch-plugins_grib__pi_src_GribUIDialog.cpp b/astro/opencpn/files/patch-plugins_grib__pi_src_GribUIDialog.cpp new file mode 100644 index 000000000000..bdd266482b93 --- /dev/null +++ b/astro/opencpn/files/patch-plugins_grib__pi_src_GribUIDialog.cpp @@ -0,0 +1,35 @@ +$NetBSD: patch-plugins_grib_pi_src_GribUIDialog.cpp,v 1.1 2016/06/16 15:52:56 bouyer Exp $ + +from https://github.com/OpenCPN/OpenCPN/pull/662 +fix grib plugin timeline request from crashing when no grib file is loaded + +--- plugins/grib_pi/src/GribUIDialog.cpp.orig 2016-06-25 12:26:20 UTC ++++ plugins/grib_pi/src/GribUIDialog.cpp +@@ -1251,11 +1251,14 @@ wxDateTime GRIBUICtrlBar::TimelineTime() + int tl = (m_TimeLineHours == 0) ? 0 : m_sTimeline->GetValue(); + int stepmin = m_OverlaySettings.GetMinFromIndex(m_OverlaySettings.m_SlicesPerUpdate); + return MinTime() + wxTimeSpan( tl * stepmin / 60, (tl * stepmin) % 60 ); +- } else { +- ArrayOfGribRecordSets *rsa = m_bGRIBActiveFile->GetRecordSetArrayPtr(); +- int index = m_cRecordForecast->GetCurrentSelection() < 1 ? 0 : m_cRecordForecast->GetCurrentSelection(); +- return rsa->Item(index).m_Reference_Time; + } ++ ++ ArrayOfGribRecordSets *rsa = m_bGRIBActiveFile->GetRecordSetArrayPtr(); ++ int index = m_cRecordForecast->GetCurrentSelection() < 1 ? 0 : m_cRecordForecast->GetCurrentSelection(); ++ if(rsa && index<rsa->GetCount()) ++ return rsa->Item(index).m_Reference_Time; ++ ++ return wxDateTime::Now(); + } + + wxDateTime GRIBUICtrlBar::MinTime() +@@ -1265,7 +1268,7 @@ wxDateTime GRIBUICtrlBar::MinTime() + GribRecordSet &first = rsa->Item(0); + return first.m_Reference_Time; + } +- return wxDateTime(0.0); ++ return wxDateTime::Now(); + } + + GribTimelineRecordSet* GRIBUICtrlBar::GetTimeLineRecordSet(wxDateTime time) diff --git a/astro/opencpn/files/patch-src_chart1.cpp b/astro/opencpn/files/patch-src_chart1.cpp index 478ade2e0041..7ee09bb9f269 100644 --- a/astro/opencpn/files/patch-src_chart1.cpp +++ b/astro/opencpn/files/patch-src_chart1.cpp @@ -37,3 +37,21 @@ ret = 1; } close (fd); +@@ -10409,10 +10421,17 @@ wxArrayString *EnumerateSerialPorts( voi + + //Initialize the pattern table + if( devPatern[0] == NULL ) { ++#ifdef __linux__ + paternAdd ( "ttyUSB" ); + paternAdd ( "ttyACM" ); + paternAdd ( "ttyGPS" ); + paternAdd ( "refcom" ); ++#else ++ paternAdd ( "ttyU" ); ++ paternAdd ( "ttyu" ); ++ paternAdd ( "ttyd" ); ++ paternAdd ( "gps" ); ++#endif + } + + // Looking for user privilege openable devices in /dev |