[Gambas-devel] gbmake. A drop-in replacement to automake

Benoît Minisini gambas at ...1...
Wed Sep 5 13:43:34 CEST 2012


Le 05/09/2012 05:02, Sebastian Kulesz a écrit :
> Hi all !!
>
> I really think Gambas is a great language to work with, but lets face
> it, from the point of view of a beginner, distributing an application
> is a pain in the a**. There is no *standard* way to build a project
> (other than executing gbc3/gba3 directly if we let the IDE aside),
> this makes it difficult to create debian packages, PPAs, etc. as they
> all require some sort of autoconf script to manage the process.
> Without the IDE, an user can do much. And with it, this implies
> installing every component it depends on (a total of 15).
>
> To create a PPA of a gambas application, for example, the user has 2
> choices. He can either write a Makefile (more bugs, no portability,
> etc) or create a dummy autoconf package, skim the files and replace
> what is needed (package name, version, etc), and merge it with his
> project.
>
> These are really just a few examples of the problems i faced not so
> long ago. With this in mind, i created this little tool to automate
> the building of gambas apps. It works as a *drop in* replacement for
> make (*seriously*, you can run "make", "make clean", and "sudo make
> install" without a single script, autoconf, automake, m4 macro).
>
> I also wrote the app with Quickly [0] in mind. For example, if you
> want to debianize a project, you can run "gbmake debianize" or just
> "make debianize" and that is it. It will automatically create a
> skeleton debian/ folder which should work out-of-the-box. Maybe a
> "make source" to create a source archive?
>
> I just started it today, so only the building process is really
> implemented (build, clean, install) but I really see a lot of
> potential here. Once it's completed, the autotools package may be
> dropped (it will be completely replaced and the user will have to do
> nothing). Uploading packages to a PPA will be much easier. Users won't
> depend on the IDE to perform administrative tasks, such as building a
> package or a source archive.
>
> I will need some help to port the packaging code in the IDE to work in
> headless mode. I'm trying to make this tool to only depend on the
> interpreter, so no single component has to be installed for it to
> work. This means implementing a custom option parser, and settings
> parser. I have zero knowledge of Slackware, OpenSUSE, Mandriva, Mageia
> and Fedora (and it's derivatives), so i will only be able to port the
> code, but i can't test for any bugs or regressions.
>
> How does it works? It's really simple actually. You will see 2
> Makefiles included. the one named Makefile.1 should be used to install
> the app in the first place.
>
> sudo make -f Makefile.1 install
>
> This command will build the project and install it (/usr/bin/gbmake).
> The second Makefile only wraps the commands sent to "make" to
> "gbmake". It's really the same, but we are all used to type make *,
> aren't we? ;-)
>
> In this case, only adding this Makefile to a project will let "make"
> work out of the box, otherwise, "gbmake" will work just fine.
>
> I will try to have the Debian part finished by the end of the week so
> i can provide a working example, this is just a *proof of concept*,
> and a call for everybody who would like to help. I'm a little skeptic
> about merging this to trunk (even as a branch), as it's a work in
> progress, and it will just confuse the users. Besides, 3.3 is around
> the corner and this will only bring more bugs. Maybe 3.4 if we hurry.
>
> I'm really anxious to hear your comments!
>
> Thanks!
>
> [0] https://wiki.ubuntu.com/Quickly
>

Good idea, but the problem is code duplication between "gbmake" and the IDE.

I suggest taking the code from the IDE instead of rewriting your own (or 
mix them if yours is better).

The Packager class already has "debianizing" code for example, and 
everything for making packages with no GUI. It just depends on all the 
configuration parameters entered in the packager wizard, but all these 
parameters are stored in the .project file.

I suggest renaming "gbmake" into "gbm", to follow the naming pattern of 
all gambas command-line tools.

There is two ways to solve the code duplication problem:
- The "gbm" project have modules that are symbolic links to the IDE code.
- The IDE calls gbm systematically for doing all the stuff.

At the moment I prefer the first solution, so that the interface of gbm 
can be developped independently of the IDE needs.

I don't understand why you need two Makefiles. I imagine that the IDE 
would automatically generate a Makefile file inside the source directory 
with a configure script to detect that Gambas is installed. That way, 
you just have to uncompress the Gambas source archive, run 
'./configure', 'make' and 'make install', and everything works as 
expected. Is it what you have in mind?

-- 
Benoît Minisini




More information about the Devel mailing list