S4m4n wrote: ↑08 Apr 2020, 04:49
How can I reduce weight of a module safely?
What can safely be removed are unneeded language files for the GUI. When the GUI is a complex one - like with The GIMP - removing all unnecessary ones will make quite some difference.
They are to be found in /usr/share/locale .
Also, using usm, at times a needed dependency - a library - is only to be found in a package that contains more than the mere library.
You can manually check what is needed and only adding what is needed the following way:
Only activate the module itself, maybe with python added when it needs it, but with no additional libraries activated. Use ldd to see what dependencies are missing-
ldd needs the full path, and the error message you are looking for is "not found"
Then you can use lsxzm to find the xzm that holds the library and copy that, e.g. via mloop into the folder of your stripped module, and do the same with the next "not found" entry.
Now, after you did so, it still could be that additional dependencies are unsolved even after ldd reports no "not found", because libraries you just added might need other libraries ldd did not know about in the above test. So, dir2xzm your stripped module folder into the stripped module and deactivate the bare version and activate the stripped version with the manually added libs. Repeat using ldd to see if there are still dependencies missing. If ldd reports nothing (combined with grep as seen above), try starting the program.
If the programs starts, your stripped module is working as it should.
Cave! This behaviour can differ between DEs (Desktop environments)
Some minimal DEs like LXDE or XFCE might need some more libraries than e.g. KDE. So, a module working in KDE (that is not a KDE specific program) might fail in XFCE or LXDE.
But never the other way round, when you use the most minimal DE - currently that is Openbox - the created module should work in any other available DE as well.
I know it is quite some manual work. If you plan on stripping a certain program and plan on doing the same in the future for the most recent version available then I recommend you note down what was needed to get is running in the best stripped down version you have been able to create; the note will be helpful the next time you do the same for the never version, and the note will shorten the time creating the then never version as well.
As was the info note I created for me when I created the stripped versions of newer GIMP versions.