| Author |
Message |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Sun 12 Aug 2012, 23:25 Post subject:
stubs: replace useless libs with headers - dbus, dbus-glib.. Subject description: maybe gconf and others down the line |
|
It is common practice to make stub functions that return acceptable values to replace dependencies, but it is also possible in C to use macros to define functions as constants. This allows us to replace entire libraries with just a header (.h) file. I have done a bit of work on dbus and dbus-glib (the pre-alpha headers compress to <10kb and should be much less when compiled) I have an eye on gconf for the future, possibly others as I get annoyed with them.
The general idea is to look through the functions for return values and just define each function as a constant from a working return value... mostly TRUE, FALSE, 0, NULL or ""
Edit: this de-bus pet is only for packagers/developers to build against - it does not replace a runtime of dbus/dbus-glib, for that there is another project called "nobus" ...still needs testing - let me know if you try it.
| Description |
|

Download |
| Filename |
de-bus-0.0.pet |
| Filesize |
9.42 KB |
| Downloaded |
207 Time(s) |
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Thu 13 Sep 2012, 11:36 Post subject:
|
|
here is a small pet package of the nobus project for non-dev-types
(I built it as a shared library for use with prebuilt binaries)
I won't be updating the package, so here are the url and extra build instructions for a shared library.
https://github.com/clbr/nobus
| Code: | | cc -shared -Wl,-soname,libdbus-glib-1.so.2,-s -o libdbus-glib-1.so.2 stubs.o |
then made a symlink for dbus (see inside package for details)
Now to see if it works with prebuilt mozillas.
| Description |
|

Download |
| Filename |
nobus-0.2-i486.pet |
| Filesize |
5.18 KB |
| Downloaded |
217 Time(s) |
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6199 Location: Auckland, New Zealand
|
Posted: Thu 13 Sep 2012, 19:58 Post subject:
|
|
| Quote: | | Edit: this de-bus pet is only for packagers/developers to build against - it does not replace a runtime of dbus/dbus-glib, for that there is another project called "nobus" ...still needs testing - let me know if you try it. |
I'm confused - from reading the nobus readme I thought that it did the same thing, i.e. it does not replace a runtime, it is a compile-time solution to remove the dbus dependency.
_________________ DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Thu 13 Sep 2012, 22:09 Post subject:
|
|
It _was_ before I got a hold of it. I built it as a shared lib - which nobus lends itself to, since it uses function stubs. Mine couldn't do that, since I use macros to replace the code with constants that compile away (mostly)... it has no functions.
Edit: the reason it probably says that is that it only builds a static lib. Gcc is good at inlining small, constant functions, so it would build the same as mine with the right compiler options (de-bus minimizes the build size regardless of optimization). Note, I may need to add extern to some functions for it to work (if you get a missing symbol for a function that is in the library, it usually just needs extern before the function type declaration)
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
Dewbie
Joined: 15 Apr 2010 Posts: 1456
|
Posted: Tue 25 Sep 2012, 20:35 Post subject:
|
|
technosaurus wrote:
| Quote: | | Now to see if it works with prebuilt mozillas. |
Tested SeaMonkey 2.12.1 official build and nobus-0.2-i486.pet with:
Puppy Linux 4.1.2
Puppy Linux 4.3.1
Wary 5.1.4.1.
Works with all of em!
|
|
Back to top
|
|
 |
greengeek
Joined: 20 Jul 2010 Posts: 1217 Location: New Zealand
|
Posted: Wed 26 Sep 2012, 17:36 Post subject:
|
|
I was recently trialling Gray's WaryNOP 5.1.1 which comes with Opera but I wanted to install Firefox, however FF would not run because the system did not have /usr/lib/libhunspell.so.0 available.
Is this the sort of problem that "nobus" is designed to alleviate?
(I renamed a totally different lib as the missing one and then FF ran ok, so obviously the structure of the lib is not that critical...)
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Wed 26 Sep 2012, 18:04 Post subject:
|
|
the official ff has the hunspell lib builtin iirc, but no you would get no spell checking at best, and at worst it would segfault when it tried (unless maybe you turned it off in settings, then you could just symlink some random lib to where it is looking) - hunspell is useful in other apps too - I recommend just installing it. dbus otoh doesn't do much of anything useful.
or you can make a fake anything in case it looks for the SONAME
gcc -shared -o libdummy.so.3 -Wl,-soname,libdummy.so.3 -s
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
greengeek
Joined: 20 Jul 2010 Posts: 1217 Location: New Zealand
|
Posted: Wed 26 Sep 2012, 18:27 Post subject:
|
|
| technosaurus wrote: | or you can make a fake anything in case it looks for the SONAME
gcc -shared -o libdummy.so.3 -Wl,-soname,libdummy.so.3 -s |
So does that create a "dummy" lib that can be renamed to temporarily replace the missing one?
I had wondered if it might be possible to make a generic lib (lets say called "safelib"), which, when called by some programme, would bring up a dialog saying "Library safelib has been called by programme xxx" so that there would be some indication that the missing lib had actually been accessed, whether or not the outcome was problematic.
(I have often been concerned about just adding in missing libs, because there's no easy way for me to know if it is guaranteed to be the correct lib for my system - there are so many with similar names.)
The reason for my question about nobus was that I found a forum that had pinpointed the lack of dbus and dbus-glib as being the reason for the missing hunspell
http://answers.yahoo.com/question/index?qid=20100308095846AAkiY7g
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Wed 26 Sep 2012, 19:12 Post subject:
|
|
oops:
gcc -shared blankfile.c -o libdummy.so.3 -Wl,-soname,libdummy.so.3 -s
IIRC, Barry now includes hunspell in puppy by default because you can compile mozilla products --with-system-hunspell (thus it won't work on older pups without it unless you get the hunspell package) official builds have hunspell inside their directory structure and you may have to futz around with LD_LIBRARY_PATH to find it (the included script should do it for you but puppy haz its own mozilla wrapper that may not) ... same goes for lib{z,png,jpeg,cairo,...} anyhow mozilla's source looks like someone crossed the streams or I would have contributed some fixes long ago
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
session

Joined: 07 Feb 2011 Posts: 51 Location: Valley of the Sun
|
Posted: Thu 25 Apr 2013, 00:11 Post subject:
|
|
| greengeek wrote: | I had wondered if it might be possible to make a generic lib (lets say called "safelib"), which, when called by some programme, would bring up a dialog saying "Library safelib has been called by programme xxx" so that there would be some indication that the missing lib had actually been accessed, whether or not the outcome was problematic.
(I have often been concerned about just adding in missing libs, because there's no easy way for me to know if it is guaranteed to be the correct lib for my system - there are so many with similar names.) |
Library identification would be nice; using nobus, recent versions of vanilla Seamonkey would crash on a few sites (ex. Chase Logon) and it was really through trial-and-error and chance that I discovered it was because of missing dbus(-glib) libs...
_________________ Primary - Intel Celeron 1.80GHz, 579MB RAM, ATI Rage 128 Pro ULTRA TF. Wary 5.5 full install.
Secondary - Pentium 3 533MHz, 385MB RAM, Matrox MGA-G200 AGP. Wary 5 frugal install. (IDE HD is 428 MB!)
|
|
Back to top
|
|
 |
darry1966
Joined: 26 Feb 2012 Posts: 51 Location: New Zealand
|
Posted: Fri 07 Jun 2013, 16:13 Post subject:
Thankyou |
|
Thankyou for this handy No Bus .pet I owe you a Virtual Beer. Works well on my modified 4.12 system.
t
|
|
Back to top
|
|
 |
|