Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-03-07 15:27:45 +0100
committerErich Eckner <git@eckner.net>2019-03-07 15:27:45 +0100
commitcc97ad1cad0c0a929379bcb30d2848e783ae2fa0 (patch)
tree5ad31dabb18db852537aa43ff8541a7faa10a411
parent511ee3b06d55f3a31730546ec92ffe95ece2f727 (diff)
community/aubio: make _real_ fix (tested at least once ...)
-rw-r--r--community/aubio/PKGBUILD4
-rw-r--r--community/aubio/assert-almost.patch27
2 files changed, 30 insertions, 1 deletions
diff --git a/community/aubio/PKGBUILD b/community/aubio/PKGBUILD
index 708718d5..b96e10aa 100644
--- a/community/aubio/PKGBUILD
+++ b/community/aubio/PKGBUILD
@@ -1,6 +1,8 @@
eval "$(
declare -f prepare | \
sed '
- /^{/ a find "${pkgbase}-${pkgver}/python/tests" -type f -exec sed -i "s/assert_equal/assert_almost_equal/" {} \\;
+ /^{/ a patch -d "${pkgbase}-${pkgver}" -p1 -i "${srcdir}/assert-almost.patch"
'
)"
+source+=(assert-almost.patch)
+sha512sums+=('3a946aaf305ee93ad70ca3b26529fdd58822c9bd177b5a00ace99426b1ba50672d24331d13b6b172a0f8d01ed23feea478b6a15f379d6affa796eb6c2aaadeb2')
diff --git a/community/aubio/assert-almost.patch b/community/aubio/assert-almost.patch
new file mode 100644
index 00000000..9951636e
--- /dev/null
+++ b/community/aubio/assert-almost.patch
@@ -0,0 +1,27 @@
+--- a/python/tests/test_hztomel.py 2019-03-07 15:05:44.804472410 +0100
++++ b/python/tests/test_hztomel.py 2019-03-07 15:05:44.804472410 +0100
+@@ -17,10 +17,10 @@
+ assert_equal(hztomel(0.), 0.)
+ assert_almost_equal(hztomel(400. / 3.), 2., decimal=5)
+ assert_almost_equal(hztomel(1000. / 3), 5.)
+- assert_equal(hztomel(200.), 3.)
++ assert_almost_equal(hztomel(200.), 3.)
+ assert_almost_equal(hztomel(1000.), 15)
+- assert_almost_equal(hztomel(6400), 42)
+- assert_almost_equal(hztomel(40960), 69)
++ assert_almost_equal(hztomel(6400), 42, decimal=5)
++ assert_almost_equal(hztomel(40960), 69, decimal=5)
+
+ for m in np.linspace(0, 1000, 100):
+ assert_almost_equal(hztomel(meltohz(m)) - m, 0, decimal=3)
+--- a/python/tests/test_hztomel.py 2019-03-07 15:16:06.396709250 +0100
++++ b/python/tests/test_hztomel.py 2019-03-07 15:16:06.396709250 +0100
+@@ -28,7 +28,7 @@
+ def test_meltohz(self):
+ assert_equal(meltohz(0.), 0.)
+ assert_almost_equal(meltohz(2), 400. / 3., decimal=4)
+- assert_equal(meltohz(3.), 200.)
++ assert_almost_equal(meltohz(3.), 200., decimal=5)
+ assert_almost_equal(meltohz(5), 1000. / 3., decimal=4)
+ assert_almost_equal(meltohz(15), 1000., decimal=4)
+ assert_almost_equal(meltohz(42), 6400., decimal=2)