Bug 223758 - math/saga: fail build with wxgtk30 - 3.0.3.1
Summary: math/saga: fail build with wxgtk30 - 3.0.3.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks: 220932
  Show dependency treegraph
 
Reported: 2017-11-20 00:22 UTC by Ivan Rozhuk
Modified: 2018-05-02 23:40 UTC (History)
3 users (show)

See Also:
rhurlin: maintainer-feedback+


Attachments
patch to fix (1.14 KB, patch)
2017-12-06 22:19 UTC, Ivan Rozhuk
no flags Details | Diff
build fix again (801 bytes, patch)
2018-01-21 15:02 UTC, Ivan Rozhuk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2017-11-20 00:22:28 UTC
...
wksp_tool.cpp:159:61: error: no matching function for call to 'CSG_File::Open(const wxScopedWCharBuffer, ESG_File_Flags_Open)'
   if( Stream.Open(FileName.GetFullPath().wc_str(), SG_FILE_R) && Stream.Read(Description, Stream.Length()) )
                                                             ^
In file included from ../saga_api/geo_tools.h:77:0,
                 from ../saga_api/mat_tools.h:77,
                 from ../saga_api/dataobject.h:84,
                 from ../saga_api/table.h:77,
                 from ../saga_api/grid.h:77,
                 from ../saga_api/parameters.h:77,
                 from ../saga_api/tool.h:76,
                 from ../saga_api/tool_library.h:77,
                 from ../saga_api/saga_api.h:118,
                 from res_commands.h:78,
                 from wksp_tool.cpp:67:
../saga_api/api_core.h:955:13: note: candidate: bool CSG_File::Open(const CSG_String&, int, bool, int)
  bool       Open    (const CSG_String &File_Name, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_CHAR);
             ^~~~
../saga_api/api_core.h:955:13: note:   no known conversion for argument 1 from 'const wxScopedWCharBuffer {aka const wxScopedCharTypeBuffer<wchar_t>}' to 'const CSG_String&'
wksp_tool.cpp:166:61: error: no matching function for call to 'CSG_File::Open(const wxScopedWCharBuffer, ESG_File_Flags_Open)'
   if( Stream.Open(FileName.GetFullPath().wc_str(), SG_FILE_R) && Stream.Read(Description, Stream.Length()) )
                                                             ^
In file included from ../saga_api/geo_tools.h:77:0,
                 from ../saga_api/mat_tools.h:77,
                 from ../saga_api/dataobject.h:84,
                 from ../saga_api/table.h:77,
                 from ../saga_api/grid.h:77,
                 from ../saga_api/parameters.h:77,
                 from ../saga_api/tool.h:76,
                 from ../saga_api/tool_library.h:77,
                 from ../saga_api/saga_api.h:118,
                 from res_commands.h:78,
                 from wksp_tool.cpp:67:
../saga_api/api_core.h:955:13: note: candidate: bool CSG_File::Open(const CSG_String&, int, bool, int)
  bool       Open    (const CSG_String &File_Name, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_CHAR);
             ^~~~
../saga_api/api_core.h:955:13: note:   no known conversion for argument 1 from 'const wxScopedWCharBuffer {aka const wxScopedCharTypeBuffer<wchar_t>}' to 'const CSG_String&'
*** Error code 1
...
Comment 1 Ivan Rozhuk 2017-11-20 00:26:13 UTC
Probably this can be fixed by change:

   if( Stream.Open(FileName.GetFullPath().wc_str(), SG_FILE_R) && Stream.Read(Description, Stream.Length()) )

to

   if( Stream.Open(static_cast<const wchar_t*>(FileName.GetFullPath().wc_str()), SG_FILE_R) && Stream.Read(Description, Stream.Length()) )
Comment 2 Ivan Rozhuk 2017-12-06 22:19:15 UTC
Created attachment 188600 [details]
patch to fix

This fix build
Comment 3 Rainer Hurling freebsd_committer freebsd_triage 2017-12-07 08:42:10 UTC
Comment on attachment 188600 [details]
patch to fix

