Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Oct 2018, 00:06
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
IUP graphical toolkit (multi-platform and still maintained)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Sun 25 Mar 2018, 02:27    Post subject:  IUP graphical toolkit (multi-platform and still maintained)  

Following my dev work on this, dotpets and docs can now be found via following link:

http://murga-linux.com/puppy/viewtopic.php?p=987611#987611

wiak
-------------------

Only seen one (old) post on the forum related the long available IUP (for C, Lua, or LED, or even old ScriptBasic interpreter...) so posting here in case proves useful for others (and myself) to currently investigate further:

http://www.murga-linux.com/puppy/viewtopic.php?p=986579#986579

http://www.murga-linux.com/puppy/viewtopic.php?p=621835&search_id=2107747201#621835

http://webserver2.tecgraf.puc-rio.br/iup/

https://webserver2.tecgraf.puc-rio.br/iup/en/led.html

https://webserver2.tecgraf.puc-rio.br/iup/en/toolkits.html

I'm currently reading a pdf version of the IUP documentation, which are available here:

https://sourceforge.net/projects/iup/files/3.24/Docs%20and%20Sources/iup-3.24_Docs.pdf/download

It's an interesting read - especially the graphics showing the widgets available.

The Basic Guide to using IUP with Lua, which I provide a link to below, is particularly interesting in terms of the simplicity of programming the creation of GUIs with IupLua from a programmer's perspective:

http://iup.sourceforge.net/en/basic/index.html

I know Lua is small to install, but I don't know yet about IUP... but then again a Qt development environment, as an example alternative, is a pretty huge and complex C++ based alternative anyway...

wiak

Last edited by wiak on Tue 03 Jul 2018, 23:17; edited 1 time in total
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Sun 25 Mar 2018, 07:29    Post subject:  

Wow, this isn't looking too bad at all.

Had some trouble installing IUP for Lua, but just as I'm about to go to bed I seem to have success on XenialDog64. I installed Lua5.1 because the IUP stuff seemed to suggest was available for that. The IUP install itself is not bad at just over 7MB, so it seems to be a fairly small development system and the Basic Guide tutorial I linked to above seems to work when the commands just typed straight into the Lua interpreter prompt terminal (I don't know Lua, so happy with progress thus far). Just typing in a couple of Lua code lines and a gui popped up as it should... Smile

I'll work more on this tomorrow and report back how to try it all.

First 'program' tried was:

Code:
require( "iuplua" )

iup.Message('YourApp','Finished Successfully!')


Yeah, there were some 'Warnings' but I'm not worried about that at this stage...

wiak

Last edited by wiak on Sun 25 Mar 2018, 19:33; edited 1 time in total
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 3479
Location: holland

PostPosted: Sun 25 Mar 2018, 13:08    Post subject:  

wiak wrote:
Wow, this isn't looking too bad at all.


Sure looks promising !
I was thinking that it would be important to know if it depends on gtk3 (which is installed by default in Xenialdog).
If it does, there might be a problem, because many puppies only have gtk2.

Fred

_________________
Dog Linux website
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Sun 25 Mar 2018, 15:02    Post subject:  

fredx181 wrote:

I was thinking that it would be important to know if it depends on gtk3 (which is installed by default in Xenialdog).
If it does, there might be a problem, because many puppies only have gtk2.

Fred


I'm pretty sure, but have to check it out more, that it can use either gtk2 or gtk3. But yeah, I guess that would need it compiled for one or the other and it may be that the binaries I've downloaded are for gtk3(?). Not sure how to check that offhand.

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Sun 25 Mar 2018, 15:56    Post subject:  

Yeah, according to the docs:

Quote:
GTK 3.x is supported. But the pre-compiled binaries, up to Linux 3.2, are still built with GTK 2.x.
...
To build the driver with GTK 3.x support define USE_GTK3=Yes before calling make in the "iup/src" folder. Just the main library must be rebuilt. Also, if CD is used, the CD main library must be rebuilt with the same parameter.

