Without that fix, it links against OpenSSL 3.0 which deprecated
MD5_Init, MD5_Update and MD5_Final. And so we end up with warnings
like that:
    samsung-ipc/rfs.c: In function ‘ipc_nv_data_md5_calculate’:
    samsung-ipc/rfs.c:75:9: error: ‘MD5_Init’ is deprecated: Since
    OpenSSL 3.0 [-Werror=deprecated-declarations]
    [...]
    samsung-ipc/rfs.c:76:9: error: ‘MD5_Update’ is deprecated: Since
    OpenSSL 3.0 [-Werror=deprecated-declarations]
    [...]
    samsung-ipc/rfs.c:78:9: error: ‘MD5_Final’ is deprecated: Since
    OpenSSL 3.0 [-Werror=deprecated-declarations]
but since we use -Werror the build fails.

If we simply update libsamsung-ipc to use the newer OpenSSL API, then
it will not compile anymore on older Android versions.

So to update libsamsung-ipc we would need to be compatible with both
older and newer OpenSSL APIs, and that requires a bit more work.

So if we don't want to do that work now, we need a drop-in replacement
package that implements the old OpenSSL API.

In addition using OpenSSL 3.x also bring up licensing consideration as
OpenSSL 3.x versions have changed license from the OpenSSL license
(which was compatible with the GPLv2) to the Apache 2.0 license (which
is only compatible with the GPLv3).

So that can limit the integration of libsamsung-ipc into daemons like
oFono that don't want to link against GPLv3+ libraries.

To avoid these downsides we have the choice between two drop-in
replacement packages: openssl-1.1 and libressl.

Since OpenSSL 1.1.1 will be supported until the 11th September
2023[1], we use LibreSSL in the hope that they will keep the MD5_*
interfaces longer.

[1]https://www.openssl.org/source/

Signed-off-by: Denis 'GNUtoo' Carikli <gnu...@cyberdimension.org>
---
 scripts/guix.scm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/guix.scm b/scripts/guix.scm
index bc2f7c3..6343208 100644
--- a/scripts/guix.scm
+++ b/scripts/guix.scm
@@ -175,7 +175,7 @@
                          python
                          python-sh
                          valgrind))
-    (inputs (list curl openssl))
+    (inputs (list curl libressl))
     (arguments
      (list #:phases #~(modify-phases %standard-phases
                         (add-before 'build 'fix-valgrind
@@ -218,8 +218,9 @@ found in many Samsung smartphones and tablets.")
                          pkg-config
                          python
                          python-sh))
-    (inputs (list curl openssl
-                  `(,(canonical-package openssl) "static")))
+    ;; The libressl package contains .a in
+    ;; /gnu/store/[...]-libressl-[...]/lib/*.a
+    (inputs (list curl libressl))
     (arguments
      (list #:modules '((ice-9 popen)
                        (ice-9 rdelim)
@@ -267,7 +268,7 @@ found in many Samsung smartphones and tablets.")
     (inherit libsamsung-ipc)
     (name "libsamsung-ipc-gcc-android")
     (build-system android-ndk-build-system)
-    (inputs (list android-libutils curl openssl))
+    (inputs (list android-libutils curl libressl))
     (native-inputs '())
     (arguments
      (list #:make-flags #~(list #$%common-strict-cflags
@@ -304,7 +305,7 @@ found in many Samsung smartphones and tablets.")
     (inherit libsamsung-ipc)
     (name "libsamsung-ipc-clang-android")
     (build-system android-ndk-build-system)
-    (inputs (list android-libutils clang curl openssl))
+    (inputs (list android-libutils clang curl libressl))
     (native-inputs '())
     (arguments
      (list #:make-flags #~(list #$%common-strict-cflags
-- 
2.41.0

_______________________________________________
Replicant mailing list
Replicant@osuosl.org
https://lists.osuosl.org/mailman/listinfo/replicant

Reply via email to