aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-10-29 20:30:09 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-10-29 20:31:38 +0100
commitcfc99dd12a50fac812fd55128771c500a9b9566f (patch)
treed7352ffe7c51471afe458cdd6982ce51fba00bba
parent648e695f0375d80383ca47f003e63a39ca712611 (diff)
downloadaports-cfc99dd12a50fac812fd55128771c500a9b9566f.tar.gz
aports-cfc99dd12a50fac812fd55128771c500a9b9566f.tar.bz2
aports-cfc99dd12a50fac812fd55128771c500a9b9566f.tar.xz
community/notmuch: use python3 for building and fix tests
This may also hopefully fix build on armhf...
-rw-r--r--community/notmuch/APKBUILD11
-rw-r--r--community/notmuch/fix-tests-for-python3.patch20
2 files changed, 27 insertions, 4 deletions
diff --git a/community/notmuch/APKBUILD b/community/notmuch/APKBUILD
index 2cfb90a868..c1e5719d0e 100644
--- a/community/notmuch/APKBUILD
+++ b/community/notmuch/APKBUILD
@@ -22,12 +22,14 @@ subpackages="
$pkgname-zsh-completion:zshcomp:noarch
$pkgname-bash-completion:bashcomp:noarch"
source="https://notmuchmail.org/releases/$pkgname-$pkgver.tar.gz
- fix-tests.patch"
-
+ fix-tests.patch
+ fix-tests-for-python3.patch"
builddir="$srcdir/$pkgname-$pkgver"
+
build() {
cd "$builddir"
- ./configure \
+
+ PYTHON=python3 ./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
@@ -128,4 +130,5 @@ py3() {
}
sha512sums="989acc5eda7d2f9512741c8ae850e34c6fbbdd5fa5fa23f25a6096250d414919007c5cfda68d6f48606c0a024692e082a28cb358e6d3fc2afc0502b5bcbf5f54 notmuch-0.25.1.tar.gz
-430e8f02b194b0582dfd7c66a2791a0071824e1d215993a6daf89c8d2a1ee7f73a6202136b1d890fc8920a4dc309ae976da8a8b8fc8b90e489d3c04f1592876c fix-tests.patch"
+430e8f02b194b0582dfd7c66a2791a0071824e1d215993a6daf89c8d2a1ee7f73a6202136b1d890fc8920a4dc309ae976da8a8b8fc8b90e489d3c04f1592876c fix-tests.patch
+a7dd888c5d08835be75986e67afcbc95c7a65c187fab5b0eb969bb36e9bbbc2d647789f106f709a38906eed51e3684a3241678ace1fc8c4b5e1cdbdd06fb6bbb fix-tests-for-python3.patch"
diff --git a/community/notmuch/fix-tests-for-python3.patch b/community/notmuch/fix-tests-for-python3.patch
new file mode 100644
index 0000000000..1b71751db4
--- /dev/null
+++ b/community/notmuch/fix-tests-for-python3.patch
@@ -0,0 +1,20 @@
+Fix test-lib.sh for Python 3.5+.
+
+Since Python 3.5 json.tool does not sort JSON keys unless --sort-keys
+is specified.
+See https://docs.python.org/3/library/json.html#module-json.tool.
+
+--- a/test/test-lib.sh
++++ b/test/test-lib.sh
+@@ -627,9 +627,9 @@
+ # The test suite forces LC_ALL=C, but this causes Python 3 to
+ # decode stdin as ASCII. We need to read JSON in UTF-8, so
+ # override Python's stdio encoding defaults.
+- output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \
++ output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool --sort-keys \
+ || echo "$1")
+- expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \
++ expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool --sort-keys \
+ || echo "$2")
+ shift 2
+ test_expect_equal "$output" "$expected" "$@"