Since Linux 3.13 the default is to use GTK 3
.

The version I am using is for Linux kernel 4.4 so using GTK3 at the moment.

I'll get round to trying to compile my own binary later so can choose GTK2 or GTK3.

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Sun 25 Mar 2018, 19:04    Post subject: Installing Lua and iup graphical toolkit  

HOWTO: Installing Lua and iup graphical toolkit

EDIT!!!: I think I will have to modify this HowTo since only seems to partly work. Maybe I should be only installing lib tar.gz files, not bin tar.gz and I have to make sure all im and cd libs are available/installed maybe to; to be continued later...

Use for programming simple gtk utilities and apps using small Lua interpreter with iup (an alternative to, for example, bash/gtkdialog/yad)

The following assumes:

Installing on XenialDog 64bit system, which uses kernel version 4.4.x.

Installing iup graphical toolkit for Lua version 5.3.


The instructions may or may not work for higher kernel versions or on other 64 bit distributions. Otherwise, some alternative binaries are available at the iup download site (or you can compile your own from the iup-provided source code). You can also look for the appropriate files for 32bit Linux systems at the iup website.
-------------------

Steps:

1. If you do not already have it, install the Lua interpreter version 5.3 with command:

Code:
apt-get update && apt-get install lua5.3


2. Make a directory somewhere for holding the Lua5.3 compatible main iup files and libraries.

Code:
mkdir -p /<somewhere>/iup53


replace <somewhere> above by dir name of your base directory of choice.

3a. Download the tarred-up binary iup main executables and libraries (for Lua53) and store in /<somewhere>/iup53/. For 64bit kernel version 4.4.x, download (around 6 MB) from here:

https://sourceforge.net/projects/iup/files/3.24/Tools%20Executables/Lua53/iup-3.24-Lua53_Linux44_64_bin.tar.gz/download

3b. Extract the tar.gz archive downloaded in step 3a to /<somewhere>/iup53/ (e.g. using Xarchiver or tar xzvf).

4a. Download the tarred-up binary iuplua libraries (for Lua53) and also store in /<somewhere>/iup53/. For 64bit kernel version 4.4.x, download (around 300 kB) from here:

https://sourceforge.net/projects/iup/files/3.24/Linux%20Libraries/Lua53/iup-3.24-Lua53_Linux44_64_lib.tar.gz/download

4b. Extract the tar.gz archive downloaded in step 4a to /<somewhere>/iup53/ (e.g. using Xarchiver or tar xzvf).

5. Install the main iup binary executables and libraries by running the following command from a terminal opened at the /<somewhere>/iup53/ directory:

Code:
./install && ./install_dev && USE_LUA53=Yes ./config_lua_module


You need to press Enter at each of the three main stages to Continue when so instructed.

For more information you should read the files: README and LINSTALL, which come with your iup downloads.

or you can of course do above install commands separately with:

Code:
./install
./install_dev
USE_LUA53=Yes ./config_lua_module


That completes installation of Lua5.3 with iup (including Lua required iuplua).
____________________________________

Running your first lua iup gtkdialog program.

The program here is the first one given in A Basic Guide to using IupLua at:

http://iup.sourceforge.net/en/basic/index.html

so it is useful to open that Basic Guide link so you can copy and paste in the program code.

1. Start the installed lua version with terminal command:

Code:
lua5.3


2. At the > prompt, enter (or copy and paste from "A Basic Guide...") first program line you want lua to interpret:

Code:
require( "iuplua" )


You will probably get a "WARNING **: Error retrieving accessibility bus address", but don't worry about that for now...

3. At next > prompt, enter (or copy and paste from "A Basic Guide...") second program line you want lua to interpret:

Code:
iup.Message('YourApp','Finished Successfully!')


A gtk3-based window should pop up according to what you just programmed. I don't think code is there to make the okay button do anything yet, but that's a small detail... Press Ctrl+D to exit Lua.

That's it! Simple eh?!
-----------------

