Github messages for voidlinux
 help / color / mirror / Atom feed
From: fanyx <fanyx@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] iio-sensor-proxy: update to 3.5.
Date: Sat, 20 Apr 2024 23:23:16 +0200	[thread overview]
Message-ID: <20240420212316.EBA72234B2@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-49940@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

There is an updated pull request by fanyx against master on the void-packages repository

https://github.com/fanyx/void-packages iio-sensor-proxy
https://github.com/void-linux/void-packages/pull/49940

iio-sensor-proxy: update to 3.5.
#### Testing the changes
- I tested the changes in this PR: **NO**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64
  - armv7l


A patch file from https://github.com/void-linux/void-packages/pull/49940.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-iio-sensor-proxy-49940.patch --]
[-- Type: text/x-diff, Size: 5866 bytes --]

From c69132e30b4dc158bd8e6d93169b89f83084e7bf Mon Sep 17 00:00:00 2001
From: fanyx <fanyx@posteo.net>
Date: Sat, 20 Apr 2024 22:21:39 +0200
Subject: [PATCH] iio-sensor-proxy: update to 3.5.

---
 .../patches/fr_FR_locale-test.patch           | 101 ++++++++++++++++++
 srcpkgs/iio-sensor-proxy/template             |  12 +--
 2 files changed, 103 insertions(+), 10 deletions(-)
 create mode 100644 srcpkgs/iio-sensor-proxy/patches/fr_FR_locale-test.patch

