From 801d30eef82b1c0a3565621f701a30fd8b40befd Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 23 Oct 2011 10:26:52 +0000 Subject: [PATCH] [packages] add libmpeg2 (closes: #8317, thanks to W. Michael Petullo) git-svn-id: svn://svn.openwrt.org/openwrt/packages@28534 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- libs/libmpeg2/Makefile | 60 +++++++++++++++++ .../libmpeg2/patches/101-ppc_no_altivec.patch | 66 +++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 libs/libmpeg2/Makefile create mode 100644 libs/libmpeg2/patches/101-ppc_no_altivec.patch diff --git a/libs/libmpeg2/Makefile b/libs/libmpeg2/Makefile new file mode 100644 index 000000000..9d3c05223 --- /dev/null +++ b/libs/libmpeg2/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libmpeg2 +PKG_VERSION:=0.5.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=libmpeg2-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://libmpeg2.sourceforge.net/files/ +PKG_MD5SUM:=0f92c7454e58379b4a5a378485bbd8ef + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmpeg2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=MPEG-1 & -2 decoding library + URL:=http://libmpeg2.sourceforge.net/ + MAINTAINER:=W. Michael Petullo +endef + +define Package/libmpeg2/decription + Libmpeg2 is a library for decoding MPEG-1 and MPEG-2 video streams +endef + +CONFIGURE_ARGS += \ + --disable-sdl \ + --without-x \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/mpeg2dec \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libmpeg2{,convert}.{a,so*} \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpeg2{,convert}.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmpeg2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libmpeg2{,convert}.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmpeg2)) diff --git a/libs/libmpeg2/patches/101-ppc_no_altivec.patch b/libs/libmpeg2/patches/101-ppc_no_altivec.patch new file mode 100644 index 000000000..49251a098 --- /dev/null +++ b/libs/libmpeg2/patches/101-ppc_no_altivec.patch @@ -0,0 +1,66 @@ +--- a/libmpeg2/motion_comp_altivec.c ++++ b/libmpeg2/motion_comp_altivec.c +@@ -25,6 +25,8 @@ + + #ifdef ARCH_PPC + ++#ifdef __I_WANT_ALTIVEC__ ++ + #ifdef HAVE_ALTIVEC_H + #include + #endif +@@ -1007,4 +1009,6 @@ static void MC_avg_xy_8_altivec (uint8_t + + MPEG2_MC_EXTERN (altivec) + ++#endif /* __I_WANT_ALTIVEC__ */ ++ + #endif +--- a/libmpeg2/idct_altivec.c ++++ b/libmpeg2/idct_altivec.c +@@ -25,6 +25,8 @@ + + #ifdef ARCH_PPC + ++#ifdef __I_WANT_ALTIVEC__ ++ + #ifdef HAVE_ALTIVEC_H + #include + #endif +@@ -283,4 +285,6 @@ void mpeg2_idct_altivec_init (void) + } + } + ++#endif /* __I_WANT_ALTIVEC__ */ ++ + #endif +--- a/libmpeg2/idct.c ++++ b/libmpeg2/idct.c +@@ -251,11 +251,13 @@ void mpeg2_idct_init (uint32_t accel) + } else + #endif + #ifdef ARCH_PPC ++#ifdef __I_WANT_ALTIVEC__ + if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { + mpeg2_idct_copy = mpeg2_idct_copy_altivec; + mpeg2_idct_add = mpeg2_idct_add_altivec; + mpeg2_idct_altivec_init (); + } else ++#endif /* __I_WANT_ALTIVEC__ */ + #endif + #ifdef ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA_MVI) { +--- a/libmpeg2/motion_comp.c ++++ b/libmpeg2/motion_comp.c +@@ -43,9 +43,11 @@ void mpeg2_mc_init (uint32_t accel) + else + #endif + #ifdef ARCH_PPC ++#ifdef __I_WANT_ALTIVEC__ + if (accel & MPEG2_ACCEL_PPC_ALTIVEC) + mpeg2_mc = mpeg2_mc_altivec; + else ++#endif /* __I_WANT_ALTIVEC__ */ + #endif + #ifdef ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA)