Linux Blitzmax-Editor

Archives Forums/Linux Discussion/Linux Blitzmax-Editor

Derron(Posted 2012) [#1]
Ok, like posted in other threads, i have done some small changes to geany, a texteditor using gtk.

Screen first :D



I included syntax highlighing and code folding (added a new lexer to the scintilla source of geany), also there is an customizable way to include the blitzmax compiler.

https://github.com/GWRon/geany

feel free to download it.

Build:
"./autogen.sh"
"sudo make install"

So be able to customize the compiler paths without working in /usr/.. - and therefor to survive distribution reinstalls :D

~/.config/geany/filedefs/filetypes.blitzmax

[build-menu]
FT_00_LB=_Compile & Run
FT_00_CM=./bmk makeapp -x -r "%d/%f"
FT_00_WD=~/YOURDIR/BlitzMax/bin
FT_01_LB=_Compile & Run (DEBUG)
FT_01_CM=./bmk makeapp -x -d "%d/%f"
FT_01_WD=~/YOURDIR/BlitzMax/bin
FT_02_LB=_Compile & Run (Threaded)
FT_02_CM=./bmk makeapp -x -r -h "%d/%f"
FT_02_WD=~/YOURDIR/BlitzMax/bin
FT_03_LB=Compile & Run (Threaded DEBUG)
FT_03_CM=./bmk makeapp -x -d -h "%d/%f"
FT_03_WD=~/YOURDIR/BlitzMax/bin

error_regex=[(.+);([0-9]+);[0-9]+

[build_settings]
compiler="~/YOURPATHTOBLITZMAX/bin/bmk" makeapp -d -o "%e.debug" "%f"
linker="~/YOURPATHTOBLITZMAX/bin/bmk" makeapp -r -o "%e" "%f"
run_cmd="./%e"


- of course you should replace the path with yours...



Additionally there is now also a BlitzMax-Geany-Plugin:
https://github.com/GWRon/blitzmax-geany-plugin

It adds the sophisticated drop down widgets to the toolbar (release, debug, threaded ...), hides the default compiler buttons and some over thingies.
If you decide edit a file which is .... c, php, ... the drop downs will be hidden and the compiler buttons get replaced with the default ones.

Sounds more complicated than it is... just compile/install the plugin and if you enabled and configured (blitzmax path) it correctly you just have to press F9 to compile/execute your blitzmax file (or press the button if you like mouse cursors wandering around).


Especially @Brucey: The addon isn't in the best state now (I just know a little about c and make/configure/bla) but it is really easy to do the following:
Add an dropdown list containing all open files and a "automatic" selection, if no selection is done, the "compilation" uses the currently active document, else the one you selected. So you could edit other files but "F9"/compiler-button will just compile the preselected file.
- This could of course be extended for the project manager (compile "main file").

Ok, lets see if there are some of you interested in it.


PS: requirement is GTK (sorry QT guys).
PPS: It should also be compileable under windows/mac - but I will look at windows later (xmas party of one of my clients starts soon :D)


bye
Ron

Last edited 2012


Captain Wicker (crazy hillbilly)(Posted 2012) [#2]
How to install?


Derron(Posted 2012) [#3]
like stated above...

download source, install necessary libs and so on... but for you, the sometimes lazy forum member...

http://www.geany.org/Support/BuildingFromSource
http://www.geany.org/Support/CrossCompile
etc.

should be something like

sudo apt-get install build-essential make autoconf automake1.9 libtool libgtk-dev libglib2.0-dev



then ... follow the above posting (autogen, make install).


bye
Ron

Last edited 2012


Derron(Posted 2012) [#4]
like stated above...

download source, install necessary libs and so on... but for you, the sometimes lazy forum member...

http://www.geany.org/Support/BuildingFromSource
http://www.geany.org/Support/CrossCompile
etc.

should be something like

sudo apt-get install build-essential make autoconf automake1.9 libtool libgtk-dev libglib2.0-dev



then ... follow the above posting (autogen, make install).

for the plugin:

sudo apt-get install libgtk2.0-dev intltool



bye
Ron


edit: added plugin deps

Last edited 2012


Brucey(Posted 2012) [#5]
It's dangerous to make people have to compile stuff ;-)

You'd be surprised how difficult it is for some of the BlitzMax coders, actually. It's easy to assume everyone is a nerdy coder like you or may, but it's not the case for the majority, I think.

That's why there are so many questions about how to do this or that on Linux…
..and what can you do about it? Well, not much, apart from provide an installer - but you know that is going to be a nightmare... so… :-)


Derron(Posted 2012) [#6]
... checkinstall and you get an easy to install .deb for the debianers (ubuntu...).


There are some bugs to clean before I would build some .deb (open geany without open files... drop down is displayed -> seems the file check is not assurance enough) also the default colors are awful.

I used to use an 0.2x-build with different colors for my php-syntax. now you get odd ones... *frosty shaking*. But they use "default" settings, so it is laying around in the gtk-rc settings.


Hope you got it compiled :p.


bye
Ron


Captain Wicker (crazy hillbilly)(Posted 2012) [#7]
I have already sudo-ed those packages, but the terminal just closes when running the autogen.sh script. :-(


Brucey(Posted 2012) [#8]
Try running it from a terminal, and not starting it from the finder/explorer/whatever you call it.

Then you should see the error message.
Probably you need to install something else.


Derron(Posted 2012) [#9]
I successfully build a amd64.deb for the editor.

But I did not find easy ways to build the deb for a .so ("dll") file -> the geany plugin.

So the easiest way is to:

- open filebrowser, move into src target - press CTRL+L (opens directory-input-field), press CTRL+C

- open terminal
- enter "cd " (with space at the end) and then press CTRL+SHIFT+V (or rightclick - paste)
- press return
- enter "sudo chmod +x autogen.sh" (and enter password) - or rightclick on that file in the file explorer and enable "executable" (depends on the file browser)
- enter "sudo make install"

if everything went ok... you got it installed.

PS: same for the plugin (it produces a ".so"-file and places it into the geany-lib-directory)


bye
Ron


Captain Wicker (crazy hillbilly)(Posted 2012) [#10]
Are you planning on uploading the debs to github?


Derron(Posted 2012) [#11]
Are you planning on uploading the debs to github?


not really, as editor alone is only 50% of the rent.

Just do what I have written in prior postings... and if something is missing, install that libraries.


bye
Ron


edit: I am just saying this as it (editor and plugin) still miss features and I am sure they have bugs. There is no need for people to "test" and report... there is need for people to test, bugfix and extend. Such people will surely be able to fiddle around with source codes.
Just saves headaches of giving support in such early stages

Last edited 2012


Captain Wicker (crazy hillbilly)(Posted 2012) [#12]
I finally got this working. Is there a way to build this for Mac?

EDIT: the syntax highlighting for bmx files is working. I get this when trying to compile.
"home/mark/Desktop/BlitzMax/bin/bmk" makeapp -d -o "glblurr.debug" "glblurr.bmx" (in directory: /home/austin/Desktop/BlitzMax/samples/birdie/misc/glblur)
Compilation Failed.
/bin/sh: home/austin/Desktop/BlitzMax/bin/bmk: not found


Last edited 2012


Brucey(Posted 2012) [#13]
You need a "/" in front of home.


Derron(Posted 2012) [#14]
The "/" at the beginning of paths states that it is an absolute uri and not a "subdirectory"

I was not able to use "~" (shortcut to your personal /home/mark/) - think something is not working as intended on linux but I do not care much.


bye
Ron

PS: Remember - every highlighting-keyword can be overridden using your custom /home/mark/.config/geany/filedefs/filetypes.blitzmax aka ~/.config/geany/filedefs/filetypes.blitzmax


Brucey(Posted 2012) [#15]
think something is not working as intended on linux

It is working fine. "~" is only intended for the console, where it is translated on-the-fly by whatever shell you are running inside.
To use in applications needs specific support to convert it to whatever is $HOME, I presume.


Derron(Posted 2012) [#16]
I thought that too - and this was way to much hassle for me - as the absolute path was working as intended.
If one wants to add support for "~" he can freely add it and push the changes to my git.

Same for the "no document = showing the blitzmax-dropdown"-bug

bye
Ron


dawlane(Posted 2012) [#17]
@Derron: Have you tried to pass your home directory using the $(HOME) system variable in the filetypes? Like so
[build_settings]
compiler="$HOME/programs/BlitzMax/bin/bmk" makeapp -d -o "%e.debug" "%f"
linker="$HOME/programs/BlitzMax/bin/bmk" makeapp -r -o "%e" "%f"
run_cmd="./%e"

Edit:
Another way to do it would be add the max path to the hidden .profile found in the home directory and just call /bin/bmk. But using a system string is much easier.

Last edited 2013


Derron(Posted 2012) [#18]
blitzmax is a "portable app" - there we go for absolute paths. So it is easy as cake to use multiple versions of blitzmax (if you whished).

Yes I thought about the "$(home)" - thing but I hmm why didn't I use that... well... aehm maybe others use absolute paths too :p

Maybe be because normally binaries are not installed in home directories but /usr/local/bin or /usr/bin (if managed installation).


bye
Ron

PS: thanks for your addition.


Brucey(Posted 2012) [#19]
And you can certainly never have too many versions of BlitzMax lying around! :-)


Derron(Posted 2012) [#20]
or different bmk-generations...


bye
Ron

edit: if you don't mind brucey: if I were you I wouldn't have the time to post here ... back to wxmax/qt-work ... I am awaiting a firework of new blitzmax-toys for new years eve.

Last edited 2012


Brucey(Posted 2012) [#21]
Well, I tend to stick with the Next Generation ;-)

edit: As it happens, I am waiting for a build... to build... QtMax takes a while to build when running in the VM :-/
But yes, I only go on the forum when I am not busy... unlike most of the General Discussion folks who never seem to be busy!

I've just implemented the QItemSelectionModel (and friends), and I am hopeful that I will now be able to programmatically select a row in a listview now. (fingers crossed, etc)
If all is well, this line will actually do something :
SelectGadgetItem listbox,1


Last edited 2012


Derron(Posted 2012) [#22]
I am using it here too (for version-ating).
But if you miss some of the special files in the bmk-directory you may end up searching 1-2 hours for the solution of a non-working-bmk.


But yes I truly agree: TNG was the best.


bye
Ron


dawlane(Posted 2012) [#23]
Maybe be because normally binaries are not installed in home directories but /usr/local/bin or /usr/bin (if managed installation).

Well as I'm a masochist and I'm bored. I'll see what it takes to get BliztMax to work in a Linux multi-user environment.

But for your average Joe Bloggs (i.e Wicker). Placing portable applications in there home folder is the simple solution.

And you can certainly never have too many versions of BlitzMax lying around! :-)
I prefer just to have the latest and not clutter my hard drive up as it's cluttered enough as it is. If the newest breaks my code then I fix my code, unless there's one hell of a bug in the latest version of max then I just do a roll back.


Brucey(Posted 2012) [#24]
The best part, IMO, is the threaded C/C++ compiling. But then I tend to be rebuilding modules a lot, so it's more useful for me than most, I think.


Derron(Posted 2012) [#25]
But compiling wxmax etc takes still around 10 minutes..

@dawlane: the easiest way for geany-integration is to place individual ~/.config/geany/filedefs/filetype.blitzmax configurations.
So it is indivual for each user and should work as intended.
Blitzmax itself should be runnable in a /usr/local/bin or /opt/blitzmax (like lampp installs want it) - why not?

bye
Ron

edit:
@dawlane 2:
You can do "wicker and friends" a favor of building some debs - i used to use checkinstall but this isnt the proper solution and the "d_make"-solution modifys the configure-script of "autogen" and that troubles further compilations.

Last edited 2012


dawlane(Posted 2013) [#26]
Blitzmax itself should be runnable in a /usr/local/bin or /opt/blitzmax (like lampp installs want it) - why not?
It does, but then it's a question of file privileges, who has access to what and what goes where, system links etc. This isn't so bad if if there's only the one user that will use BMax as you could place it any where you want, set the file permissions and add a few system links in the /usr/bin etc.

It could even be done for a multi-user set up as long as the license allows it and as long as those tools where the source code isn't supplied, aren't hard coded to look for directories or files in the default BMax directory structure, as it would be nice for security reasons to have certain directories/files located within the user's own home directory.
Off course this type of set up would require modifying bmk etc to scan for those directories.

It should even be possible to have more than one version installed using a script passing the usual bmk build commands and a version number and the invoking the right bmk. Of course if if your not using the comman line you would have to take this into consideration or write another script doing the same for the IDE or rebuilding the IDE to allow this.

You can do "wicker and friends" a favor of building some debs - i used to use checkinstall but this isnt the proper solution and the "d_make"-solution modifys the configure-script of "autogen" and that troubles further compilations.
Well I'll have ago when my hangover clears and I would have to get reacquainted with those tools as I haven't messed around building .debs for a few years.


Derron(Posted 2013) [#27]
Problem with the licence may only occour if remote-login is done.
As long as only one concurrent user is logged in he should be able to use blitzmax without breaking a licence (you can sell your licence so you can share it - as long as you do not use it simultaneously).
Otherwise: None prohibits providing a "build service" (you upload source, i give you back an binary or an outputlog in case of errors).

you could also code a wrapper - this wrapper is placed into the /usr/bin/-thingy and knows about the user storing the real blitzmax.
/usr/bin/bmk is a custom application redirecting things to
/home/myuser/programmingtools/blitzmax/bin/bmk

I cannot imagine that this behaviour is intended but it does not seem to be prohibited.


bye
Ron

PS: before going to bed, just drink a litre of water - helps against hangover the next day. Most problematic: most times you forget drinking that water :D