Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: Ilias Tsitsimpis <ilias...@debian.org>

  * Backport upstream patch to fix failing test (Closes: #953539)
  * Patch udatetime to properly link against libm library.
    Thanks to Aurelien Jarno for the patch (Closes: #954305)

The first change is a FTBFS fix.

The second change is correct, it might or might not make a difference
when upgrading to bullseye.

python-udatetime was not previously rebuilt to drop the C extension
for Python 3.6 (not in buster), only the Python 3.7 extension is built now.
diff -Nru python-udatetime-0.0.16/debian/changelog 
python-udatetime-0.0.16/debian/changelog
--- python-udatetime-0.0.16/debian/changelog    2018-02-15 21:10:47.000000000 
+0200
+++ python-udatetime-0.0.16/debian/changelog    2022-08-26 20:11:06.000000000 
+0300
@@ -1,3 +1,12 @@
+python-udatetime (0.0.16-1+deb10u1) buster; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport upstream patch to fix failing test (Closes: #953539)
+  * Patch udatetime to properly link against libm library.
+    Thanks to Aurelien Jarno for the patch (Closes: #954305)
+
+ -- Adrian Bunk <b...@debian.org>  Fri, 26 Aug 2022 20:11:06 +0300
+
 python-udatetime (0.0.16-1) unstable; urgency=low
 
   [ Ondřej Nový ]
diff -Nru python-udatetime-0.0.16/debian/patches/fix-test.patch 
python-udatetime-0.0.16/debian/patches/fix-test.patch
--- python-udatetime-0.0.16/debian/patches/fix-test.patch       1970-01-01 
02:00:00.000000000 +0200
+++ python-udatetime-0.0.16/debian/patches/fix-test.patch       2020-10-17 
07:31:51.000000000 +0300
@@ -0,0 +1,23 @@
+From: Simon Pirschel <si...@aboutsimon.com>
+Date: Wed, 14 Mar 2018 11:42:36 +0100
+Subject: test with calculated offset based on diff between utc and local time
+
+---
+ test/test_udatetime.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/test/test_udatetime.py b/test/test_udatetime.py
+index e9a00b7..3fbde87 100644
+--- a/test/test_udatetime.py
++++ b/test/test_udatetime.py
+@@ -75,7 +75,9 @@ class Test(unittest.TestCase):
+             self.assertEqual(udt.second, dt.second)
+             self.assertEqual(udt.microsecond, dt.microsecond)
+ 
+-            self.assertEqual(udt.utcoffset(), timedelta(0))
++            offset = datetime.fromtimestamp(t) - datetime.utcfromtimestamp(t)
++
++            self.assertEqual(udt.utcoffset(), offset)
+             self.assertEqual(udt.dst(), NO_DST)
+ 
+         for t in range(0, DAY, HOUR):
diff -Nru python-udatetime-0.0.16/debian/patches/Link-against-libm.patch 
python-udatetime-0.0.16/debian/patches/Link-against-libm.patch
--- python-udatetime-0.0.16/debian/patches/Link-against-libm.patch      
1970-01-01 02:00:00.000000000 +0200
+++ python-udatetime-0.0.16/debian/patches/Link-against-libm.patch      
2020-10-17 07:31:51.000000000 +0300
@@ -0,0 +1,22 @@
+From: Ilias Tsitsimpis <ilias...@debian.org>
+Date: Fri, 1 May 2020 20:29:16 +0300
+Subject: Link against libm
+
+Bug: https://github.com/freach/udatetime/issues/30
+Bug-Debian: https://bugs.debian.org/954305
+---
+ setup.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/setup.py b/setup.py
+index 2770298..498f40c 100644
+--- a/setup.py
++++ b/setup.py
+@@ -36,6 +36,7 @@ if __pypy__ is None:
+         Extension(
+             'udatetime.rfc3339',
+             ['./src/rfc3339.c'],
++            libraries=['m'],
+             define_macros=macros,
+             extra_compile_args=['-Ofast', '-std=c99']
+         )
diff -Nru python-udatetime-0.0.16/debian/patches/series 
python-udatetime-0.0.16/debian/patches/series
--- python-udatetime-0.0.16/debian/patches/series       1970-01-01 
02:00:00.000000000 +0200
+++ python-udatetime-0.0.16/debian/patches/series       2022-08-26 
20:10:30.000000000 +0300
@@ -0,0 +1,2 @@
+fix-test.patch
+Link-against-libm.patch

Reply via email to