diff --git a/srcpkgs/iio-sensor-proxy/patches/fr_FR_locale-test.patch b/srcpkgs/iio-sensor-proxy/patches/fr_FR_locale-test.patch
new file mode 100644
index 00000000000000..8c6c3d19bf7179
--- /dev/null
+++ b/srcpkgs/iio-sensor-proxy/patches/fr_FR_locale-test.patch
@@ -0,0 +1,101 @@
+From fe56bdba1243cc5f6a652eb75d11ae1d1957ff7e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
+Date: Mon, 4 Mar 2024 08:18:54 +0100
+Subject: [PATCH] tests: Skip some test when fr_FR locale isn't available
+
+Some test require that locale so skip those when it is unavailable.
+
+Closes: #392
+---
+ src/test-mount-matrix.c   |  8 ++++++--
+ tests/integration-test.py | 20 +++++++++++++++-----
+ 2 files changed, 21 insertions(+), 7 deletions(-)
+
+diff --git a/src/test-mount-matrix.c b/src/test-mount-matrix.c
+index 0cf6c34..d0b608c 100644
+--- a/src/test-mount-matrix.c
++++ b/src/test-mount-matrix.c
+@@ -66,12 +66,16 @@ test_mount_matrix (void)
+ static void
+ test_comma_decimal_separator (void)
+ {
++	const char *fr_locale = "fr_FR.UTF-8";
+ 	char *old_locale;
+ 	AccelVec3 *vecs;
+ 
+-	old_locale = setlocale (LC_ALL, "fr_FR.UTF-8");
++	old_locale = setlocale (LC_ALL, fr_locale);
+ 	/* French locale not available? */
+-	g_assert_nonnull (old_locale);
++	if (!old_locale) {
++		g_test_skip_printf ("Local %s not available", fr_locale);
++		return;
++	}
+ 
+ 	/* Default matrix */
+ 	g_assert_true (parse_mount_matrix (DEFAULT_MATRIX, &vecs));
+diff --git a/tests/integration-test.py b/tests/integration-test.py
+index 20c0e92..4ccabb3 100755
+--- a/tests/integration-test.py
++++ b/tests/integration-test.py
+@@ -27,6 +27,7 @@ import tempfile
+ import psutil
+ import subprocess
+ import unittest
++import locale
+ import time
+ 
+ try:
+@@ -50,6 +51,7 @@ SP_COMPASS = 'net.hadess.SensorProxy.Compass'
+ SP_COMPASS_PATH = '/net/hadess/SensorProxy/Compass'
+ 
+ class Tests(dbusmock.DBusTestCase):
++
+     @classmethod
+     def setUpClass(cls):
+         # run from local build tree if we are in one, otherwise use system instance
+@@ -92,6 +94,15 @@ class Tests(dbusmock.DBusTestCase):
+         cls.dbus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
+         cls.dbus_con = cls.get_dbus(True)
+ 
++        # Some test outputs require the daemon to run under the fr locale:
++        # so check if that's available
++        try:
++            old_loc = locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
++            cls.has_fr = True
++            locale.setlocale(locale.LC_ALL, old_loc)
++        except:
++            cls.has_fr = False
++
+     @classmethod
+     def tearDownClass(cls):
+         cls.test_bus.down()
+@@ -612,10 +623,9 @@ class Tests(dbusmock.DBusTestCase):
+             mock_file.write(data)
+         self.proxy.ClaimAccelerometer()
+         self.assertEventually(lambda: self.have_text_in_log('Accel sent by driver'))
+-        # If the 2nd test fails, it's likely that fr_FR.UTF-8 locale isn't supported
+         self.assertEqual(self.have_text_in_log('scale: 0,000000,0,000000,0,000000'), False)
+-        self.assertEqual(self.have_text_in_log('scale: 0,000010,0,000010,0,000010'), True)
+-
++        if self.has_fr:
++            self.assertEqual(self.have_text_in_log('scale: 0,000010,0,000010,0,000010'), True)
+         self.stop_daemon()
+ 
+     def test_iio_scale_decimal_separator_offset(self):
+@@ -715,9 +725,9 @@ class Tests(dbusmock.DBusTestCase):
+ 
+         self.proxy.ClaimAccelerometer()
+         self.assertEventually(lambda: self.have_text_in_log('Accel read from IIO on'))
+-        # If the 2nd test fails, it's likely that fr_FR.UTF-8 locale isn't supported
+         self.assertEqual(self.have_text_in_log('scale 1,000000,1,000000,1,000000'), False)
+-        self.assertEqual(self.have_text_in_log('scale 0,000001,0,000001,0,000001'), True)
++        if self.has_fr:
++            self.assertEqual(self.have_text_in_log('scale 0,000001,0,000001,0,000001'), True)
+ 
+         self.assertEventually(lambda: self.get_dbus_property('AccelerometerOrientation') == 'normal')
+ 
+-- 
+GitLab
+
+
diff --git a/srcpkgs/iio-sensor-proxy/template b/srcpkgs/iio-sensor-proxy/template
index d76a6f58b32751..e8cb56bba08528 100644
--- a/srcpkgs/iio-sensor-proxy/template
+++ b/srcpkgs/iio-sensor-proxy/template
@@ -1,6 +1,6 @@
 # Template file for 'iio-sensor-proxy'
 pkgname=iio-sensor-proxy
-version=3.4
+version=3.5
 revision=1
 build_style=meson
 configure_args="-Dsystemdsystemunitdir=/usr/lib/systemd/system/
@@ -14,20 +14,12 @@ license="GPL-3.0-or-later"
 homepage="https://gitlab.freedesktop.org/hadess/iio-sensor-proxy"
 changelog="https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/raw/master/NEWS"
 distfiles="https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/archive/${version}/${pkgname}-${version}.tar.gz"
-checksum=9339af3bc83994a43ab25231a8ffe9ada6d9afbc16edc44d575dd9f2a69ede3c
+checksum=8689425f2287626a95d95b1e1e5b62e497d09dd08cf411084ed22166d4a49da5
 
 if [ "$XBPS_CHECK_PKGS" ]; then
 configure_args+=" -Dtests=true -Dgtk-tests=true"
 fi
 
-post_patch() {
-	# Tests expect a fr_FR.UTF-8 locale
-	vsed -i -e "/env\['LC_NUMERIC'\]/d" tests/integration-test.py
-	vsed -i -e 's/scale: 0,000010,0,000010,0,000010/scale: 0.000010,0.000010,0.000010/g' \
-	 -e 's/scale 0,000001,0,000001,0,000001/scale 0.000001,0.000001,0.000001/g' \
-	 tests/integration-test.py
-}
-
 post_install() {
 	vsv iio-sensor-proxy
 }

  parent reply	other threads:[~2024-04-20 21:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20 20:22 [PR PATCH] " fanyx
2024-04-20 21:13 ` oreo639
2024-04-20 21:15 ` oreo639
2024-04-20 21:17 ` oreo639
2024-04-20 21:17 ` oreo639
2024-04-20 21:17 ` oreo639
2024-04-20 21:20 ` fanyx
2024-04-20 21:23 ` fanyx [this message]
2024-04-20 21:32 ` fanyx
2024-04-20 21:37 ` oreo639
2024-04-20 21:37 ` oreo639
2024-04-20 21:38 ` oreo639
2024-04-20 21:45 ` oreo639
2024-04-20 21:58 ` [PR PATCH] [Updated] " fanyx
2024-04-20 22:54 ` fanyx
2024-04-21  1:05 ` oreo639
2024-04-21  1:06 ` [PR PATCH] [Merged]: " oreo639
2024-04-21  6:27 ` fanyx
2024-04-21  7:03 ` fanyx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240420212316.EBA72234B2@inbox.vuxu.org \
    --to=fanyx@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).