For lots of information about what graphical widgets are available, and how to use them, refer to main iup docs:

https://sourceforge.net/projects/iup/files/3.24/Docs%20and%20Sources/iup-3.24_Docs.pdf/download
-----------------

If you want gtk2 instead of gtk3-based apps then the main iup executables/libraries will need to be re-compiled for that per the instructions here:

https://webserver2.tecgraf.puc-rio.br/cd/en/building.html

I'm not sure yet, to re-compile you might also need:

http://www.tecgraf.puc-rio.br/tecmake
screenshot_lua_iup_first_program1.jpg
 Description   screenshot
 Filesize   101.97 KB
 Viewed   603 Time(s)

screenshot_lua_iup_first_program1.jpg


Last edited by wiak on Mon 02 Apr 2018, 18:06; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12825
Location: Gatineau (Qc), Canada

PostPosted: Sun 25 Mar 2018, 22:50    Post subject:  

Hello wiak.

Your IUP looks interesting, but I still prefer ANSI codes in a terminal !!!! Laughing
I'm old-fashoned, you know! Wink With these toolkits, one writes so much code
for so small a result !!!

Seriously: do we actually need all those graphics to get things done?

BFN.

_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Mon 26 Mar 2018, 16:15    Post subject:  

musher0 wrote:
With these toolkits, one writes so much code
for so small a result !!!


I think this is not really a lot of code, which was all that was needed for the gui result, musher0 Wink

Code:
require( "iuplua" )

iup.Message('YourApp','Finished Successfully!')
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Mon 26 Mar 2018, 17:13    Post subject:  

So today/tomorrow I'm going to work on compiling IUP version that uses gtk2 rather than gtk3 to find out how easy or otherwise that is. If I manage, I'll post a howto in the hope that it will then be relatively easy for Puppy and Dog developers to create IUP lib/binaries that will run on any Puppy or Dog.

Some links I think I'll need:

http://webserver2.tecgraf.puc-rio.br/iup/

https://sourceforge.net/projects/iup/files/latest/download?source=files

https://webserver2.tecgraf.puc-rio.br/cd/en/building.html

https://sourceforge.net/projects/iup/files/3.24/Docs%20and%20Sources/iup-3.24_Docs.pdf/download

http://webserver2.tecgraf.puc-rio.br/tecmake/

https://sourceforge.net/p/iup/mailman/iup-users/

Source tar.gz files I think I need for the compilation(s):

