Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of wxWidgets 3.1 #726

Closed
VVD opened this issue Jul 19, 2020 · 18 comments
Closed

Support of wxWidgets 3.1 #726

VVD opened this issue Jul 19, 2020 · 18 comments

Comments

@VVD
Copy link

VVD commented Jul 19, 2020

After replace substring "3.0" with "3.1" (wxgtk3u-3.0-config => wxgtk3u-3.1-config and etc.) in several files CMakeLists.txt I got error during build:

/tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/WinPort/src/Backend/WX/wxMain.cpp:87:4: error: cannot pass non-trivial object of type 'const wxScopedWCharBuffer' (aka 'const wxScopedCharTypeBuffer<wchar_t>') to variadic function; expected type from format string was 'wchar_t *' [-Wnon-pod-varargs]
                        file.wc_str(), line, func.wc_str(), cond.wc_str(), msg.wc_str());
                        ^~~~~~~~~~~~~
/tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/WinPort/src/Backend/WX/wxMain.cpp:87:25: error: cannot pass non-trivial object of type 'const wxScopedWCharBuffer' (aka 'const wxScopedCharTypeBuffer<wchar_t>') to variadic function; expected type from format string was 'wchar_t *' [-Wnon-pod-varargs]
                        file.wc_str(), line, func.wc_str(), cond.wc_str(), msg.wc_str());
                                             ^~~~~~~~~~~~~
/tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/WinPort/src/Backend/WX/wxMain.cpp:87:40: error: cannot pass non-trivial object of type 'const wxScopedWCharBuffer' (aka 'const wxScopedCharTypeBuffer<wchar_t>') to variadic function; expected type from format string was 'wchar_t *' [-Wnon-pod-varargs]
                        file.wc_str(), line, func.wc_str(), cond.wc_str(), msg.wc_str());
                                                            ^~~~~~~~~~~~~
/tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/WinPort/src/Backend/WX/wxMain.cpp:87:55: error: cannot pass non-trivial object of type 'const wxScopedWCharBuffer' (aka 'const wxScopedCharTypeBuffer<wchar_t>') to variadic function; expected type from format string was 'wchar_t *' [-Wnon-pod-varargs]
                        file.wc_str(), line, func.wc_str(), cond.wc_str(), msg.wc_str());
                                                                           ^~~~~~~~~~~~
4 errors generated.
@elfmz
Copy link
Owner

elfmz commented Jul 20, 2020

Its not a just compatibility with wx 3.1 problem but with some specific wx build configuration: https://docs.wxwidgets.org/trunk/classwx_string.html#aee28cac512f711f3a41fa3fb3f63d049
Anyway, please try now.

@VVD
Copy link
Author

VVD commented Jul 20, 2020

Thanks.
This error gone.
But I got other error if pick to build with 3.1:

[265/737] cd /tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/far2l/bootstrap/scripts && gm4 -P -DARCH=FreeBSD\ amd64 /tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/far2l/bootstrap/scripts/copyright.inc.m4 | gawk -f /tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/far2l/bootstrap/scripts/enc.awk > /tmp/work/usr/ports/misc/far2l/work/.build/far2l/bootstrap/copyright.inc
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[266/737] cd /tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/far2l/bootstrap/scripts && gm4 -P -DARCH=FreeBSD\ amd64 /tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/far2l/bootstrap/scripts/farversion.inc.m4 > /tmp/work/usr/ports/misc/far2l/work/.build/far2l/bootstrap/farversion.inc
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[267/737] cd /tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/far2l/bootstrap/scripts && gm4 -P -DARCH=FreeBSD\ amd64 /tmp/work/usr/ports/misc/far2l/work/far2l-43057bd/far2l/bootstrap/scripts/farlang.templ.m4 > /tmp/work/usr/ports/misc/far2l/work/.build/far2l/bootstrap/farlang.templ
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Don't know how it can depends, but with 3.0 build fine…

@VVD
Copy link
Author

VVD commented Jul 20, 2020

vbuild.sh: git log -1 --date=format:'%y/%m/%d' --format=%cd-%h

@VVD
Copy link
Author

VVD commented Jul 20, 2020

During build with 3.0 it show the same errors, but build didn't stopped…

@VVD
Copy link
Author

VVD commented Jul 20, 2020

This is correct error:

lpLNGOutputPath=/tmp/work/usr/ports/misc/far2l/work/.build/far2l/bootstrap
Failed to remove file: './lngd9b4.tmp' errno 2
Failed to remove file: './lngd9b5.tmp' errno 2
Failed to remove file: './lngd9b6.tmp' errno 2
Failed to remove file: './lngd9b7.tmp' errno 2
Failed to remove file: './lngd9b8.tmp' errno 2
Failed to remove file: './lngd9b9.tmp' errno 2
Failed to remove file: './lngd9ba.tmp' errno 2
Failed to remove file: './lngd9b3.tmp' errno 2
Segmentation fault (core dumped)
ninja: build stopped: subcommand failed.
*** Error code 1

Core dumped /tmp/work/usr/ports/misc/far2l/work/.build/tools/farlng:

Reading symbols from /tmp/work/usr/ports/misc/far2l/work/.build/tools/farlng...
[New LWP 101153]
Core was generated by `/tmp/work/usr/ports/misc/far2l/work/.build/tools/farlng generator -nc -i /tmp/wo'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000800ed8430 in ?? () from /usr/local/lib/libwx_baseu-3.1.so.3
(gdb) bt
#0  0x0000000800ed8430 in  () at /usr/local/lib/libwx_baseu-3.1.so.3
#1  0x0000000800f714b8 in wxHashTableBase::DoDelete(wxString const&, long) () at /usr/local/lib/libwx_baseu-3.1.so.3
#2  0x0000000800f8e353 in wxClassInfo::Unregister() () at /usr/local/lib/libwx_baseu-3.1.so.3
#3  0x0000000800f8e2e7 in wxClassInfo::~wxClassInfo() () at /usr/local/lib/libwx_baseu-3.1.so.3
#4  0x000000080122a181 in __cxa_finalize () at /lib/libc.so.7
#5  0x00000008009fc023 in  () at /usr/local/lib/libwx_gtk3u_core-3.1.so.3
#6  0x00007fffffffe060 in  ()
#7  0x0000000800d305b5 in _fini () at /usr/local/lib/libwx_gtk3u_core-3.1.so.3
#8  0x00007fffffffe060 in  ()
#9  0x000000080044e8a3 in  () at /libexec/ld-elf.so.1
#10 0x0000000800472800 in  ()

@elfmz
Copy link
Owner

elfmz commented Jul 20, 2020

check branch wx31
also do full cmake configure in clean build directory before bulding, to avoid broken build due to prev broken farlng

@VVD
Copy link
Author

VVD commented Jul 21, 2020

Thanks!
Branch wx31 need several patches to build on FreeBSD:

--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -37,10 +37,6 @@
        set(FARFTP "NO")
 endif()
 
-if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-    set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
-    set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.0")
-endif()
 
 if (NOT ${USEWX})
        set(USEWX_INCS "")
@@ -207,7 +203,9 @@
 install(DIRECTORY "${INSTALL_DIR}/" DESTINATION "lib/far2l" USE_SOURCE_PERMISSIONS FILES_MATCHING 
     PATTERN "colorer/base" EXCLUDE 
     PATTERN "plug/*.far-plug-*"
-    PATTERN "plug/*.broker")
+    PATTERN "plug/*.broker"
+    PATTERN "far2l_askpass"
+    PATTERN "far2l_sudoapp")
 
 install(DIRECTORY "${INSTALL_DIR}/" DESTINATION "share/far2l" USE_SOURCE_PERMISSIONS FILES_MATCHING 
     PATTERN "far2l" EXCLUDE 
@@ -219,9 +217,7 @@
 
 # setup some symlinks and remove deprecated stuff from previous installation
 install(CODE "
-      execute_process(COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/bin/far2l ${CMAKE_INSTALL_PREFIX}/lib/far2l/far2l_askpass)
-      execute_process(COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/bin/far2l ${CMAKE_INSTALL_PREFIX}/lib/far2l/far2l_sudoapp)
-      execute_process(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/objinfo/plug/objinfo.far-plug-mb)
+      execute_process(COMMAND rm -f ${INSTALL_DIR}/lib/far2l/Plugins/objinfo/plug/objinfo.far-plug-mb)
       "
     )
 
--- far2l/CMakeLists.txt.orig
+++ far2l/CMakeLists.txt
@@ -166,9 +166,6 @@
 
 add_dependencies(far2l bootstrap)
 
-if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-    set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
-endif()
 
 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     find_package(wxWidgets REQUIRED net core base)
@@ -194,8 +191,8 @@
 add_custom_command(TARGET far2l POST_BUILD
    COMMAND rm ${INSTALL_DIR}/far2l_askpass || echo ""
    COMMAND rm ${INSTALL_DIR}/far2l_sudoapp || echo ""
-   COMMAND ln -s far2l ${INSTALL_DIR}/far2l_askpass
-   COMMAND ln -s far2l ${INSTALL_DIR}/far2l_sudoapp)
+   COMMAND ln -s ../../bin/far2l ${INSTALL_DIR}/far2l_askpass
+   COMMAND ln -s ../../bin/far2l ${INSTALL_DIR}/far2l_sudoapp)
 
 
 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
--- WinPort/CMakeLists.txt.orig
+++ WinPort/CMakeLists.txt
@@ -3,10 +3,6 @@
 
 find_package(PkgConfig REQUIRED)
 
-if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-    set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
-    set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.0")
-endif()
 
 if (${USEWX})
        find_package(wxWidgets REQUIRED net core base)
--- WinPort/src/APIFSNotify.cpp.orig    2020-06-22 23:39:14 UTC
+++ WinPort/src/APIFSNotify.cpp
@@ -6,6 +6,7 @@
 #include <thread>
 #include <condition_variable>
 #if defined(__APPLE__) || defined(__FreeBSD__)
+# include <sys/types.h>
 # include <sys/event.h>
 # include <sys/time.h>
 #elif !defined(__CYGWIN__)
--- cmake/modules/FindLibsmbclient.cmake.orig   2020-06-22 23:39:14 UTC
+++ cmake/modules/FindLibsmbclient.cmake
@@ -21,23 +21,17 @@ else (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_
   find_path(LIBSMBCLIENT_INCLUDE_DIR
     NAMES
       libsmbclient.h
-    PATHS
-      /usr/include
-      /usr/local/include
-      /opt/local/include
-      /sw/include
     PATH_SUFFIXES
       samba-4.0
+      samba4
   )
 
   find_library(SMBCLIENT_LIBRARY
     NAMES
       smbclient
-    PATHS
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
+    PATH_SUFFIXES
+      samba-4.0
+      samba4
   )
 
   if (SMBCLIENT_LIBRARY)

And it work fine now!

@VVD
Copy link
Author

VVD commented Jul 23, 2020

also do full cmake configure in clean build directory before bulding, to avoid broken build due to prev broken farlng

I remove directory and unpack sources every time before build.

@VVD
Copy link
Author

VVD commented Jul 26, 2020

I edited patch (with CMakeLists.txt files) in previous comment.
Far2l from branch wx31 with "my" patches build and work fine with both - wx 3.0 and 3.1 on FreeBSD 12.1 amd64.

Why do you install far2l_askpass and far2l_sudoapp direct to /usr/ instead of INSTALL_DIR?
And why in lib/far2l instead of bin?

Please, commit patches to master and make new tag - we can use it for update port for FreeBSD.

@elfmz
Copy link
Owner

elfmz commented Aug 2, 2020

eventually i've install freebsd with GUI and applied your changes (and some extra fix for farlng) and found that removing hardcoded pathes to wxgtk3u-3.0-config/wxrc-gtk3u-3.0 breaks cmake
Instead, replacing wxgtk3u-3.0-config with wxgtk3u-3.1-config/wxrc-gtk3u-3.1 works perfectly.
So what in doing wrong?

@elfmz
Copy link
Owner

elfmz commented Aug 3, 2020

Looks like i have reproducing this issue https://gitlab.kitware.com/cmake/cmake/-/issues/19372
so i'll returned that workaround and made it prefer wx3.1 if its there
So plz check if wx31 branch is fine for you in current state then i'll merge it into master

@elfmz
Copy link
Owner

elfmz commented Aug 3, 2020

also i removed redirection of far2l_sudoapp symlink to ../../bin/far2l cuz it breaks no-install behavior
is this strictly needed?
Regarding symlink and other files locations, there was long discussion: #84 ...

@elfmz
Copy link
Owner

elfmz commented Aug 3, 2020

see all at once here: #730

@elfmz
Copy link
Owner

elfmz commented Aug 22, 2020

silence means acceptance.. reopen if not

@elfmz elfmz closed this as completed Aug 22, 2020
@VVD
Copy link
Author

VVD commented Aug 22, 2020

Sorry, I'll find time to test and will write feedback.

@VVD
Copy link
Author

VVD commented Sep 12, 2020

Should I work with master or wx31 branch?

@elfmz
Copy link
Owner

elfmz commented Sep 18, 2020

now its in master

@VVD
Copy link
Author

VVD commented Oct 23, 2020

Thanks it work fine with wxWidgets 3.1 on FreeBSD now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants