dcloud-ca / ca.dcloud.ICAClient

Install Citrix Workspace + HDX RTME as a Flatpak application
MIT License
20 stars 11 forks source link

Missing dependencies for HdxRtcEngine #13

Open luminoso opened 2 years ago

luminoso commented 2 years ago

Thank you for making this flatpak release.

I was using it and noticed that ICAClient/util/HdxRtcEngine is missing three dependencies, two of them can be built together.

This can by checked by doing ldd /app/ICAClient/linuxx64/util/HdxRtcEngine inside the run.sh script, where we can see that:

(...)
        libgstapp-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so.0 (0x00007f2940ebc000)
        libc++.so.1 => not found
        libunwind.so.1 => not found
        libc++abi.so.1 => not found
        libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007f2940d71000)
(...)

The first one, libunwind.so.1, I fixed by adding two more steps to the modules:

modules:
  - name: libunwind
    buildsystem: autotools
    sources:
      - type: archive
        url: https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz
        sha256: 4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976

  - name: patch libunwind
    buildsystem: simple
    build-commands:
      - |
        mkdir -p /app/lib
        cp /usr/lib/x86_64-linux-gnu/libunwind.so.8 /app/lib/libunwind.so.1

and editing run.sh to include the lib:

export LD_LIBRARY_PATH=/app/lib/:/usr/lib/x86_64-linux-gnu/
ldd /app/ICAClient/linuxx64/util/HdxRtcEngine

this way we can check that library is there to be found and loaded:

(...)
        libgstapp-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so.0 (0x00007fb3cc351000)
        libc++.so.1 => not found
        libunwind.so.1 => /app/lib/libunwind.so.1 (0x00007fb3cc32c000)
        libc++abi.so.1 => not found
        libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007fb3cc1e3000)
(...)

However, I have no idea how to do the same for libc++ and libc++abi. My understanding is that they can be bundled together? But unfortunately my limited knowledge of flatpak packaging is blocking me from progressing from here.

Any ideas on how to progress from here?

luminoso commented 2 years ago

Humm stolen the module from discord https://github.com/flathub/com.discordapp.Discord/blob/90d9f1a0c350b4d479738476e53fea4bba473a83/com.discordapp.Discord.json#L68 , bumped version and added as a module

- name: libcxx
    buildsystem: cmake-ninja
    builddir: true
    make-args:
    - cxx
    no-make-install: true
    config-opts:
    - "-DCMAKE_BUILD_TYPE=Release"
    cleanup:
    - "/include"
    - "/lib/*.a"
    build-commands:
    - ninja install-libcxxabi
    - ninja install-libcxx
    sources:
    - type: archive
      url: https://releases.llvm.org/9.0.0/llvm-9.0.0.src.tar.xz
      sha256: d6a0565cf21f22e9b4353b2eb92622e8365000a9e90a16b09b56f8157eabfe84
    - type: archive
      url: https://releases.llvm.org/9.0.0/libcxx-9.0.0.src.tar.xz
      sha256: 3c4162972b5d3204ba47ac384aa456855a17b5e97422723d4758251acf1ed28c
      dest: projects/libcxx
    - type: archive
      url: https://releases.llvm.org/9.0.0/libcxxabi-9.0.0.src.tar.xz
      sha256: 675041783565c906ac2f7f8b2bc5c40f14d871ecfa8ade34855aa18de95530e9
      dest: projects/libcxxabi

And now all libraries are loaded:

libc++.so.1 => /app/lib/libc++.so.1 (0x00007f22997f2000)
libunwind.so.1 => /app/lib/libunwind.so.1 (0x00007f22997d7000)
libc++abi.so.1 => /app/lib/libc++abi.so.1 (0x00007f229979f000)

However the maximum version I can push is 9.0.0. Other llvm releases have a different structure. I'm not sure if this is the way to go