EXCEPTIONS: Actually, (according to https://webserver2.tecgraf.puc-rio.br/cd/en/building.html), I think ftgl isn't needed for Linux cos already in canvasdraw below, but in Linux should install the freetype-dev package (on re-reading the compile Guide, ftgl sources may be needed after all - canvasdraw maybe only creates a blank ftgl directory in the overall dir structure - we will see...). For Windoze zlib sources are required, it seems from the guide, but in Linux zlib-dev is to be installed. I couldn't find that name, so have tried installing lua-zlib-dev in the hope that is the one...

lua5.3:
https://sourceforge.net/projects/luabinaries/files/5.3.4/Docs%20and%20Sources/lua-5.3.4_Sources.tar.gz/download

ftgl (FreeType2 support lib): https://sourceforge.net/projects/ftgl/files/latest/download?source=files

iup (portable user interface gui toolkit): https://sourceforge.net/projects/iup/files/latest/download?source=files

im (imtoolkit): https://sourceforge.net/projects/imtoolkit/files/latest/download?source=files

cd (canvasdraw): https://sourceforge.net/projects/canvasdraw/files/latest/download?source=files

tekmake: http://webserver2.tecgraf.puc-rio.br/tecmake/download/tecmake.tar.gz

MAYBE USE SVN VERSIONS INSTEAD IS ADVISED?

I am having trouble compiling CanvasDraw using sources above because of apparent errors in the source code (such as in sim/cd_truetype.h:14:22: fatal error: ft2build.h, should be #include <ft2build.h>, but still other problems...). Might be better to try SVN code which may or may not have error patches applied:

https://sourceforge.net/p/canvasdraw/cd/

Quote:
svn checkout svn://svn.code.sf.net/p/canvasdraw/cd/trunk/cd cd
svn checkout svn://svn.code.sf.net/p/canvasdraw/cd/trunk/freetype freetype (to compile CD in Windows)
svn checkout svn://svn.code.sf.net/p/canvasdraw/cd/trunk/ftgl ftgl (to compile CD_GL)


But cd compiling apparently depends on imtools compiled FIRST, so need:

https://sourceforge.net/p/imtoolkit/im/

Quote:
svn checkout svn://svn.code.sf.net/p/imtoolkit/im/trunk/im im
svn checkout svn://svn.code.sf.net/p/imtoolkit/im/trunk/zlib zlib (to compile IM in Windows)


https://sourceforge.net/p/iup/iup/

Quote:
svn checkout svn://svn.code.sf.net/p/iup/iup/trunk/iup iup



[quote=Guide]Building
By default the Makefiles and Tecmake files will build for Lua 5.1. To build for other Lua versions define USE_LUA_VERSION=52 or USE_LUA_VERSION=53 in the environment.
...
As a general rule (excluding system dependencies): IUP depends on CD and IM, and CD depends on IM. So start by build [lua5.3, then ftgl and then:] IM, then CD, then IUP.

To start building go the the "src" directory and type "make". In IUP there are many "srcxxx" folders, so go to the up directory "iup" and type "make" that all the sub folders will be built.[/quote]

However, above quote is all very well, but somewhat confusingly, in http://webserver2.tecgraf.puc-rio.br/iup/en/download_tips.html it says:

Quote:
All the libraries were build using Tecmake. Please use it if you intend to recompile the sources. Tecmake can be found at http://www.tecgraf.puc-rio.br/tecmake


I'll have to look into the above to try and sort out my confusion...

As far as using Lua/IUP is concerned, my early objective, for practice mainly, is to try and write a Lua/IUP version of an existing bash/gtkdialop app - something like an early version of Precord maybe.

I guess I'd like to see a small Linux distribution that used Lua/IUP for its small utils rather than gtkdialog (which doesn't seem to be maintained any more) or yad; nothing wrong with gtkdialog or yad, but for me it would be pleasant to have a relatively sophisticated but small and efficient interpretive programming language such as Lua as a core part of the system distribution anyway - and if it's there anyway, it can be used! Of course Python is often installed nowadays but the problem is finding a small easy to program graphical toolkit, and that is where IUP with Lua seems to fit so well.

Of course, typically we are relying heavily on bash and underlying commandline utilities (such as sed and so on) in our bash/gtkdialog/yad/Xdialog Puppy-style utilities. Whilst there will often (maybe usually) be alternatives in Lua (functions) itself, I hope for simplicity to still be able to lever the power of such commandline utilities so am checking out some likely useful methods of calling up and getting results from shell commandline utils from Lua. Main thing is I want is to use IUP for the gui creation rather than gtkdialog or yad or Xdialog. The following links are as much a reminder to myself as anything else:

https://github.com/zserge/luash

https://www.gammon.com.au/scripts/doc.php?lua=os.execute

https://github.com/torch/sys

http://lua-users.org/lists/lua-l/2007-04/msg00085.html

https://stackoverflow.com/questions/9676113/lua-os-execute-return-value

Some additional compile notes to keep myself on track...

https://webserver2.tecgraf.puc-rio.br/cd/en/building.html
https://webserver2.tecgraf.puc-rio.br/iup/en/guide.html
https://sourceforge.net/projects/iup/files/3.24/Docs%20and%20Sources/iup-3.24_Docs.pdf/download


Using latest svn source code for ftgl, im, cd, and iup. Using LuaBinaries lua53. Using official from Ubuntu libreadline-dev, libfreetype6-dev and zlib1g-dev (not sure if that zlib dev required) apt-get installed onto XenialDog64.

In lua5.3 sources src folder use Makefile.tecmake.

In iup run make from top-level iup directory to build all libraries. Alternatively drop into individual srcxxx lib and run make there to build individual lib.

#include "ft2build.h" should be #include <ft2build.h> in cd_truetype.h

Add (I think?) the Patch for Freetype2 from sur-behoffski to tecmake.mak in cd (and probably in iup and ftgl as well).

export USE_LUA_VERSION=53
export USE_GTK2=Yes
make USE_PKGCONFIG=Yes 2>&1 | tee mylog

At least in the Xenial 32bit version I needed to symlink gtk/ to gtkunixprint libs.

Also for iup gtk2 32bit version at least, I needed to modify tecmake.mak for version 1 libwebkit even when kernel ver 4+

I'm currently ignoring GTK_CHECK_VERSION() pre-processor errors.

./install in im, cd and iup
USE_LUA53 ./config_lua_module in im, cd and iup
For iup re-run ./install after modifying script so Install_RunTime() contains:

Copy_RunTime_To_System $1 lib/$TEC_UNAME/Lua53/

This removes a runtime warning message:

apt-get install at-spi2-core

First program:

Code:
require( "iuplua" )

iup.Message('YourApp','Finished Successfully!')


Haven't yet read this IUP Hints and Tips page:

https://www.fhug.org.uk/forum/viewtopic.php?t=10810

https://wiki.call-cc.org/iup-tutor

https://webserver2.tecgraf.puc-rio.br/iup/examples/Lua/misc/

wiak

Last edited by wiak on Tue 10 Apr 2018, 02:59; edited 10 times in total
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Fri 30 Mar 2018, 22:42    Post subject: Advantages of IUP over bash/gtkdialog/yad or complex Qt etc
Subject description: IUP actually simpler to code than gtkdialog...
 

I now have IUP apparently successfully compiled to use gtk2 rather than gtk3, but I'm still working on best packaging for Puppy/Dogs and not tested yet.

I am more impressed with IUP than ever and wonder why it has taken me so long to try it (especially since I long ago recognised Lua as a relatively small but very powerful scripting language; trouble is, back then I looked into using wxWidgets as the cross-platform gui toolkit and there was a lot to learn there...). Murga Lua, as I've said, used FLTK, but that has its problems in terms of look-and-feel and murga lua doesn't seem to have been developed for a long time (admittedly, the early murga Lua with FLTK was tiny, but doesn't 'need' to be quite that tiny nowadays - IUP fits ok)

Of course, no one on Puppy was using Lua, except in the early days, and bash and gtkdialog were provided on the systems (and similarly nowadays with yad). However, IUP seems actually easier to use than gtkdialog, albeit it is not directly from bash but rather from Lua. Certainly it is not as small an install as gtkdialog or yad (which are relatively tiny) but compared to overall current Pup or Dog iso size the Lua with IUP combination isn't going to be a very large addition at all.

IUP uses same 'Abstract vbox, hbox, container type layout as gtkdialog, but without the hard-to-get-right xml-like structure of gtkdialog. Really IUP is easier than gtkdialog IMO and much more powerful than yad dialogs (in fact IUP can pretty much match Qt in terms of target app capabilities... but with programming simplicity/abstraction as gtkdialog).

And... any app written in straight Lua with IUP should run exactly the same on Windoze if you happen to also use that or want to give your new app to friends who do! One great thing about IUP is that it uses the underlying native app toolkit, and on Linux it has chosen to use GTK and on Windows the buttons, sliders and so on will show up in native Windows API. That's perfect IMO; unlike FLTK which draws its own widgets, which can look 'untidy' since different to the native GTK (or Windows API) toolkit icons.

And IUP is long established yet also in current development. And though once a commercial app (long ago) it is now liberal MIT licensed (so can be used for free or commercial programming too...)

I hope to publish dotpet and deb (or at least tar.gz) package of my newly compiled IUP GTK2 with Lua5.3 combination soon. In the meantime, here is a really nice youtube explanation (interview of it's main developer, Antonio Escaño Scuri) of IUP from long ago (2011), which also explains really why IUP (with Lua or C) would be a better fit for programming apps/utilities on Puppy and puppy-like Dogs than the likes of Qt or wxWidgets (but with similar power in terms of the apps that could be produced... unlike simplistic yad or gtkdialog, which are very restricting really - but IUP just as easy to use as yad or gtkdialog, albeit with Lua rather than bash, unlike complex Qt or wxWidgets-based toolkit programming).

https://www.youtube.com/watch?v=k6KyyebX84I

I can't help thinking that IUP has been mainly not noticed because it is developed in Brazil and not really widely promoted elsewhere (despite being fully open-source GPL compatible, MIT licensed, software) - and for simplicity, Lua needed on the system (considering how small Lua is, it's a pity it isn't included by default on most recent Pups/Dogs anyway IMO - bash/gtkdialog/yad is a bit limiting, unless we are a bit lazy and don't want to learn how to use anything more powerful?).

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Tue 03 Apr 2018, 18:45    Post subject:  

The following are great examples of lua plus iup scripts. There is one old subdirectory in these examples called 'misc' which relates to Basic Guide tutorial - only some of these old examples still work. I believe that's cause iupx module isn't used anymore and the method of doing directory trees and menus is different. But aside from 'misc' subfolder, all the examples below seem to be working, and they are simple to program with great results...:

https://webserver2.tecgraf.puc-rio.br/iup/examples/Lua/

I do have iup compiled to work under GTK2 (rather than the default-provided GTK3) but I am still testing that compilation all works. I intend publishing either a small deb package or a tar.gz of that for testing in the next day or two.

Not sure what the overall size will be: depends which iup/cd/im modules included. If it greatly keeps the install size down, I hope to publish a core version first (for most simple gui creation use), with the other parts optional.

I now think IUP isn't adopted more generally simply because it is a bit tricky to compile and package (but it isn't really difficult - just a lot of documentation to find and read first - not exactly a job for newbies - no simple deb package available that I know of...). It seems to be incredibly powerful (yet very simple to program GUIs) once installed. I don't know yet if compiling iup on an older system would result in an iup package that would work on many systems, or whether it always needs to be compiled on the exact target system. Certainly, the programs you write with iup/lua can be used on any system that has lua and the appropriate iup libraries installed (be they Linux or Windoze systems.

One, important I feel, thing I haven't investigated yet is using lua-sh (or similar) module for easy interaction with underlying bash shell commands - that's the last piece of the jigsaw and hopefully an easy one.

https://zserge.com/blog/luash.html

Aside from the extended power of iup for creating simple or complex GUIs, it is worth reading Serge Zaitsev's comments at the beginning of the above link why it could be advantageous to move away from only using bash-shell with yad or gtkdialog scripting to Lua etc despite the slight extra install size to small distributions (it isn't going to be a painfully large install).

