Build wxPython on Ubuntu 17.10

On Ubuntu 16.04, wxPython can be installed via the following commands.
sudo apt update
sudo apt-get -y install python3-pip
sudo pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython
sudo apt-get install libsdl-ttf2.0-0

There is no wxPython release for Ubuntu 17.10 yes, the ubuntu-16.04 is not compatible. I used the following commands to build wxPython.
sudo apt install pkg-config libgtk-3-dev libwebkitgtk-3.0-dev freeglut3-dev libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev
sudo apt install libsm-dev libnotify-dev libsdl2-dev libtiff5-dev libjpeg-dev libgstreamer-plugins-base1.0-dev libqt5gstreamer-dev libboost1.62-dev
sudo apt-get install python3-venv

follow instructions on this page
cd ~/tmp
python3 -m venv builder_py
source builder_py/bin/activate
pip3 install -U pip six wheel setuptools
pip3 download wxPython
pip3 wheel -v wxPython-4.0.1.tar.gz 2>&1 | tee build.log

outside the virtualenv:
pip3 install ~/tmp/wxPython-4.0.1-cp36-cp36m-linux_x86_64.whl

Advertisements
Posted in Uncategorized | Leave a comment

build gede

build gede on Ubuntu 16.04 xenial with Qt5.8

Install qt-unified-linux-x64-2.0.5-2-online.run
Download gede-2.0.3.tar.xz from http://acidron.com/gede/pmwiki.php?n=Downloads.Releases
tar xf gede-2.0.3.tar.xz
cd ~/oss/gede-2.0.3/src
~/Qt/5.8/gcc_64/bin/qmake
Info: creating stash file ~/oss/gede-2.0.3/src/.qmake.stash
~/oss/gede-2.0.3/src$ make

Posted in CPP, GUI, QT | Leave a comment

Build tea editor

Build tea on macOS sierra

Install qt5: brew install qt5
download tea source code from https://github.com/psemiletov/tea-qt
unzip ~/Downloads/tea-qt-master.zip
cd tea-qt-master
/usr/local/Cellar/qt/5.8.0_2/bin/qmake
make
cp -r bin/tea.app /Applications
add /Applications/tea.app/Contents/MacOS to PATH environment variable in ~/.profile

Build tea on Ubuntu 16.04 xenial

Install qt-unified-linux-x64-2.0.5-2-online.run
sudo apt-get install mesa-common-dev
sudo apt-get install libglu1-mesa-dev
cd tea-qt-master/
~/Qt/5.8/gcc_64/bin/qmake
Info: creating stash file ~/oss/tea-qt-master/.qmake.stash
Project MESSAGE:
Project MESSAGE:
Project MESSAGE:
make

Posted in CPP, macOS, Open Source, QT | Leave a comment

wxBoxSizer Horizontal alignment flags are ignored with wxEXPAND

Newer version of wxWidgets reports error:

ASSERT INFO:
 ./src/common/sizer.cpp(2091): assert "!(flags & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL))" failed in DoInsert(): Horizontal alignment flags are ignored with wxEXPAND

BACKTRACE:
[1] wxBoxSizer::DoInsert(unsigned long, wxSizerItem*)
[2] WXMSearchReplaceDialog::WXMSearchReplaceDialog(wxWindow*, int, wxPoint const&, wxSize const&) …

wxBoxSizer* BoxSizer2;
BoxSizer2 = new wxBoxSizer(wxVERTICAL);
BoxSizer2->Add(BoxSizer4, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);

The fix is removing both like the following:

BoxSizer2->Add(BoxSizer4, 1, wxALL|wxEXPAND, 0);

Another change:

StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, Panel3, _(“Text Mode”));
StaticBoxSizer1->Add(WxCheckBoxPrintSyntax, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 1); // remove |wxALIGN_CENTER_VERTICAL

To build wxMEdit-3.1.tar.gz with wxWidgets-3.1.0.tar.bz2:

./configure --with-wx-config=~/oss/wxWidgets-3.1.0/wx-config

There is one place need change:

unsigned long FilePathHash(const wxString& name)
{
 return wxStringHash::stringHash(FilePathNormalCase(name).wc_str());
}
Posted in CPP, GUI, Open Source | Leave a comment

Solution to valgrind: failed to start tool memcheck/callgrind

Background: I need to run memcheck/callgrind on a system without privilege to install software, so I build valgrind from source code.

Valgrind-3.12.0.tar.bz2 on Ubuntu 14.04 trusty
tar xf valgrind-3.12.0.tar.bz2
./configure
make
onegazhang@trusty:~/oss/valgrind-3.12.0$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0 coregrind/valgrind
valgrind: failed to start tool ‘memcheck’ for platform ‘amd64-linux’: No such file or directory

The solution is passing VALGRIND_LIB environment variable to valgrind.
onegazhang@trusty:~/oss/valgrind-3.12.0$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0/memcheck coregrind/valgrind
valgrind: no program specified
valgrind: Use –help for more information.

callgrind tool reported another error: ERROR: ld.so: object ‘/home/onegazhang/oss/valgrind-3.12.0/callgrind/vgpreload_core-amd64-linux.so’ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. It is fixed by copying the library to desired location.

onegazhang@trusty:~/oss/valgrind-3.12.0$ cp -p /home/onegazhang/oss/valgrind-3.12.0/coregrind/vgpreload_core-amd64-linux.so /home/onegazhang/oss/valgrind-3.12.0/callgrind

Then callgrind works in the same way as memcheck.

onegazhang@trusty:~/workspace$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0/callgrind /home/onegazhang/oss/valgrind-3.12.0/coregrind/valgrind –tool=callgrind ./memleak

Btw, the above procedure also worked on arm platform.

Posted in CPP, debug, Open Source | Leave a comment

Install PyDev5.7.0.zip Eclipse Plugin

I failed to install PyDev5.7 Eclipse plugin on Ubuntu 16.04 guest OS hosted by macOS sierra. Can’t access MarketPlace, can’t install by adding url to update site. fortunately there is 3rd way: unzip PyDev5.7.0.zip to eclipse/dropins folder. Eclipse version is eclipse-cpp-neon-3-linux-gtk-x86_64.

Posted in Eclipse, IDE | Leave a comment

Solution to Java program unable to find valid certification path to requested target

On macOS sierra, some Java program encountered error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Popular google answer suggested to use keytool to add certificate to $JAVA_HOME/jre/lib/security/cacerts.This solution probably works on other OS like Ubuntu, but it does not work on macOS sierra. I still got such error after adding certificate to $JAVA_HOME.

The root cause is that the application in trouble does not refer to $JAVA_HOME/jre/lib/security/cacerts, but refer to a file in its own installation path like /Applications/ccollab_client/.install4j/jre.bundle/Contents/Home/jre/lib/security/cacerts. After I added certificate to this place, ccollab software works without problem.

Do a search, we’ll find a few cacerts file outside of $JAVA_HOME.

sudo find / -name cacerts -type f

like /Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/java/lib/security/cacerts

Posted in Java, Uncategorized | Tagged | Leave a comment