[Gambas-user] Distribution of custom shared libraries

Cedron Dawg cedron at exede.net
Fri Feb 22 21:08:12 CET 2019


Hi Tobi,

I did search quite a bit for GamePad support before I wrote my own.  The only thing I could find was an old mailing list entry about reading the "/dev/input/js#" through an EXEC command since the read didn't work.  I've lost the refernence, sorry.

I think it would be great to have it as a gb.* component, but that is beyond my ability at this point.  Also, apparently the "/dev/input/event##" is the more recent way of doing it, but I haven't figure that out yet either.

For this project, I am happy to distribute source.  The question I have is not about the Gambas code, rather is what do I do with the .c file?  It is not project specific since it is meant to be usable with any Gambas application.

On my machine, this is how I have is set up:

I am putting my projects in my "~/Gambas" directory.  I also have a "~/Gambas/so/<libname>" directory for my library code.  In my "/usr/lib" directory (as root), I added a link called "libGambas_GamePad.so" which points to the same file in my development directory.  This works great.  I can modify the library, compile in place, and test immediately from the Gambas IDE.

These are my functions:

Extern GP_GetAttachedList() As String In "libGambas_GamePad"
Extern GP_FillInfoBlock(argPadIndex As Integer, argInfo As InfoBlock) As String In "libGambas_GamePad"
Extern GP_RawRead(argPadIndex As Integer, argEvent As EventBlock) As String In "libGambas_GamePad"

So, if I include the source code in my project, how best to communicate installation instructions for the .so library for the end user?

Thanks,

Ced


----- Original Message -----
From: "Tobias Boege" <taboege at gmail.com>
To: "user" <user at lists.gambas-basic.org>
Sent: Friday, February 22, 2019 2:41:00 PM
Subject: Re: [Gambas-user] Distribution of custom shared libraries

On Fri, 22 Feb 2019, Cedron Dawg wrote:
> Hello all,
> 
> I've been messing around with Gambas for a few weeks now.  It's very impressive, and since VB6 has been my favorite rapid development platform I am finding Gambas very helpful.  I've done a little bit of GUI programming in raw X and Tkinter, and this beats them hands down.
> 
> I have written a small shared library to access GamePads or Joysticks using the "/dev/input/js#" device.  Along with that I have a small demo project which simply prints the GamePad data to the console and a more substantive video game that I intend to put in the software farm.
> 

Cool, I also have that (as a native component, though) but never got around
to release it :-/

> 3) If I want ot distribute compiled versions only, where to include it?  32-bit vs 64bit?
> 

Compiled Gambas executables are architecture-independent which I'm pretty
sure includes endianness as well as word length. That is because *.gambas
files contain classes compiled to Gambas bytecode. You need the Gambas
virtual machine, aka interpreter, to execute them -- unlike the *.exe files
that VB6 presumably produces.

If you want to distribute compiled versions of your program, I would suggest
making an installation package via the IDE. This includes the *.gambas file
and links to all the dependencies required on the consumer's machine to
run it, including at least the Gambas interpreter. Their package manager
will resolve the dependencies when your program gets installed.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----


More information about the User mailing list