Another funny fact about rebuilding qmapboxgl using the OBS SPEC file (alas slightly modified to clone the Github repository and branch into sfos) is that OBS build is much smaller than Docker-based build:
4.7 MB
[nemo@Sailfish lib]$ ls libqmap* -lah
-rwxr-xr-x 1 root root 4.7M Jun 7 23:00 libqmapboxgl.so
[nemo@Sailfish lib]$
vs.
305 MB
[nemo@Sailfish ~]$ rpm -qlv qmapbox.rpm
-rwxr-xr-x 1 root root 305907968 Nov 11 20:37 /usr/lib/libqmapboxgl.so
[nemo@Sailfish ~]$
Looks like the whole lib was compiled statically using the SDK.
UPDATE:
Ok it looks like OBS is stripping the lib before packing the RPM. If I manually strip the .so file it will shrink to 4.7 MB.
UPDATE 2:
Mhh… brp-strip is called and SDK uses this script …
# Strip ELF binaries
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep -v ' shared object,' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
$STRIP -g "$f" || :
done
That means that binaries if not shared objects will be stripped. However libqmapbox.so is a shared object file so stripping would never happen.
On the other hand the OBS RPM contains a stripped .so:
[nemo@Sailfish ~]$ file /usr/lib/libqmapboxgl.so
/usr/lib/libqmapboxgl.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=53a35a42e1488c25544bb05bbd8dfa0f08b49577, stripped
[nemo@Sailfish ~]$
Is there some post-processing on OBS before the RPM was build or does OBS use some patched brp-strip script removing the grep -v “shared object”?