From: 有坂富雄 <ari...@ic...> - 2018-05-25 11:56:39
|
On macOS, Fink, MacPorts, and Homebrew are package managers to use open-source softwares. Currently, Fink and MacPorts do not support latest wxMaxima for some reason. I like MacPorts. (https://www.macports.org/) wxWidgets-3.1.1 and other necessary softwares are installed with MacPorts. So I tried to compile wxMaxima-18.02.0 and link it with wxWidgets-3.1.1. As a result: If the location of maxima is not the default (neither "/usr" nor "/usr/local"), then wxMaxima-18.02.0 crashes. Another word, if MaximaDefaultLocation() returns wxT("maxima"), then MaximaLispLocation() causes crash. So that current wxMaxima is not compatible with maxima installed with MacPorts or Fink. (e.g. MacPorts installs maxima to "/opt/local". Fink installs maxima to "/sw".) I don't like this issue. So I made a patch to fix it. How to compile wxMaxima with MacPorts is the following: ---------------------------------------------------------------------- $ sudo port install cmake $ sudo port install wxWidgets-3.2 @3.1.1 $ curl -L -O https://github.com/andrejv/wxmaxima/archive/Version-18.02.0.tar.gz $ tar xf ./Version-18.02.0.tar.gz $ cd ./wxmaxima-Version-18.02.0 $ mkdir ./build $ cd ./build $ cmake .. $ cp -ip ./CMakeCache.txt ./CMakeCache.txt.orig ---------------------------------------------------------------------- Open "CMakeCache.txt" and edit it to change the default location of wxWidgets to wxWidgets-3.1.1: ---------------------------------------------------------------------- $ open -e ./CMakeCache.txt ---------------------------------------------------------------------- The result of editing: (Maybe the following old lines are not the same as yours due to a difference of environment. So you cannot use "patch" command.) ---------------------------------------------------------------------- $ diff -u CMakeCache.txt.orig CMakeCache.txt --- CMakeCache.txt.orig 2018-05-22 18:51:44.000000000 +0900 +++ CMakeCache.txt 2018-05-22 18:58:54.000000000 +0900 @@ -234,7 +234,7 @@ XGETTEXT:FILEPATH=/opt/local/bin/xgettext //Path to a file. -_filename:FILEPATH=/usr/local/include/wx-3.0/wx/version.h +_filename:FILEPATH=/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/include/wx-3.1/wx/version.h //Path to a program. gpg:FILEPATH=gpg-NOTFOUND @@ -249,13 +249,13 @@ sha512sum:FILEPATH=sha512sum-NOTFOUND //Location of wxWidgets library configuration provider binary (wx-config). -wxWidgets_CONFIG_EXECUTABLE:FILEPATH=/usr/local/bin/wx-config +wxWidgets_CONFIG_EXECUTABLE:FILEPATH=/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wx-config //Use debug build? wxWidgets_USE_DEBUG:BOOL=OFF //Location of wxWidgets resource file compiler binary (wxrc) -wxWidgets_wxrc_EXECUTABLE:FILEPATH=/usr/local/bin/wxrc +wxWidgets_wxrc_EXECUTABLE:FILEPATH=/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wxrc //Value Computed by CMake wxmaxima_BINARY_DIR:STATIC=/Users/name/Downloads/wxmaxima-Version-18.02.0/build @@ -422,7 +422,7 @@ //Details about finding Git FIND_PACKAGE_MESSAGE_DETAILS_Git:INTERNAL=[/usr/bin/git][v2.10.1 (Apple Git-78)()] //Details about finding wxWidgets -FIND_PACKAGE_MESSAGE_DETAILS_wxWidgets:INTERNAL=[-L/usr/local/lib;;;-framework IOKit;-framework Carbon;-framework Cocoa;-framework AudioToolbox;-framework System;-framework OpenGL;/usr/local/lib/libwx_osx_cocoau_aui-3.0.a;/usr/local/lib/libwx_osx_cocoau_richtext-3.0.a;/usr/local/lib/libwx_osx_cocoau_xrc-3.0.a;/usr/local/lib/libwx_osx_cocoau_webview-3.0.a;/usr/local/lib/libwx_osx_cocoau_qa-3.0.a;/usr/local/lib/libwx_baseu_net-3.0.a;/usr/local/lib/libwx_osx_cocoau_html-3.0.a;/usr/local/lib/libwx_osx_cocoau_adv-3.0.a;/usr/local/lib/libwx_osx_cocoau_core-3.0.a;/usr/local/lib/libwx_baseu_xml-3.0.a;/usr/local/lib/libwx_baseu-3.0.a;-lpng;-ljpeg;-ltiff;-framework WebKit;-lexpat;-lwxregexu-3.0;-lz;-lpthread;-liconv][/usr/local/lib/wx/include/osx_cocoa-unicode-static-3.0;/usr/local/include/wx-3.0][v3.0.4()] +FIND_PACKAGE_MESSAGE_DETAILS_wxWidgets:INTERNAL=[-L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/lib;;;-framework IOKit;-framework Carbon;-framework Cocoa;-framework AudioToolbox;-framework System;-framework OpenGL;-lwx_osx_cocoau_aui-3.1;-lwx_osx_cocoau_richtext-3.1;-lwx_osx_cocoau_xrc-3.1;-lwx_osx_cocoau_html-3.1;-lwx_osx_cocoau_qa-3.1;-lwx_osx_cocoau_adv-3.1;-lwx_osx_cocoau_core-3.1;-lwx_baseu_xml-3.1;-lwx_baseu_net-3.1;-lwx_baseu-3.1][/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/lib/wx/include/osx_cocoa-unicode-3.1;/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/include/wx-3.1][v3.1.1()] //ADVANCED property for variable: GIT_EXECUTABLE GIT_EXECUTABLE-ADVANCED:INTERNAL=1 //Have includes proc/procps.h ---------------------------------------------------------------------- $ cmake .. $ pushd .. $ cp -ip ./src/Dirstructure.cpp ./src/Dirstructure.cpp.orig ---------------------------------------------------------------------- Open "Dirstructure.cpp" and edit it to fix the issue. ---------------------------------------------------------------------- $ open -e ./src/Dirstructure.cpp ---------------------------------------------------------------------- The result of editing: ---------------------------------------------------------------------- $ diff -u src/Dirstructure.cpp.orig src/Dirstructure.cpp --- src/Dirstructure.cpp.orig 2018-02-17 23:54:32.000000000 +0900 +++ src/Dirstructure.cpp 2018-05-22 19:52:48.000000000 +0900 @@ -249,7 +249,20 @@ else { wxFileName maximaName(result); - maximaName.RemoveLastDir(); + if(maximaName.GetDirCount() > 1) + { + maximaName.RemoveLastDir(); + } + else + { + wxArrayString output; + wxExecute(wxT("which maxima"), output, (wxEXEC_SYNC | wxEXEC_NOEVENTS)); + if(output.GetCount() > 0) + { + wxFileName fullpath = wxFileName::wxFileName(output[0] ,wxPATH_NATIVE); + return fullpath.GetPath(); + } + } return maximaName.GetPath(); } } ---------------------------------------------------------------------- $ popd $ cmake --build . ---------------------------------------------------------------------- As a result, you can get "wxMaxima.app" in the folder "build". I'm not familiar with wxWidgets and wxMaxima. So I hope my patch will be verified. After that I noticed that wxMaxima.app has some issues. (1) When using multi-window, the left side of input panes of the window is broken due to moving the cell cursor. (This has been already reported.) (2) On the configuration dialog, entering a path of maxima is ignored. It seems that wxMaxima always uses the return value of MaximaDefaultLocation(). (So that if you have installed some binaries of Maxima, you cannot choose an arbitrary one of them.) By the way, I'm not a suitable tester for wxMaxima. Because I have not used wxMaxima for a long time. I hope someone who use wxMaxima will help the developers:) Thanks, Tomio Arisaka On 2018-5-24, Gunter Königsmann <gu...@pe...> wrote: > Dear Tomio, > > Since the last release I have changed many things in wxMaxima. > My hope is now that this includes bug fixes for the Mac issues that we > had hoping that this didn't introduce new bugs for the Mac platform => > If you were willing to test if the current state of wxMaxima is working > again for the mac I would be very grateful. > > Thanks for your continued help with the mac, > and > Kind regards, > > Gunter. |