aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-05-07 18:19:52 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-05-07 18:23:32 +0000
commitf5cf8a771108f1e4fc87a7f60c26567284929abb (patch)
tree44123071627d340c528d2eb0c9154c6c1008f19d
parentd39626f995594492f959f760f7383b41163160f3 (diff)
downloadaports-f5cf8a771108f1e4fc87a7f60c26567284929abb.tar.bz2
aports-f5cf8a771108f1e4fc87a7f60c26567284929abb.tar.xz
community/sox: fix build on big-endian (s390x)
-rw-r--r--community/sox/APKBUILD6
-rw-r--r--community/sox/sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch44
2 files changed, 48 insertions, 2 deletions
diff --git a/community/sox/APKBUILD b/community/sox/APKBUILD
index b53216274c..b9c1366c16 100644
--- a/community/sox/APKBUILD
+++ b/community/sox/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sox
pkgver=14.4.2
-pkgrel=3
+pkgrel=4
pkgdesc="The Swiss Army knife of sound processing tools"
url="http://sox.sourceforge.net/"
arch="all"
@@ -17,6 +17,7 @@ subpackages="$pkgname-static $pkgname-doc $pkgname-dev"
source="https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz
sox-uclibc.patch
sox-dynamic.patch
+ sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch
"
prepare() {
@@ -47,4 +48,5 @@ package() {
}
sha512sums="b5c6203f4f5577503a034fe5b3d6a033ee97fe4d171c533933e2b036118a43a14f97c9668433229708609ccf9ee16abdeca3fc7501aa0aafe06baacbba537eca sox-14.4.2.tar.gz
08c55a0de96733e10544d450f39c2205b4057b9fc024503ec97b1906a075752ee8a4b0a1b4c5bbad2eebec17bcf8d069b22d243a63d28b77c23d545efcca6aec sox-uclibc.patch
-3950834db26faa0523006c6fd8e0769d080518f127d345c8ec9bf53e9db8a6bd67cd724f0f86492aaf9ce6ede2dfbde167049768f35c14ef3c2b96e7e00302b6 sox-dynamic.patch"
+3950834db26faa0523006c6fd8e0769d080518f127d345c8ec9bf53e9db8a6bd67cd724f0f86492aaf9ce6ede2dfbde167049768f35c14ef3c2b96e7e00302b6 sox-dynamic.patch
+aea1bcfdddd315d05654814e386512f0254d1707564a8370d6b2a8a2d12ecb527a7a566da8f2cfa9f0ee99369fab0f19819263d0d74de0616c9175362965e04c sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch"
diff --git a/community/sox/sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch b/community/sox/sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch
new file mode 100644
index 0000000000..9aa8206471
--- /dev/null
+++ b/community/sox/sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch
@@ -0,0 +1,44 @@
+diff --git a/src/hcom.c b/src/hcom.c
+index e76820e..fb8de99 100644
+--- a/src/hcom.c
++++ b/src/hcom.c
+@@ -428,12 +428,19 @@ static int stopwrite(sox_format_t * ft)
+ {
+ priv_t *p = (priv_t *) ft->priv;
+ unsigned char *compressed_data = p->data;
+- size_t compressed_len = p->pos;
++ int32_t compressed_len = (int32_t)p->pos;
+ int rc = SOX_SUCCESS;
+
++ if (p->pos >> 32 > 0)
++ lsx_warn(
++ "%s: possible data loss"
++ " (the size of data to be written has exceeded its limit)",
++ ft->filename
++ );
++
+ /* Compress it all at once */
+ if (compressed_len)
+- compress(ft, &compressed_data, (int32_t *)&compressed_len);
++ compress(ft, &compressed_data, &compressed_len);
+ free(p->data);
+
+ /* Write the header */
+@@ -447,7 +454,7 @@ static int stopwrite(sox_format_t * ft)
+ if (lsx_error(ft)) {
+ lsx_fail_errno(ft, errno, "write error in HCOM header");
+ rc = SOX_EOF;
+- } else if (lsx_writebuf(ft, compressed_data, compressed_len) != compressed_len) {
++ } else if (lsx_writebuf(ft, compressed_data, (size_t) compressed_len) != (size_t) compressed_len) {
+ /* Write the compressed_data fork */
+ lsx_fail_errno(ft, errno, "can't write compressed HCOM data");
+ rc = SOX_EOF;
+@@ -456,7 +463,7 @@ static int stopwrite(sox_format_t * ft)
+
+ if (rc == SOX_SUCCESS)
+ /* Pad the compressed_data fork to a multiple of 128 bytes */
+- lsx_padbytes(ft, 128u - (compressed_len % 128));
++ lsx_padbytes(ft, (size_t) 128 - (compressed_len % 128));
+
+ return rc;
+ }