ubuntu / gnome-sdk

GNOME SDK/Platform snap
22 stars 24 forks source link

Building using libunity is not working #155

Closed seb128 closed 1 year ago

seb128 commented 1 year ago

Trying to build shotwell -Dunity_support=true the builds fails because the /usr/lib/x86_64-linux-gnu/libunity/libunity-protocol-private.so.0 symbols aren't found

it's probably because

# readelf -d /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libunity.so  | grep -i RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib/x86_64-linux-gnu/libunity]

Which isn't the right location for the snap. Perhaps we need to build libunity with the right path from source to workaround the issue?

sergio-costas commented 1 year ago

I suspect that the true problem is that libunity-protocol-private.so is placed at /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libunity/libunity-protocol-private.so, and that folder isn't in the LD_LIBRARY_PATH. So there are two solutions, in my opinion:

Unless, of course, that library is linked at runtime instead of during loading. In that case, maybe the only solution is to use layouts to map it at /usr/lib/x86_64-linux-gnu/libunity

sergio-costas commented 1 year ago

Confirmed: with this, it creates the snap fine.

      - -Dunity_support=true
    build-environment:
      - LD_LIBRARY_PATH: ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET/libunity