EDIT:

1. tar.gz of enough for basic gui's (including lua5.3 binary) is 579 KiB. Uncompressed install size of that is just 1.4 MiB (not bad since includes lua interpreter).

2. tar.gz of basic + main iupcontrols additions (again including lua5.3 binary) is 1.1 MiB. Uncompressed that fuller gui capable option is just 2.7 MB so again not bad at all. So this fuller option would just add 1.1 MiB to iso (assuming iso compressed with gz (even smaller if compressed with xz of course).

Okay, I'll make two debs (and later two dotpets for Puppy): one for minimum basic gui creations with Lua, and second a bolt-on for more controls. These are being produced on XenialDog64 at the moment, so will hopefully also work on XenialPup64. If anyone finds it useful I will endeavour to produce similar Xenial 32bit compiled versions.

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Sun 29 Apr 2018, 20:08    Post subject: Dotpets and debs  

I forgot to say the dotpets are at following link:

http://murga-linux.com/puppy/viewtopic.php?p=987611#987611

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Fri 10 Aug 2018, 02:30    Post subject:  

I'm keeping this IUP development/compiling thread separate from the one I provide dotpet/debs on because I want to keep the other thread more for actual usage discussions/examples. I refined my compile process somewhat from what can be found in various posts of this thread. It remains far from refined, but rough details which should be enough to allow others to compile it are given below. Of course I should refine and automate all this, but haven't... Also I haven't got round to packaging the latest compile I made. Easiest way for myself to work out requirements is to check structure of my previous uploaded deb packages. This latest compile is more of an intermediate step to jog my memory so I can compile and package again once I need it:

Based, to a large extent on official build doc from following link:

https://webserver2.tecgraf.puc-rio.br/cd/en/building.html

Quote:

By default the Makefiles and Tecmake files will build for Lua 5.1. To build for other Lua versions define USE_LUA_VERSION=52 or USE_LUA_VERSION=53 in the environment.
...
As a general rule (excluding system dependencies): IUP depends on CD and IM, and CD depends on IM. So start by build [lua5.3, then ftgl and then:] IM, then CD, then IUP.

To start building go the the "src" directory and type "make". In IUP there are many "srcxxx" folders, so go to the up directory "iup" and type "make" that all the sub folders will be built
...
TIP: If GTK headers or libraries are not being found, even when the libgtk2.0-dev package is installed, then their installation folder is not where our Makefiles expect. Build the GTK/GDK dependent libraries using "make USE_PKGCONFIG=Yes".

-----------------------------

My method of building IUPLua:

mkdir compile_iup_all and into there:

1. Fetch: https://sourceforge.net/projects/luabinaries/files/5.3.4/Docs%20and%20Sources/lua-5.3.4_Sources.tar.gz/download (this special lua compile has Makefile.tekmake in it)

or maybe could use (with dir renamed to lua53? and need bin copied to lua53/bin/Linux44_64/lua53): Lua 5.3.5 source file from http://www.lua.org/ftp/lua-5.3.5.tar.gz

2. NOT SURE THIS IS REQUIRED (I've build without it...) Fetch: https://sourceforge.net/projects/ftgl/files/latest/download?source=files

3. Fetch: svn checkout svn://svn.code.sf.net/p/imtoolkit/im/trunk/im im
or could use: https://sourceforge.net/projects/imtoolkit/files/latest/download?source=files

4. Fetch: svn checkout svn://svn.code.sf.net/p/canvasdraw/cd/trunk/cd cd
or could use (after fixing below noted bugs): https://sourceforge.net/projects/canvasdraw/files/latest/download?source=filessvn

5. Fetched iup sources via svn checkout svn://svn.code.sf.net/p/iup/iup/trunk/iup iup (using SVN version)
or could use: https://sourceforge.net/projects/iup/files/3.25/Docs%20and%20Sources/iup-3.25_Sources.tar.gz/download

6. In terminal you are about to compile from, set the following environment variables:

Code:

export USE_GTK2=Yes
export USE_LUA_VERSION=53
export USE_PKGCONFIG=Yes


Per the instructions below, compile the following in order:

1. Lua: #use LuaBinaries version
To build IM you will need libreadline-dev (e.g. apt-get install libreadline-dev).

Now do the following:

untar (dir should be called lua53, or newer, or you are not using LuaBinaries version)
then:

cd lua53/src #i.e. do rest in lua53/src directory:

make backups of src/Makefile and src/Makefile.tecmake (i.e. MakefileBKUP and Makefile.tecmakeBKUP), then:

Code:

cp -a Makfile.tecmakeBKUP Makefile

make 2>&1 | tee mylog


2. ftgl (do I need this? I don't know, but used anyway...EDIT: latest compile I didn't actually bother compiling ftgl i.e. Didn't do this step 2)
untar then, rename the folder to 'ftgl' for simplicity and then:

Code:

cd ftgl
./configure
cd src
make2>&1 | tee mylog 


3. IM # from SVN
To build IM you will need g++

Now do the following:

If not using SVN checkout version, untar download and then:

Code:

cd im/src
make 2>&1 | tee mylog  #assumes exported env variables: USE_GTK2, USE_LUA_VERSION53, USE_PKGCONFIG


4. CD # Probably using SVN version since has bug fixes
To build CD you will need:

libfreetype6-dev
libgl1-mesa-dev and libglu1-mesa-dev (for the ftgl library used by CD_GL)

*** Seem to also need: apt-get install libftgl-dev
else compile error: cd/src/drv/cdgl.c:22:23: fatal error: FTGL/ftgl.h: No such file or directory

libgtk2.0-dev (for the GDK driver)
or
libgtk-3-dev (for the GTK driver)
libx11-dev (for the X11 driver, OPTIONAL)
libxpm-dev (")
libxmu-dev (")
libxft-dev (for the XRender driver, OPTIONAL)

Compiling:

If not using SVN checkout version, untar download and then:

cd cd/src

Edit cd/src/sim/cd_truetype.h and if has #include "ft2build.h" then change to #include <ft2build.h> (seems fixed in SVN version); Also may need Patch for Freetype2 from sur-behoffski to tecmake.mak in cd (and probably in iup and ftgl as well) - I used the patch for cd and iup tecmake.mak(s) only (applied details manually) but don't know if required (though seems to be since clears up errors, tho does compile without). You can get the patch from IUP mailing lists here
https://sourceforge.net/p/iup/mailman/message/36159491/:

then in cd/src/:

Code:
make 2>&1 | tee mylog
#assumes exported env variables: USE_GTK2, USE_LUA_VERSION53, USE_PKGCONFIG

5. IUP #Probably using SVN version
To build IUP you will need:

libgtk2.0-dev (for the GTK driver)
or
libgtk-3-dev (for the GTK driver)
libmotif-dev and x11proto-print-dev (for the Motif driver, OPTIONAL)
libgl1-mesa-dev and libglu1-mesa-dev (for the IupGLCanvas)
libwebkit-dev or libwebkitgtk-dev (for the IupWebBrowser using GTK 2)
or
libwebkitgtk-3.0-dev (for the IupWebBrowser using GTK 3). Now do the following:

If not using SVN checkout version, untar download and then:

cd iup

In iup run make from top-level iup directory to build all libraries. Alternatively drop into individual srcxxx lib and run make there to build individual lib.

At least in the Xenial 32bit version I needed to symlink gtk/ to gtkunixprint libs.

Also for iup gtk2 32bit version at least, I previously needed to modify tecmake.mak to always use webkitgtk-1.0 rather than webkitgtk-3.0 even when kernel ver 4+. HOWEVER most recent SVN versions of im, cd and iup seem to have fixed this so no longer required. PATCH for iup tecmake.mak previously WAS: ()
1208,1212c1208
< ifdef USE_GTK3
< LIBS += webkitgtk-3.0
< else
< LIBS += webkitgtk-1.0
< endif
---
> LIBS += webkitgtk-3.0
#But like I say, seems no longer required with recent SVN-based installs.

NOTE: I'm currently ignoring GTK_CHECK_VERSION() pre-processor errors.
Also during compiling I still get errors like:
error: missing binary operator before token "("
#define CAIRO_VERSION_110 CAIRO_VERSION_ENCODE(1, 10, 0)
But these also seem able to be ignored (IUP message board drew attention to these but no fix suggested).

Now, in all of im, cd and iup, run:

./install in im, cd and iup
USE_LUA53 ./config_lua_module

For iup re-run ./install after modifying script so Install_RunTime() contains:
Copy_RunTime_To_System $1 lib/$TEC_UNAME/Lua53/
Note: I've renamed ./install second run version to: install_my_addition_for_secondrun

Also need to install the following to remove a runtime warning message:
apt-get install at-spi2-core

wiak
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1540s ][ Queries: 13 (0.0084s) ][ GZIP on ]