native Linux starter on tarball build?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

native Linux starter on tarball build?

micheletrecaffe
Hi, All

I just built LibreCAD from a tarball, following the instructions at https://wiki.librecad.org/index.php/Build_from_source. I am running Linux Mint 20, 64-bit.

The install went fine, LibreCAD works fine, except for one thing:

Within the main folder - installed at ~/develop/LibreCAD as per the instructions - there is a 'CLEAN' shell script which, when run, practically disables my instance of LibreCAD. Investigating further, the shell, in addition to removing the various Makefiles, also removes the /unix folder and the librecad.app file the folder contains and which, also per the instructions, is needed to start LibreCAD from the terminal.

Looking into this a bit further, it turns out that librecad.app is a MacOS application bundle, which includes the executable file.

Which seems to indicate that the tarball build is actually running on top of ...MacOS? Why? Why not build natively? Or is there a Linux native executable somewhere else in the file system? Otherwise, why would a 'clean-up' script remove the package that contains the executable file, given that this handbuild does not place a starter icon in my main menu?

I'm happy to keep the /unix folder and all, I was just curious if anyone else has noticed this/has any info on it.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: native Linux starter on tarball build?

LordOfBikes
Administrator
The clean script is not mentioned in the linked instructions for that reason. It's the intention, that the binary is wiped out with all the other build files. This is a common task in software development.
But the good news, as you surely figured already out, it does not delete any essential files. You can simply built the executable again.

A tarball is just an archive, like zip, it does not contain any OS specific information. Because MacOS is based on Unix like Linux, both OS can handle tarball native.
Of course LibreCAD is built natively on any OS. It is possible to cross compile binary executable for other OS, but it makes the setup more complicated and is not used for LibreCAD.

I have no idea, where your librecad.app comes from, the binary on Linux is named just librecad, without extension.
And on MacOS LibreCAD.app is a folder, containing the executable, dependencies and resource files.

Build from source does not mean install and is just a way, especially on Linux, to get a newer LibreCAD version. Most Linux distributions has conservative rules about updating source code and distribute newer software versions. Thus it often takes too long time until new releases are deployed by packet managers.
But for a while now, we provide AppImage binaries, which run on many Linux distributions. This makes build from source obsolete, if you just want to use a newer LibreCAD version.

As you already managed to build from source, you can simply move the unix folder to a safe place and create a shortcut for the start menu. Build from source does not mean install, this is handled by Linux distributors, because default locations for the installation varies on different distributions and window manager. That's the reason, why there is not a common Linux installer, like we have for Windows or MacOS.
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: native Linux starter on tarball build?

micheletrecaffe
Hi, and thanks for the reply.

...Right-clicking and selecting 'Properties' tells me that the 'librecad' in /unix is a 'shared directory' and weighs in at ~174MB. The 'CLEAN' script defines it as librecad.app (rm -rf LibreCAD.app), which is where I got that from - it's in the list of things that the script removes (and, regrettably, the script does indeed remove it).

In any event, yes, I am keeping the /unix folder and its goodies, and have created a launcher pointing to /unix/librecad.

Until now, I had always understood 'build' and 'install' as at least part of the same process, perhaps even synonyms. But I see that what I have is a running instance of LibreCAD, but it did not self-integrate into my menus, nor did it distribute itself into my /usr folder so -- not synonyms after all.

If I want to clean things up a bit, can I get rid of the Makefiles that are scattered through LibreCAD's file system? And is there anything else I should get rid of?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: native Linux starter on tarball build?

LordOfBikes
Administrator
Just had a look at the CLEAN.sh details.
It is intended to be used on Linux and MacOS. Both can run .sh shell scripts.
On a MacOS build there is no unix folder, but the LibreCAD.app folder.
So the script was just made to work on both OS I think.

On Linux is no big difference between release and debug build, in the sense of file size.
Both, the release and debug build contain a bunch of information in case the application crashes.
For daily use, you can remove them:
strip librecad
Run this in the unix folder and the librecad executable will shrink to about 8MB.

As I recommend, move the unix folder to another place in your home directory, then you can safely use the CLEAN.sh script to free all the build files, which can sum up to nearly 1GB!
Basically you can remove the whole project folder when the unix folder is saved and everything is running.
Keeping the project folder only makes sense, when you plan to work on the source code and build regularly.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: native Linux starter on tarball build?

micheletrecaffe
This post was updated on .
AHHHHH!! I see! Light dawns. Thanks for the tips!

So, let's see:

Original weight: 926,5MB 2778 elements
After 'strip':        758,6MB 2778 elements (~/develop/LibreCAD/unix/librecad down to 6,4MB)
After 'CLEAN':   159,7MB 1818 elements ...and everything still works. Damn.

Thank you kindly, sir, that was fun and productive!