Page 1 of 1

Libraries NOT stripped by new2dir make install

Posted: Wed 02 Oct 2019, 12:21
by OscarTalks
I quite like compiling and creating .pet packages but for years I have found that although the executable binaries get stripped, the shared libraries do not. I have to inspect these files and strip them manually before finally creating my .pet package.

So I am now testing the following possible fix and perhaps others would like to do the same.
In the file /usr/bin/new2dir
Look for the section:-

Code: Select all

#strip the file...
 if [ ! -h "$ONEFILE" ];then #make sure it isn't a symlink
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" = "" ] && strip --strip-debug "$ONEFILE"
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" = "" ] && strip --strip-unneeded "$ONEFILE"
 fi
Change the argument --strip-debug to --strip-unneeded
(Same as the argument being used for executables)
So it looks like this:-

Code: Select all

#strip the file...
 if [ ! -h "$ONEFILE" ];then #make sure it isn't a symlink
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" = "" ] && strip --strip-unneeded "$ONEFILE"
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" = "" ] && strip --strip-unneeded "$ONEFILE"
 fi
The shared (dynamic) libraries installed into your system, plus the copies which will be used to create the .pet or .sfs package should then be already stripped. Right-click and look at properties to verify.

Posted: Wed 02 Oct 2019, 13:46
by Mike Walsh
Thanks for that, Oscar. I, too, have often wondered why packages weren't coming out as small as I felt they ought to have done.

Now we know why......

Cheers for the "detective work", mate! This should work with Trio's PetMaker, too (which I use a lot), since when all's said & done, it's still using the standard Puppy package tools 'under the hood'. Nice one.


Mike. :wink: