summaryrefslogtreecommitdiff
path: root/user/libmpeg2
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-21 03:14:35 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-21 03:14:35 -0500
commitce782318ca2fe30d0157903314b64d01425874b0 (patch)
treef2e614319e93ab883ce6b775cc8f0f913dea9a56 /user/libmpeg2
parent41328727953b445d8504cb6e81aaaf5093bcc084 (diff)
downloadpackages-ce782318ca2fe30d0157903314b64d01425874b0.tar.gz
packages-ce782318ca2fe30d0157903314b64d01425874b0.tar.bz2
packages-ce782318ca2fe30d0157903314b64d01425874b0.tar.xz
packages-ce782318ca2fe30d0157903314b64d01425874b0.zip
user/libmpeg2: pull in, fix license, modernise
Diffstat (limited to 'user/libmpeg2')
-rw-r--r--user/libmpeg2/APKBUILD53
-rw-r--r--user/libmpeg2/arm-private-symbols.patch44
-rw-r--r--user/libmpeg2/arm-textrel.patch101
3 files changed, 198 insertions, 0 deletions
diff --git a/user/libmpeg2/APKBUILD b/user/libmpeg2/APKBUILD
new file mode 100644
index 000000000..f72f51e93
--- /dev/null
+++ b/user/libmpeg2/APKBUILD
@@ -0,0 +1,53 @@
+# Maintainer:
+pkgname=libmpeg2
+pkgver=0.5.1
+pkgrel=9
+pkgdesc="Library for decoding MPEG-1 and MPEG-2 video streams"
+url="http://libmpeg2.sourceforge.net/"
+arch="all"
+license="GPL-2.0+ AND LGPL-2.0+"
+subpackages="$pkgname-dev $pkgname-doc mpeg2dec"
+makedepends="libx11-dev libice-dev libsm-dev libxext-dev libxv-dev"
+source="https://distfiles.gentoo.org/distfiles/libmpeg2-$pkgver.tar.gz
+ arm-private-symbols.patch
+ arm-textrel.patch
+ "
+
+prepare() {
+ update_config_sub
+ default_prepare
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --with-pic \
+ --enable-shared \
+ --disable-static
+ make OPT_CFLAGS="${CFLAGS}" \
+ MPEG2DEC_CFLAGS="${CFLAGS}" \
+ LIBMPEG2_CFLAGS=""
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+mpeg2dec() {
+ pkgdesc="MPEG-2 stream decoder from libmpeg2"
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/mpeg2dec "$subpkgdir"/usr/bin/
+}
+
+sha512sums="3648a2b3d7e2056d5adb328acd2fb983a1fa9a05ccb6f9388cc686c819445421811f42e8439418a0491a13080977f074a0d8bf8fa6bc101ff245ddea65a46fbc libmpeg2-0.5.1.tar.gz
+334e4e0b1e2877311503d2907f4f65c26d6a83ee79308c49697b2f3d2b8da9ac665e19ab419d85a944eaa34e1d43f512d1418a372cd444381d66f71df2a92c83 arm-private-symbols.patch
+888b8b4f90ece7f8dcd54895c36e2a93471de167f83cddc67d6943baf9e7ea19abd31ab055f6805629a2e176a1057e18de6a053fdea69cec90483a5165efa9c9 arm-textrel.patch"
diff --git a/user/libmpeg2/arm-private-symbols.patch b/user/libmpeg2/arm-private-symbols.patch
new file mode 100644
index 000000000..222ff9954
--- /dev/null
+++ b/user/libmpeg2/arm-private-symbols.patch
@@ -0,0 +1,44 @@
+Set visibility of global symbols used in ARM specific assembly file to internal
+
+--- a/libmpeg2/motion_comp_arm_s.S
++++ b/libmpeg2/motion_comp_arm_s.S
+@@ -23,7 +23,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_16_arm
++ .global MC_put_o_16_arm
++ .internal MC_put_o_16_arm
+ MC_put_o_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+@@ -83,7 +84,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_8_arm
++ .global MC_put_o_8_arm
++ .internal MC_put_o_8_arm
+ MC_put_o_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+@@ -152,7 +154,8 @@
+ .endm
+
+ .align
+- .global MC_put_x_16_arm
++ .global MC_put_x_16_arm
++ .internal MC_put_x_16_arm
+ MC_put_x_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+@@ -244,7 +247,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_x_8_arm
++ .global MC_put_x_8_arm
++ .internal MC_put_x_8_arm
+ MC_put_x_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
diff --git a/user/libmpeg2/arm-textrel.patch b/user/libmpeg2/arm-textrel.patch
new file mode 100644
index 000000000..0a75cebfb
--- /dev/null
+++ b/user/libmpeg2/arm-textrel.patch
@@ -0,0 +1,101 @@
+--- libmpeg2-0.5.1.orig/libmpeg2/motion_comp_arm_s.S
++++ libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S
+@@ -30,8 +30,8 @@
+ stmfd sp!, {r4-r11, lr} @ R14 is also called LR
+ and r4, r1, #3
+ adr r5, MC_put_o_16_arm_align_jt
+- add r5, r5, r4, lsl #2
+- ldr pc, [r5]
++ ldr r5, [r5, r4, lsl #2]
++ add pc, pc, r5
+
+ MC_put_o_16_arm_align0:
+ ldmia r1, {r4-r7}
+@@ -76,10 +76,10 @@
+ bne 1b
+ ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
+ MC_put_o_16_arm_align_jt:
+- .word MC_put_o_16_arm_align0
+- .word MC_put_o_16_arm_align1
+- .word MC_put_o_16_arm_align2
+- .word MC_put_o_16_arm_align3
++ .word MC_put_o_16_arm_align0-MC_put_o_16_arm_align0-8
++ .word MC_put_o_16_arm_align1-MC_put_o_16_arm_align0-8
++ .word MC_put_o_16_arm_align2-MC_put_o_16_arm_align0-8
++ .word MC_put_o_16_arm_align3-MC_put_o_16_arm_align0-8
+
+ @ ----------------------------------------------------------------
+ .align
+@@ -90,8 +90,8 @@
+ stmfd sp!, {r4-r10, lr} @ R14 is also called LR
+ and r4, r1, #3
+ adr r5, MC_put_o_8_arm_align_jt
+- add r5, r5, r4, lsl #2
+- ldr pc, [r5]
++ ldr r5, [r5, r4, lsl #2]
++ add pc, pc, r5
+ MC_put_o_8_arm_align0:
+ ldmia r1, {r4-r5}
+ add r1, r1, r2
+@@ -134,10 +134,10 @@
+ ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
+
+ MC_put_o_8_arm_align_jt:
+- .word MC_put_o_8_arm_align0
+- .word MC_put_o_8_arm_align1
+- .word MC_put_o_8_arm_align2
+- .word MC_put_o_8_arm_align3
++ .word MC_put_o_8_arm_align0-MC_put_o_8_arm_align0-8
++ .word MC_put_o_8_arm_align1-MC_put_o_8_arm_align0-8
++ .word MC_put_o_8_arm_align2-MC_put_o_8_arm_align0-8
++ .word MC_put_o_8_arm_align3-MC_put_o_8_arm_align0-8
+
+ @ ----------------------------------------------------------------
+ .macro AVG_PW rW1, rW2
+@@ -162,7 +162,8 @@
+ ldr r11, [r5]
+ mvn r12, r11
+ add r5, r5, r4, lsl #2
+- ldr pc, [r5, #4]
++ ldr r5, [r5, #4]
++ add pc, pc, r5
+
+ .macro ADJ_ALIGN_QW shift, R0, R1, R2, R3, R4
+ mov \R0, \R0, lsr #(\shift)
+@@ -237,10 +238,10 @@
+ ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
+ MC_put_x_16_arm_align_jt:
+ .word 0x01010101
+- .word MC_put_x_16_arm_align0
+- .word MC_put_x_16_arm_align1
+- .word MC_put_x_16_arm_align2
+- .word MC_put_x_16_arm_align3
++ .word MC_put_x_16_arm_align0-MC_put_x_16_arm_align0-8
++ .word MC_put_x_16_arm_align1-MC_put_x_16_arm_align0-8
++ .word MC_put_x_16_arm_align2-MC_put_x_16_arm_align0-8
++ .word MC_put_x_16_arm_align3-MC_put_x_16_arm_align0-8
+
+ @ ----------------------------------------------------------------
+ .align
+@@ -254,7 +255,8 @@
+ ldr r11, [r5]
+ mvn r12, r11
+ add r5, r5, r4, lsl #2
+- ldr pc, [r5, #4]
++ ldr r5, [r5, #4]
++ add pc, pc, r5
+
+ .macro ADJ_ALIGN_DW shift, R0, R1, R2
+ mov \R0, \R0, lsr #(\shift)
+@@ -317,7 +319,7 @@
+ ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
+ MC_put_x_8_arm_align_jt:
+ .word 0x01010101
+- .word MC_put_x_8_arm_align0
+- .word MC_put_x_8_arm_align1
+- .word MC_put_x_8_arm_align2
+- .word MC_put_x_8_arm_align3
++ .word MC_put_x_8_arm_align0-MC_put_x_8_arm_align0-8
++ .word MC_put_x_8_arm_align1-MC_put_x_8_arm_align0-8
++ .word MC_put_x_8_arm_align2-MC_put_x_8_arm_align0-8
++ .word MC_put_x_8_arm_align3-MC_put_x_8_arm_align0-8