Skip to content

Commit

Permalink
fixed signal-cli-native build
Browse files Browse the repository at this point in the history
* due to different glibc versions, it is not possible to use the
  existing (prebuilt) libsignal_jni.so that get's shipped with the
  signal-cli binary distribution for the signal-cli native image build.
  So in order to make that work (again), we need to use our own
  libsignal_jni.so for the x86_64 build.

see #412
  • Loading branch information
Bernhard B committed Oct 2, 2023
1 parent db005cd commit f18ebde
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ARG BUILD_VERSION_ARG
ARG SIGNAL_CLI_NATIVE_PACKAGE_VERSION

COPY ext/libraries/libsignal-client/v${LIBSIGNAL_CLIENT_VERSION} /tmp/libsignal-client-libraries
COPY ext/libraries/libsignal-client/signal-cli-native.patch /tmp/signal-cli-native.patch

# use architecture specific libsignal_jni.so
RUN arch="$(uname -m)"; \
Expand Down Expand Up @@ -76,6 +77,13 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \
&& export PATH=/tmp/graalvm/bin:$PATH \
&& cd /tmp/signal-cli-${SIGNAL_CLI_VERSION}-source \
&& sed -i 's/Signal-Android\/5.22.3/Signal-Android\/5.51.7/g' src/main/java/org/asamk/signal/BaseConfig.java \
&& ./gradlew build \
&& ./gradlew installDist \
&& cd /tmp \
&& cp signal-cli-${SIGNAL_CLI_VERSION}-source/build/install/signal-cli/lib/libsignal-client-${LIBSIGNAL_CLIENT_VERSION}.jar libsignal-client.jar \
&& zip -qu libsignal-client.jar libsignal_jni.so \
&& cd /tmp/signal-cli-${SIGNAL_CLI_VERSION}-source \
&& git apply /tmp/signal-cli-native.patch \
&& ./gradlew -q nativeCompile; \
elif [ "$(uname -m)" = "aarch64" ] ; then \
echo "Use native image from @morph027 (https://packaging.gitlab.io/signal-cli/) for arm64 - many thanks to @morph027" \
Expand Down
23 changes: 23 additions & 0 deletions ext/libraries/libsignal-client/signal-cli-native.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/build.gradle.kts b/build.gradle.kts
index 0d89c075..fda49332 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -43,6 +43,7 @@ dependencies {
implementation(libs.slf4j.jul)
implementation(libs.logback)
implementation(project(":lib"))
+ implementation(files("/tmp/libsignal-client.jar"))
}

configurations {
@@ -51,6 +52,10 @@ configurations {
}
}

+configurations.all {
+ exclude(group = "org.signal", module = "libsignal-client")
+}
+

tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false

0 comments on commit f18ebde

Please sign in to comment.