aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2020-05-01 16:12:46 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-05-04 10:32:09 +0000
commitbc1493f5437a657e1987fa43453afe22a2a4bac9 (patch)
treea6395cebb32b6bb0e01a9c03179742783495ade4
parentb2b324bb4aa7707201787dd7ef6dbcc8a2352114 (diff)
downloadaports-bc1493f5437a657e1987fa43453afe22a2a4bac9.tar.gz
aports-bc1493f5437a657e1987fa43453afe22a2a4bac9.tar.bz2
aports-bc1493f5437a657e1987fa43453afe22a2a4bac9.tar.xz
testing/usb-moded: new aport
-rw-r--r--testing/usb-moded/APKBUILD49
-rw-r--r--testing/usb-moded/fix-musl-incompatibility.patch54
2 files changed, 103 insertions, 0 deletions
diff --git a/testing/usb-moded/APKBUILD b/testing/usb-moded/APKBUILD
new file mode 100644
index 0000000000..39b4dac1bf
--- /dev/null
+++ b/testing/usb-moded/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Bart Ribbers <bribbers@disroot.org>
+# Maintainer: Bart Ribbers <bribbers@disroot.org>
+pkgname=usb-moded
+pkgver=0.86.0
+_pkgver=mer/$pkgver+mer40
+pkgrel=0
+pkgdesc="A daemon activating a certain USB profile based on the usb cable connection status"
+url="https://git.sailfishos.org/mer-core/usb-moded"
+arch="all"
+license="GPL-2.0-only"
+depends_dev="glib-dev dbus-glib-dev gobject-introspection-dev eudev-dev kmod-dev libdsme-dev elogind-dev ssu-sysinfo-dev sailfish-access-control"
+makedepends="$depends_dev automake autoconf libtool dbus-dev"
+subpackages="$pkgname-dev"
+source="https://git.sailfishos.org/mer-core/usb-moded/-/archive/$_pkgver/usb-moded-${_pkgver/\//-}.tar.gz
+ fix-musl-incompatibility.patch
+ "
+options="!check" # No test suite available
+builddir="$srcdir/$pkgname-${_pkgver/\//-}"
+
+prepare() {
+ default_prepare
+
+ # Fix invalid pkgconf version
+ sed -i 's/+mer/./' configure.ac
+
+ ./autogen.sh
+}
+
+build() {
+ ./configure \
+ --prefix=/usr \
+ --enable-connman \
+ --enable-ofono
+ make
+}
+
+package() {
+ DESTDIR="$pkgdir" make install
+
+ # The pkg-config file isn't installed automatically for some reason
+ install -dm 755 "$pkgdir"/usr/lib/pkgconfig
+ install -m 644 usb_moded.pc "$pkgdir"/usr/lib/pkgconfig/
+
+ install -dm 755 "$pkgdir"/usr/include/$pkgname
+ cp src/*.h src/*.xml "$pkgdir"/usr/include/$pkgname
+}
+
+sha512sums="6c35a67fa7a44068af2fe942d9e828ae0456ed76e184c2fde57d319a6de4ab691de84c596f85f26770e30951972527c34204cb9221563bc9d84868042e0c6733 usb-moded-mer-0.86.0+mer40.tar.gz
+504ce76ab1464b13a96fc69946d3b9bee45d91479786a9eb9bf82e893a22fd24c48bde71db789b769a4811069bde8003baf612594e35054b2da2865e9cb175ff fix-musl-incompatibility.patch"
diff --git a/testing/usb-moded/fix-musl-incompatibility.patch b/testing/usb-moded/fix-musl-incompatibility.patch
new file mode 100644
index 0000000000..336f757353
--- /dev/null
+++ b/testing/usb-moded/fix-musl-incompatibility.patch
@@ -0,0 +1,54 @@
+Has been merged upstream already. https://git.sailfishos.org/mer-core/usb-moded/merge_requests/57
+
+From 6d19366c5c9fff70c0337e1288b33c6834e3374c Mon Sep 17 00:00:00 2001
+From: Bart Ribbers <bribbers@disroot.org>
+Date: Wed, 25 Mar 2020 12:48:55 +0100
+Subject: [PATCH] Define TEMP_FAILURE_RETRY on non-glibc systems
+
+This makes it work for example on Musl systems
+---
+ src/usb_moded-modesetting.h | 10 ++++++++++
+ src/usb_moded-sigpipe.h | 10 ++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/src/usb_moded-modesetting.h b/src/usb_moded-modesetting.h
+index 95e345a..92cceab 100644
+--- a/src/usb_moded-modesetting.h
++++ b/src/usb_moded-modesetting.h
+@@ -57,4 +57,14 @@ void modesetting_quit (void);
+ # define write_to_file(path,text)\
+ modesetting_write_to_file_real(__FILE__,__LINE__,__FUNCTION__,(path),(text))
+
++/* Used to retry syscalls that can return EINTR. Taken from bionic unistd.h */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(exp) ({ \
++ __typeof__(exp) _rc; \
++ do { \
++ _rc = (exp); \
++ } while (_rc == -1 && errno == EINTR); \
++ _rc; })
++#endif
++
+ #endif /* USB_MODED_MODESETTING_H_ */
+diff --git a/src/usb_moded-sigpipe.h b/src/usb_moded-sigpipe.h
+index 095863d..fcea271 100644
+--- a/src/usb_moded-sigpipe.h
++++ b/src/usb_moded-sigpipe.h
+@@ -37,4 +37,14 @@
+
+ bool sigpipe_init(void);
+
++/* Used to retry syscalls that can return EINTR. Taken from Bionic unistd.h */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(exp) ({ \
++ __typeof__(exp) _rc; \
++ do { \
++ _rc = (exp); \
++ } while (_rc == -1 && errno == EINTR); \
++ _rc; })
++#endif
++
+ #endif /* USB_MODED_SIGPIPE_H_ */
+--
+2.23.0
+