Add Linux support #15

pkulchenko opened this Issue Jun 30, 2012 · 14 comments


None yet

2 participants


No description provided.

@pkulchenko pkulchenko was assigned Jun 30, 2012

(from Javier Guerra Giraldez)

it launches! and it shows the tutorial docs, links work, etc.

weird UI issues:

  • there's no menubar. only the same icon buttons as the examples
    plus a "jump to function definition" popup menu
  • after trying to run a demo, the editor window floats on top of any
    other window.
  • hitting the close window corner button doesn't kill it, but the
    terminal shows an error:
Lua: Error while running chunk 
src/editor/commands.lua:499: wxLua: Unable to call an unknown 
method 'ShowFullScreen' on a 'wxFrame' type.

(hitting Ctr-C (twice) at the terminal kills it)

execution issues:

  • at first didn't find the Lua executable. no prob, just put a
    ./bin/lua => /usr/bin/lua link
  • the spirograph demo flashes a small window and dies with:
./turtle.lua:338: wxLua: Expected an 'unsigned integer' for parameter
1, but got a 'number'.
Function called: 'wxMilliSleep(number)'
01. wxMilliSleep(integer)
stack traceback:
       (command line):1: in function <(command line):1>
       [C]: in function 'wxMilliSleep'
       ./turtle.lua:338: in function 'wait'
       ./spirograph.lua:33: in function 'spiro'
       ...ack-0.30/myprograms/zerobrane-lessons/05-running.lua:11: in main chunk
       [C]: in function 'dofile'
       (command line):1: in function <(command line):1>
       [C]: in function 'xpcall'
       (command line):1: in main chunk
       [C]: ?
Program completed in 0.12 seconds (pid: 26405).

this seems a (design?) glitch of wxLua, changing that line from

    else wx.wxMilliSleep(stillneed); return


   else wx.wxMilliSleep(math.floor(stillneed)); return

allows it to run and show some graphs. still not sure if they look as
they should, and it only progresses while there's some events, like
moving the mouse inside the window. if i keep still, the program

in all, not bad for a first try, considering all the (squeaky) moving parts.


@toiffel, I noticed you've been working on Linux support in your fork. I'll be checking in shortly changes that improve Linux compatibility as well as the package to run/deploy on Linux.

toiffel commented Sep 7, 2012

Yeah, I've almost finished cmake-based build system as well as the native starter application. However there are some wxgtk-specific bugs left.
btw do you have a zerobrane icon in svg format? If yes I'll be able to make Linux .desktop file with nice scalable icon which will look great in any DE :)


I took a different path and packaged wxlua as a debian package. This will pull wxwidgets and all other modules as dependencies; you can then launch ZBS as lua src/main.lua zbstudio. I'll provide a shell file that hides these details.

toiffel commented Sep 9, 2012

I've sent an email two days ago but still no reply (double-checked the email address on your website). Maybe it was blocked by spam filter or something else?


Responded over email.

toiffel commented Sep 9, 2012

Thanks! Now I'm able to complete Linux version of CMake script. Next week I'll also try to add Windows/Mac support. This should greatly simplify building and installing ZBS. However all dependencies (wxWidgets, wxLua etc) still need to be compiled manually; maybe I'll write a simple bash script to automate this.


@toiffel, I'm slightly confused. I don't plan to have a compiled launcher for linux or mac. Users should be able to run lua src/main.lua zbstudio to get ZBS started. I'll provide a shell file to simplify launching, but I plan to avoid any building process as you should be able to run from repo clone or a package (dmg, deb, etc.)

The windows version is a bit different as the executable also includes icons and provides a more convenient way than a batch file.

The setup for Mac is already checked in; you can see it in macos-build branch. It is a bit more involved, but mostly because of Mac .app format. The linux version should be simpler; as long as you have wxwidgets and wxlua setup, you should be able to run src/main.lua to get the IDE. I'll provide assistance with getting wxlua and all the dependencies.

toiffel commented Sep 10, 2012

I don't see any problem here. Users will always be able to run IDE with lua src/main.lua zbstudio if they want to. However the most preferred way is just download the ready-to-use package (zip, dmg, deb) from Downloads section and run the compiled executable. Building from source is only intended for developers and linux maintainers, not for ordinary users.

The compiled launcher has some advantages over the shell script: on Linux it can show nice wxWidgets error dialog (instead of printing to terminal and dying), also having a binary executable is conventional for GUI apps and it's more consistent across all platforms. I think it should be left as an option for advanced users and developers.


Added several commits for Linux support:
0f14a54: Updated configuring toolbar size to improve Linux compatibility.
4685fed: Updated cpath processing to allow Linux version to run side-by-side with Windows and Mac.
985b2c2: Fixed an issue with loading stock icons on Linux.

@pkulchenko pkulchenko added a commit that referenced this issue Sep 11, 2012
@pkulchenko Added wxlua.deb file and install script that pull and build all requi…
…red dependencies on Linux (covers most of #15).

@toiffel, make sense. I just pushed linux updates, that should pull all wxlua dependencies (build/ Give it a try.

toiffel commented Sep 11, 2012

Well done! :) I've seamlessly installed the dependencies package on fresh Ubuntu 12.04.1 installation (only had to run chmod +x I've also posted the most annoying linux-specific issues.


Some known Linux issues:

  • (fixed) #47 (Linux) Context menu in the editor window doesn't work
  • (fixed) #46 (Linux) Edit-Paste menu item is always enabled
  • (fixed) #49 (Linux) Mouse cursor doesn't get updated after dragging the slider in scratchpad mode
  • IDLE events are not triggered unless some other event is also triggered (this breaks debugging of wxwindows apps)
  • Multiple tooltips are occasionally shown during debugging
  • Several GLIB warnings are shown after the app exist: "LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent"; appears to be a known issue fixed in wxwidgets 2.9.4
  • Another Glib warning (also when app exits): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `'
  • And another (also when app exits): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  • '>' is colored a bit incorrectly in the console
@pkulchenko pkulchenko added a commit that referenced this issue Sep 13, 2012
@pkulchenko Fixed multiple calltips shown on Linux (helps #15).
On Linux DWELLSTART event seems to be generated even for those editor
windows that are not active. What's worse, when generated the event
seems to report "old" position when retrieved using event:GetX and
event:GetY, so instead we use wxGetMousePosition.

The current master has been tested to run on Ubuntu 10.04, Ubuntu 12.04, ArchLinux, Fedora 18 (32/64bit); it has also been seen running on Xubuntu 12.10, Gentoo, and Mint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment