aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2020-05-01 15:52:55 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-05-04 10:32:09 +0000
commitb600e07c9cf94e29e35a6c56c1fc497c87f78937 (patch)
tree200916406a4ba8d4c56c55869d6f7c3324a10be8
parente545d6017c7a12a9edd3f88e0f5f9bc6b3d3e060 (diff)
downloadaports-b600e07c9cf94e29e35a6c56c1fc497c87f78937.tar.gz
aports-b600e07c9cf94e29e35a6c56c1fc497c87f78937.tar.bz2
aports-b600e07c9cf94e29e35a6c56c1fc497c87f78937.tar.xz
testing/libdsme: new aport
-rw-r--r--testing/libdsme/APKBUILD33
-rw-r--r--testing/libdsme/fix-musl-incompatibility.patch145
2 files changed, 178 insertions, 0 deletions
diff --git a/testing/libdsme/APKBUILD b/testing/libdsme/APKBUILD
new file mode 100644
index 0000000000..a3e1ea0726
--- /dev/null
+++ b/testing/libdsme/APKBUILD
@@ -0,0 +1,33 @@
+# Contributor: Bart Ribbers <bribbers@disroot.org>
+# Maintainer: Bart Ribbers <bribbers@disroot.org>
+pkgname=libdsme
+pkgver=0.66.2
+pkgrel=0
+pkgdesc="Libraries for programs that communicate with the Device State Management Entity"
+arch="all"
+url="https://git.sailfishos.org/mer-core/libdsme"
+license="LGPL-2.1-or-later"
+depends="dbus glib"
+depends_dev="glib-dev check-dev"
+makedepends="$depends_dev coreutils"
+subpackages="$pkgname-static $pkgname-dev"
+source="https://git.sailfishos.org/mer-core/libdsme/-/archive/$pkgver/libdsme-$pkgver.tar.gz
+ fix-musl-incompatibility.patch
+ "
+options="!check" # No suitable tests
+
+build() {
+ make
+}
+
+package() {
+ DESTDIR="$pkgdir" make install
+
+ # Create missing symlinks
+ ldconfig "$pkgdir"/usr/lib
+
+ # Remove tests
+ rm -rf "$pkgdir"/opt
+}
+sha512sums="4f34b3e974cd5e8dcb552fedd90ed967769dbbaef106a41f3a6b5b83c9b200a9ea4f2263f966a66a0807c5183cdbf416e60a8af92d8ebf75a656ebb34283454a libdsme-0.66.2.tar.gz
+3b6e2f50fa25e30ca4753ecf3bb1a1769d2afe97f25fffc907d1941cd109c39366a95379621e46053f87f7daa0b443afd91fe9dbf80df7b099ffddacbb367404 fix-musl-incompatibility.patch"
diff --git a/testing/libdsme/fix-musl-incompatibility.patch b/testing/libdsme/fix-musl-incompatibility.patch
new file mode 100644
index 0000000000..69f4b29149
--- /dev/null
+++ b/testing/libdsme/fix-musl-incompatibility.patch
@@ -0,0 +1,145 @@
+Upstream merge request: https://git.sailfishos.org/mer-core/libdsme/merge_requests/8
+
+
+From 33442f0a318af4904164262bb2acc4cf66731578 Mon Sep 17 00:00:00 2001
+From: Bart Ribbers <bribbers@disroot.org>
+Date: Tue, 14 Apr 2020 15:35:06 +0200
+Subject: [PATCH] Replace u_int*_t usages for the enwer uint*_t
+
+---
+ include/dsme/messages.h | 15 ++++++++-------
+ include/dsme/processwd.h | 2 +-
+ message.c | 8 ++++----
+ tests/ut_libdsme.c | 2 +-
+ 4 files changed, 14 insertions(+), 13 deletions(-)
+
+diff --git a/include/dsme/messages.h b/include/dsme/messages.h
+index 3c4eb30..57e12ad 100644
+--- a/include/dsme/messages.h
++++ b/include/dsme/messages.h
+@@ -29,6 +29,7 @@
+
+ #include <stddef.h>
+ #include <sys/types.h>
++#include <stdint.h>
+
+ #ifdef __cplusplus
+ extern "C" {
+@@ -88,9 +89,9 @@ extern "C" {
+ */
+
+ #define DSMEMSG_PRIVATE_FIELDS \
+- u_int32_t line_size_; \
+- u_int32_t size_; \
+- u_int32_t type_;
++ uint32_t line_size_; \
++ uint32_t size_; \
++ uint32_t type_;
+
+ /**
+ Generic message type
+@@ -107,7 +108,7 @@ typedef struct dsmemsg_generic_t {
+ */
+ typedef struct {
+ DSMEMSG_PRIVATE_FIELDS
+- u_int8_t reason;
++ uint8_t reason;
+ } DSM_MSGTYPE_CLOSE;
+
+ /**
+@@ -169,7 +170,7 @@ enum {
+ * @param size message body size
+ * @param extra space to reserve for extra data
+ */
+-void *dsmemsg_new(u_int32_t id, size_t size, size_t extra);
++void *dsmemsg_new(uint32_t id, size_t size, size_t extra);
+
+ /** Get dsme message type identifier
+ *
+@@ -177,7 +178,7 @@ void *dsmemsg_new(u_int32_t id, size_t size, size_t extra);
+ *
+ * @return type identifier
+ */
+-u_int32_t dsmemsg_id(const dsmemsg_generic_t *msg);
++uint32_t dsmemsg_id(const dsmemsg_generic_t *msg);
+
+ /** Get human readable name of dsme message type
+ *
+@@ -242,7 +243,7 @@ const void *dsmemsg_extra_data(const dsmemsg_generic_t *msg);
+ *
+ * @sa dsmemsg_name()
+ */
+-const char * dsmemsg_id_name(u_int32_t id);
++const char * dsmemsg_id_name(uint32_t id);
+
+ #ifdef __cplusplus
+ }
+diff --git a/include/dsme/processwd.h b/include/dsme/processwd.h
+index ed77cc0..afb578f 100644
+--- a/include/dsme/processwd.h
++++ b/include/dsme/processwd.h
+@@ -65,7 +65,7 @@ typedef dsmemsg_generic_t DSM_MSGTYPE_PROCESSWD_MANUAL_PING;
+
+ typedef struct {
+ DSMEMSG_PRIVATE_FIELDS
+- u_int32_t timeout;
++ uint32_t timeout;
+ } DSM_MSGTYPE_PROCESSWD_SET_INTERVAL;
+
+ #endif
+diff --git a/message.c b/message.c
+index f8d91bb..5ff5585 100644
+--- a/message.c
++++ b/message.c
+@@ -38,7 +38,7 @@
+ static const struct
+ {
+ const char *name;
+- u_int32_t id;
++ uint32_t id;
+ } dsmemsg_id_lut[] =
+ {
+ { "CLOSE", 0x00000001 },
+@@ -90,7 +90,7 @@ static const struct
+ };
+
+ const char *
+-dsmemsg_id_name(u_int32_t id)
++dsmemsg_id_name(uint32_t id)
+ {
+ for( size_t i = 0; dsmemsg_id_lut[i].name; ++i ) {
+ if( dsmemsg_id_lut[i].id == id )
+@@ -104,7 +104,7 @@ dsmemsg_id_name(u_int32_t id)
+ }
+
+ void *
+-dsmemsg_new(u_int32_t id, size_t size, size_t extra)
++dsmemsg_new(uint32_t id, size_t size, size_t extra)
+ {
+ dsmemsg_generic_t *msg = calloc(1, size + extra);
+ if (msg == NULL) {
+@@ -119,7 +119,7 @@ dsmemsg_new(u_int32_t id, size_t size, size_t extra)
+ return msg;
+ }
+
+-u_int32_t dsmemsg_id(const dsmemsg_generic_t *msg)
++uint32_t dsmemsg_id(const dsmemsg_generic_t *msg)
+ {
+ return msg->type_;
+ }
+diff --git a/tests/ut_libdsme.c b/tests/ut_libdsme.c
+index 4afa436..7ac6805 100644
+--- a/tests/ut_libdsme.c
++++ b/tests/ut_libdsme.c
+@@ -127,7 +127,7 @@ static int mock(void)
+
+ START_TEST(test_message)
+ {
+- const u_int32_t id = 42;
++ const uint32_t id = 42;
+
+ dsmemsg_generic_t* msg = dsmemsg_new(id, sizeof(dsmemsg_generic_t), sizeof(int));
+
+--
+2.23.0
+