forthebadge forthebadge Gem Version

About this project

This project, called easycompile, allows the user to quickly compile a given local archive, such as foobar-1.2.3.tar.xz.

In fact: this is the primary use-case for this project, and explains why it has been created years ago. I needed a quick way to compile a program into the /usr/ prefix.

Let's showcase a few more specific usage examples for easycompile, in ruby:

Easycompile.new('php-7.0.6.tar.xz')
Easycompile.compile('php-7.0.6.tar.xz')
Easycompile['php']

The above statements all essentially do the same thing: the file called php-7.0.6.tar.xz will be compiled, if it exists locally in the current directory.

The last statement, Easycompile['php'] tries to find matching files in the current working directory. This is done via a glob operation, such as via Dir[]. The advantage here is that it is generic - you do not need to provide the full name of an archive to Easycompile. This can be useful if you do not really care about any particular version.

You can also specify the full location to the target file, e. g. the path too, such as '/opt/php-7.1.2.tar.xz', as the first argument to Easycompile.new.

.gem files can also be used, such as shown by the following example:

easycompile rack-2.0.1.gem

Remote files could be used as well, in theory, including programs offered through the http/https protocol. That is, you could simply pass in the complete URL, and Easycompile will try to download this remote fila via wget. However had, this approach is not very reliable - it may be best to just simply download the remote archive for now, on your own (via wget), and then work on a local copy directly.

History of the Easycompile project

I created the project primarily because I managed to break another, larger project, called rbt (ruby build tools) quite a lot in the past. When that other project was broken, it typically took some time to fix it, and I did not always have that time available at my disposal. Since I did not want to use shell scripts for compiling different programs, I quickly created this smaller project (easycompile), and since that day the project helps me to quickly compile something if rbt is not available, or not working. This sums up most of the origins of this project.

Since RBT has also improved since that day, the need for easycompile has diminished - but I keep it around still, just in case. :)

One evident design goal following this history is that the Easycompile project has to work when RBT is not available - but if RBT is available then Easycompile can tap into some of the functionality, to enhance support of individual aspects necessary for compiling a program. A good example for this is to re-use the default configure options that the RBT project is tracking.

Commandline usage for easycompile

The commandline variant can be invoked via the bin/ecompile file. I recommend to use the --user-install option when installing easycompile, as all bin/ files will be in a specific subdirectory, to which you can then simply modify $PATH for.

Say that you have a local file called php-7.2.0.tar.xz.

Then simply do the following on the commandline:

easycompile php-7.2.0.tar.xz
easycompile php* # Or this variant; is shorter, evidently.

Support for meson and ninja

The easycompile project can compile meson/ninja based programs, provided that a file called meson.build can be found in the extracted directory. This requires a separate build directory, which will default to the name BUILD_DIRECTORY/ as far as the easycompile project is concerned. The name of that build directory is kept in a .yml file, the one at easycompile/yaml/name_of_the_build_directory.yml.

Commandline options

This subsection will show some examples hwo to use the easycompile project from the commandline.

To compile all local PHP archives in the current working directory:

ecompile php*

To do the same but specify a particular temp-directory for extracting the source archive specifically:

ecompile php* --extract-to=/Depot/opt/

To get an overview over the available help options, try:

ecompile --help

Maintenance mode since as of January 2020

Do note that the project is in light maintenance mode since as of January 2020, meaning that I will mostly do only bug-fixes, and perhaps add a few new light features every some months at best. For a more complete suite of software that goes beyond the somewhat narrowly defined goals for Easycompile, I recommend to make use of rbt (Ruby Build Tools) instead.

Contact information

If you have specific suggestions to make this gem more useful for others, please drop me an email at:

shevegen@gmail.com

(Please keep in mind that responding to emails may take a while depending on the amount of work I may have at that moment in time due to reallife.)

Thank you.