I can confirm, that this patch also builds and runs fine with wxGtk30 3.0.2, the version that is actually in the ports.

Isn't this patch a good candidate for upstream sources?
Comment 4 Ivan Rozhuk 2017-12-07 12:27:33 UTC
(In reply to Rainer Hurling from comment #3)

I think yes, this is just simple type cast.
Can you report it to upstream?
Comment 5 Rainer Hurling freebsd_committer freebsd_triage 2017-12-08 16:47:56 UTC
I suggested the SAGA GIS developers to put your patch upstream and it is already accepted and committed in a slightly different version r6e1444 [1]. This will be integrated in an upcoming SAGA GIS version > 6.1.0.

For the case, that x11-toolkits/wxgtk30 will be updated to version 3.0.3.1, before SAGA GIS 6.2.0 is out, we should use r6e1444 as a patch under files in the FreeBSD port. I will try to keep an eye on it.

Many thanks again for pointing this up.


[1] https://sourceforge.net/p/saga-gis/code/ci/6e14443b30ce2c8e284617840bc49e249c63afc1/
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-01-21 02:22:37 UTC
A commit references this bug:

Author: jbeich
Date: Sun Jan 21 02:22:17 UTC 2018
New revision: 459566
URL: https://svnweb.freebsd.org/changeset/ports/459566

Log:
  math/saga: unbreak build with wxWidgets 3.0.3

  wksp_tool.cpp: In member function 'virtual wxString CWKSP_Tool::Get_Description()':
  wksp_tool.cpp:159:61: error: no matching function for call to 'CSG_File::Open(const wxScopedWCharBuffer, ESG_File_Flags_Open)'
     if( Stream.Open(FileName.GetFullPath().wc_str(), SG_FILE_R) && Stream.Read(Description, Stream.Length()) )
                                                               ^
  In file included from ../saga_api/geo_tools.h:77:0,
                   from ../saga_api/mat_tools.h:77,
                   from ../saga_api/dataobject.h:84,
                   from ../saga_api/table.h:77,
                   from ../saga_api/grid.h:77,
                   from ../saga_api/parameters.h:77,
                   from ../saga_api/tool.h:76,
                   from ../saga_api/tool_library.h:77,
                   from ../saga_api/saga_api.h:118,
                   from res_commands.h:78,
                   from wksp_tool.cpp:67:
  ../saga_api/api_core.h:955:13: note: candidate: bool CSG_File::Open(const CSG_String&, int, bool, int)
    bool       Open    (const CSG_String &File_Name, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_CHAR);
               ^~~~
  ../saga_api/api_core.h:955:13: note:   no known conversion for argument 1 from 'const wxScopedWCharBuffer {aka const wxScopedCharTypeBuffer<wchar_t>}' to 'const CSG_String&'
  wksp_tool.cpp:166:61: error: no matching function for call to 'CSG_File::Open(const wxScopedWCharBuffer, ESG_File_Flags_Open)'
     if( Stream.Open(FileName.GetFullPath().wc_str(), SG_FILE_R) && Stream.Read(Description, Stream.Length()) )
                                                               ^
  In file included from ../saga_api/geo_tools.h:77:0,
                   from ../saga_api/mat_tools.h:77,
                   from ../saga_api/dataobject.h:84,
                   from ../saga_api/table.h:77,
                   from ../saga_api/grid.h:77,
                   from ../saga_api/parameters.h:77,
                   from ../saga_api/tool.h:76,
                   from ../saga_api/tool_library.h:77,
                   from ../saga_api/saga_api.h:118,
                   from res_commands.h:78,
                   from wksp_tool.cpp:67:
  ../saga_api/api_core.h:955:13: note: candidate: bool CSG_File::Open(const CSG_String&, int, bool, int)
    bool       Open    (const CSG_String &File_Name, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_CHAR);
               ^~~~
  ../saga_api/api_core.h:955:13: note:   no known conversion for argument 1 from 'const wxScopedWCharBuffer {aka const wxScopedCharTypeBuffer<wchar_t>}' to 'const CSG_String&'

  PR:		223758
  Submitted by:	rozhuk.im@gmail.com
  Obtained from:	upstream
  Approved by:	Rainer Hurling (maintainer)

Changes:
  head/math/saga/Makefile
  head/math/saga/files/patch-git_6e14443b30ce
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-01-21 02:23:41 UTC
A commit references this bug:

Author: jbeich
Date: Sun Jan 21 02:22:42 UTC 2018
New revision: 459567
URL: https://svnweb.freebsd.org/changeset/ports/459567

Log:
  security/veracrypt: unbreak build with wxWidgets 3.0.3

  TextUserInterface.cpp:122:5: error: const_cast from 'const wxScopedWCharBuffer' (aka 'const wxScopedCharTypeBuffer<wchar_t>') to 'wchar_t *' is not allowed
                                  const_cast <wchar_t *> (passwordStr.wc_str())[i] = L'X';
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  PR:		223758
  Submitted by:	rozhuk.im@gmail.com
  Approved by:	maintainer timeout (2 months)

Changes:
  head/security/veracrypt/Makefile
  head/security/veracrypt/files/patch-src_Main_TextUserInterface.cpp
Comment 8 Jan Beich freebsd_committer freebsd_triage 2018-01-21 02:25:26 UTC
Thanks. Landed. It appears I've typo'd PR number in comment 7.
Comment 9 Jan Beich freebsd_committer freebsd_triage 2018-01-21 03:02:02 UTC
And comment 6 wasn't enough: https://clbin.com/kYl6z

grid_to_kml.cpp: In member function 'bool CGrid_from_KML::Load_Overlay(const wchar_t*, const CSG_MetaData&)':
grid_to_kml.cpp:585:49: error: conversion from 'const wxScopedWCharBuffer {aka const wxScopedCharTypeBuffer<wchar_t>}' to non-scalar type 'CSG_String' requested
  CSG_String   FullPath = fn.GetFullPath().wc_str();
                          ~~~~~~~~~~~~~~~~~~~~~~~^~
Comment 10 Ivan Rozhuk 2018-01-21 15:02:14 UTC
Created attachment 189950 [details]
build fix again

Try now.
Comment 11 Rainer Hurling freebsd_committer freebsd_triage 2018-05-01 18:52:42 UTC
(In reply to rozhuk.im from comment #10)

Thanks for the attachment 189950 [details]. I created an update of math/saga to version 6.3.0 and integrated the patch in bug #227901.
Comment 12 commit-hook freebsd_committer freebsd_triage 2018-05-02 23:33:34 UTC
A commit references this bug:

Author: jbeich
Date: Wed May  2 23:33:20 UTC 2018
New revision: 468893
URL: https://svnweb.freebsd.org/changeset/ports/468893

Log:
  math/saga: unbreak build with wxWidgets 3.0.3 (try#2)

  grid_to_kml.cpp: In member function 'bool CGrid_from_KML::Load_Overlay(const wchar_t*, const CSG_MetaData&)':
  grid_to_kml.cpp:585:49: error: conversion from 'const wxScopedWCharBuffer {aka const wxScopedCharTypeBuffer<wchar_t>}' to non-scalar type 'CSG_String' requested
    CSG_String   FullPath = fn.GetFullPath().wc_str();
                            ~~~~~~~~~~~~~~~~~~~~~~~^~

  PR:		223758
  Submitted by:	rozhuk.im@gmail.com
  Approved by:	Rainer Hurling (maintainer)

Changes:
  head/math/saga/files/patch-src_tools_io_io__grid__image_grid__to__kml.cpp
Comment 13 Jan Beich freebsd_committer freebsd_triage 2018-05-02 23:40:21 UTC
Thanks. Landed. I've initially waited for maintainer approval or upstream review but didn't notice timeout.