summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-02 23:10:46 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-02 23:21:33 -0700
commit5ae527ccb005f448c1de107332cf5fbe9e28d236 (patch)
tree5da0b4d86cda792f67ebfd2ed4d42ea3b1a5f2aa /media-libs/libdvbcsa
parentprofiles/arch/powerpc/ppc64/64le: mask altivec for dvbcsa (diff)
downloadgentoo-5ae527ccb005f448c1de107332cf5fbe9e28d236.tar.gz
gentoo-5ae527ccb005f448c1de107332cf5fbe9e28d236.tar.bz2
gentoo-5ae527ccb005f448c1de107332cf5fbe9e28d236.zip
media-libs/libdvbcsa: keyword 1.1.0-r1 for ~ppc64
Bug: https://bugs.gentoo.org/773100 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'media-libs/libdvbcsa')
-rw-r--r--media-libs/libdvbcsa/files/altivec.patch33
-rw-r--r--media-libs/libdvbcsa/libdvbcsa-1.1.0-r1.ebuild8
2 files changed, 40 insertions, 1 deletions
diff --git a/media-libs/libdvbcsa/files/altivec.patch b/media-libs/libdvbcsa/files/altivec.patch
new file mode 100644
index 000000000000..3605c146a794
--- /dev/null
+++ b/media-libs/libdvbcsa/files/altivec.patch
@@ -0,0 +1,33 @@
+Fix compile on powerpc64/powerpc64le w/ altivec
+
+Correct the type of some vectors passed to vec_slo() or vec_sro(), which only
+takes a char vector.
+
+Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
+
+--- a/src/dvbcsa_bs_altivec.h 2016-11-28 14:33:34.410021500 +1100
++++ b/src/dvbcsa_bs_altivec.h 2016-11-28 14:34:25.442238715 +1100
+@@ -64,7 +64,7 @@
+ }
+ case 0x29: {
+ dvbcsa_bs_word_t x = vec_splat_u8(10);
+- return (dvbcsa_bs_word_t)vec_add(vec_splat_u8(0x1),vec_rl(x,x));
++ return (dvbcsa_bs_word_t)vec_add((dvbcsa_bs_word_t)vec_splat_u8(0x1),vec_rl(x,x));
+ }
+ case 0x40: {
+ dvbcsa_bs_word_t x = vec_splat_u8(4);
+@@ -99,10 +99,10 @@
+ #define SHVAL_14 BS_VAL8(0e)
+ #define SHVAL_7 BS_VAL8(07)
+
+-#define BS_SHL(a, n) ({ dvbcsa_bs_word_t x = SHVAL_##n; vec_sll(vec_slo((a), x), x); })
+-#define BS_SHR(a, n) ({ dvbcsa_bs_word_t x = SHVAL_##n; vec_srl(vec_sro((a), x), x); })
+-#define BS_SHL8(a, n) ({ dvbcsa_bs_word_t x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_slo((a), x); })
+-#define BS_SHR8(a, n) ({ dvbcsa_bs_word_t x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_sro((a), x); })
++#define BS_SHL(a, n) ({ vector unsigned char x = SHVAL_##n; vec_sll(vec_slo((a), x), x); })
++#define BS_SHR(a, n) ({ vector unsigned char x = SHVAL_##n; vec_srl(vec_sro((a), x), x); })
++#define BS_SHL8(a, n) ({ vector unsigned char x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_slo((a), x); })
++#define BS_SHR8(a, n) ({ vector unsigned char x = vec_splat_u8(n*2); x = vec_add(x,x); x = vec_add(x,x); vec_sro((a), x); })
+
+ #define BS_EXTRACT8(a, n) ((uint8_t*)&(a))[15 - (n)]
+
diff --git a/media-libs/libdvbcsa/libdvbcsa-1.1.0-r1.ebuild b/media-libs/libdvbcsa/libdvbcsa-1.1.0-r1.ebuild
index 7b7b9c47a784..f70902b72e2d 100644
--- a/media-libs/libdvbcsa/libdvbcsa-1.1.0-r1.ebuild
+++ b/media-libs/libdvbcsa/libdvbcsa-1.1.0-r1.ebuild
@@ -3,16 +3,22 @@
EAPI=7
+inherit flag-o-matic
+
DESCRIPTION="Free implementation of the DVB Common Scrambling Algorithm - DVB/CSA"
HOMEPAGE="https://www.videolan.org/developers/libdvbcsa.html"
SRC_URI="https://download.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 x86"
+KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86"
IUSE="cpu_flags_ppc_altivec cpu_flags_x86_mmx cpu_flags_x86_sse2 debug"
+# https://github.com/buildroot/buildroot/blob/master/package/libdvbcsa/
+PATCHES=( "${FILESDIR}/altivec.patch" )
+
src_configure() {
+ use cpu_flags_ppc_altivec && append-cflags '-flax-vector-conversions' # needed for altivec.patch
local myeconfargs=(
--disable-static
$(use_enable cpu_flags_ppc_altivec altivec)