PINE64
Build signal-cli - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: PostmarketOS on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=124)
+---- Thread: Build signal-cli (/showthread.php?tid=14387)



Build signal-cli - uby89 - 07-09-2021

Hello! I have been trying to get signal on my pinephone without using anbox. I am really happy about postmarketos, it is incredibly snappy and the phone functionality works very well.

I have tried to build signal-cli on the pinephone with the latest stable postmarketos 21.06. Glibc is required within the rust modules to build, so I tried to install: sgerrand/alpine-pkg-glibc and changing the target of rust from musl to gnu.
I managed to get the libsignal-client and libzkgroup compiled and I followed the instructions to bundle the .so files back in signal-cli.

Unfortunately when I then tried to run the signal-cli I get:

Missing required native library dependency: libsignal-client.

I had a look through the signal-cli issues and saw that this can happen when compiled with an older version of glibc. Not sure how this happened has the glibc version installed with sgerrand/alpine-pkg-glibc seems recent, but clearly I am missing something here...

I now just tried to do the same build on the pinebook pro with Manjaro. Everything compiled fine, it has and uses glibc rather than musl. I tried the signal-cli and it worked.

I then, maybe ignorantly thought I could copy and paste my build signal-cli from my pinebook pro ( with manjaro ) to my pinephone with postmarketos. They are both aarch64 after all.
I tried to run the signal-cli and again I got: Missing required native library dependency: libsignal-client.

It makes me very sad, in my ignorance I tried what I could but I am a bit lost now.

Is there someone that could help me understand what I am doing wrong and help me?

Thanks in advance Smile


RE: Build signal-cli - saba - 07-19-2021

(07-09-2021, 06:06 AM)uby89 Wrote: I managed to get the libsignal-client and libzkgroup compiled and I followed the instructions to bundle the .so files back in signal-cli.

Unfortunately when I then tried to run the signal-cli I get:

Missing required native library dependency: libsignal-client.

edit: Unless I misunderstood you, you don't "bundle the .so files back in signal-cli". Instead you are removing the bundled libsignal_jni.so (and libzkgroup). Then it will look in your java library path for the ones you compiled/installed. Make sure they are in your java.library.path (run java -XshowSettings:properties to see)

Look here:
https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal

specifically:
Quote:The linux x86_64 version is bundled by default. For other systems, you need to remove the bundled lib from the jar file

zip -d build/install/signal-cli/lib/signal-client-java-*.jar libsignal_jni.so

and please let me know if it works for you. I'm currently using an old version of signal-cli that was previously in Alpine edge (v 0.7.1)


RE: Build signal-cli - uby89 - 07-25-2021

Hi saba,

Thanks for your suggestion I tried it and unfortunately it didn't work. I am getting the same: Missing required native library dependency: libsignal-client.

I checked the java library path:

Code:
java.library.path = /usr/lib/jvm/java-11-openjdk/lib/server
        /usr/lib/jvm/java-11-openjdk/lib
        /usr/lib/jvm/java-11-openjdk/../lib
        /usr/java/packages/lib
        /lib
        /usr/lib

I put libsignal_jni.so and libzkgroup.so in /usr/java/packages/lib .
I had to create that folder and changed the group and owner to the phone user recursively for /usr/java.
I deleted those libs from the respective bundles.

Then I tried to link with the following command:

./build/install/signal-cli/bin/signal-cli link -n "pinephone"

But I got the missing required library error.

I will try again when a new version of signal-cli comes out. If you manage yourself please let me know Smile