[arch-commits] Commit in ppsspp/trunk (3 files)
Bartłomiej Piotrowski
bpiotrowski at archlinux.org
Fri Nov 7 12:44:38 UTC 2014
Date: Friday, November 7, 2014 @ 13:44:38
Author: bpiotrowski
Revision: 122156
upgpkg: ppsspp 0.9.9.1-3
add patches to make use of system ffmpeg
Added:
ppsspp/trunk/ppsspp-0.9.9.1-ffmpeg2.2.patch
ppsspp/trunk/ppsspp-0.9.9.1-shared-ffmpeg.patch
Modified:
ppsspp/trunk/PKGBUILD
------------------------------------+
PKGBUILD | 15 ++
ppsspp-0.9.9.1-ffmpeg2.2.patch | 12 ++
ppsspp-0.9.9.1-shared-ffmpeg.patch | 176 +++++++++++++++++++++++++++++++++++
3 files changed, 199 insertions(+), 4 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2014-11-07 12:28:01 UTC (rev 122155)
+++ PKGBUILD 2014-11-07 12:44:38 UTC (rev 122156)
@@ -3,12 +3,12 @@
pkgname=ppsspp
pkgver=0.9.9.1
-pkgrel=2
+pkgrel=3
pkgdesc='PSP emulator written in C++'
arch=('i686' 'x86_64')
url='http://www.ppsspp.org/'
license=('GPL2')
-depends=('zlib' 'sdl' 'libpng' 'libgl' 'hicolor-icon-theme' 'xdg-utils')
+depends=('zlib' 'sdl' 'libpng' 'libgl' 'hicolor-icon-theme' 'xdg-utils' 'ffmpeg')
makedepends=('git' 'cmake' 'mesa' 'mesa-libgl' 'glu' 'chrpath' 'zlib' 'sdl')
install=ppsspp.install
source=(git://github.com/hrydgard/ppsspp.git#tag=v$pkgver
@@ -15,16 +15,20 @@
git://github.com/hrydgard/native.git#commit=2ba8e36
lang::git://github.com/hrydgard/ppsspp-lang.git#commit=fdc4558
ffmpeg::git://github.com/hrydgard/ppsspp-ffmpeg.git#commit=bc6302be
+ ppsspp-0.9.9.1-shared-ffmpeg.patch
+ ppsspp-0.9.9.1-ffmpeg2.2.patch
ppsspp.desktop)
md5sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
+ 'dbdc26c7ec8d008c7d5240cf06a61016'
+ '1634b48a6f594ad95402d80729dfcbec'
'b70b8b3913079468db3469abeacaa9f6')
prepare() {
- mkdir build{,-qt}
- cd $pkgbase
+ mkdir build
+ cd $pkgname
git submodule init
for submodule in native lang ffmpeg; do
@@ -31,6 +35,9 @@
git config submodule.${submodule}.url "$srcdir"/$submodule
git submodule update $submodule
done
+
+ patch -p1 -i ../ppsspp-0.9.9.1-shared-ffmpeg.patch
+ patch -p1 -i ../ppsspp-0.9.9.1-ffmpeg2.2.patch
}
build() {
Added: ppsspp-0.9.9.1-ffmpeg2.2.patch
===================================================================
--- ppsspp-0.9.9.1-ffmpeg2.2.patch (rev 0)
+++ ppsspp-0.9.9.1-ffmpeg2.2.patch 2014-11-07 12:44:38 UTC (rev 122156)
@@ -0,0 +1,12 @@
+diff -urN ppsspp-0.9.9.1/Core/HW/SimpleAudioDec.cpp ppsspp-0.9.9.1-patched/Core/HW/SimpleAudioDec.cpp
+--- ppsspp-0.9.9.1/Core/HW/SimpleAudioDec.cpp 2014-08-19 07:35:25.000000000 +1100
++++ ppsspp-0.9.9.1-patched/Core/HW/SimpleAudioDec.cpp 2014-11-02 20:37:58.000000000 +1000
+@@ -94,6 +94,8 @@
+ }
+ codecCtx_->channels = channels_;
+ codecCtx_->channel_layout = channels_ == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
++ if (!codecCtx_->block_align)
++ codecCtx_->block_align = sample_rate_;
+ codecCtx_->sample_rate = sample_rate_;
+ OpenCodec();
+ #endif // USE_FFMPEG
Added: ppsspp-0.9.9.1-shared-ffmpeg.patch
===================================================================
--- ppsspp-0.9.9.1-shared-ffmpeg.patch (rev 0)
+++ ppsspp-0.9.9.1-shared-ffmpeg.patch 2014-11-07 12:44:38 UTC (rev 122156)
@@ -0,0 +1,176 @@
+diff -urN ppsspp-0.9.9/CMakeLists.txt ppsspp-0.9.9-patched/CMakeLists.txt
+--- ppsspp-0.9.9/CMakeLists.txt 2014-07-23 01:14:59.000000000 +1100
++++ ppsspp-0.9.9-patched/CMakeLists.txt 2014-07-23 18:38:20.695717128 +1100
+@@ -374,138 +374,19 @@
+ native/ext/stb_vorbis/stb_vorbis.h)
+ include_directories(native/ext/stb_vorbis)
+
+-if(USE_FFMPEG AND NOT DEFINED FFMPEG_BUILDDIR)
+- if(ANDROID)
+- if(ARMV7)
+- set(PLATFORM_ARCH "android/armv7")
+- elseif(ARM)
+- set(PLATFORM_ARCH "android/arm")
+- elseif(X86)
+- set(PLATFORM_ARCH "android/x86")
+- endif()
+- elseif(BLACKBERRY)
+- set(PLATFORM_ARCH "blackberry/armv7")
+- elseif(IOS)
+- set(PLATFORM_ARCH "ios/universal")
+- elseif(MACOSX)
+- set(PLATFORM_ARCH "macosx/x86_64")
+- elseif(LINUX)
+- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+- set(PLATFORM_ARCH "linux/x86_64")
+- else()
+- set(PLATFORM_ARCH "linux/x86")
+- endif()
+- endif()
+- # Using static libraries
+- if (DEFINED PLATFORM_ARCH)
+- include_directories(ffmpeg/${PLATFORM_ARCH}/include)
+- link_directories(ffmpeg/${PLATFORM_ARCH}/lib)
+- set(FFMPEG_LIBRARIES libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a)
+- else()
+- # Manual definition of system library locations by the user.
+- if (DEFINED FFMPEG_INCLUDE_PATH)
+- include_directories(ffmpeg ${FFMPEG_INCLUDE_PATH})
+- endif()
+- if (DEFINED AVFORMAT_PATH)
+- add_library(libavformat STATIC IMPORTED)
+- set_target_properties(libavformat PROPERTIES IMPORTED_LOCATION ${AVFORMAT_PATH})
+- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libavformat)
+- endif()
+- if (DEFINED AVCODEC_PATH)
+- add_library(libavcodec STATIC IMPORTED)
+- set_target_properties(libavcodec PROPERTIES IMPORTED_LOCATION ${AVCODEC_PATH})
+- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libavcodec)
+- endif()
+- if (DEFINED AVUTIL_PATH)
+- add_library(libavutil STATIC IMPORTED)
+- set_target_properties(libavutil PROPERTIES IMPORTED_LOCATION ${AVUTIL_PATH})
+- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libavutil)
+- endif()
+- if (DEFINED SWRESAMPLE_PATH)
+- add_library(libswresample STATIC IMPORTED)
+- set_target_properties(libswresample PROPERTIES IMPORTED_LOCATION ${SWRESAMPLE_PATH})
+- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libswresample)
+- endif()
+- if (DEFINED SWSCALE_PATH)
+- add_library(libswscale STATIC IMPORTED)
+- set_target_properties(libswscale PROPERTIES IMPORTED_LOCATION ${SWSCALE_PATH})
+- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libswscale)
+- endif()
+- endif(DEFINED PLATFORM_ARCH)
+-endif(USE_FFMPEG AND NOT DEFINED FFMPEG_BUILDDIR)
+-
+ if(USE_FFMPEG)
+- # Using shared libraries
+- if(DEFINED FFMPEG_BUILDDIR)
+- include_directories(ffmpeg ${FFMPEG_BUILDDIR})
+-
+- add_library(libavformat STATIC IMPORTED)
+- set_target_properties(libavformat PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libavformat/libavformat.a)
+- add_library(libavcodec STATIC IMPORTED)
+- set_target_properties(libavcodec PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libavcodec/libavcodec.a)
+- add_library(libavutil STATIC IMPORTED)
+- set_target_properties(libavutil PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libavutil/libavutil.a)
+- add_library(libswresample STATIC IMPORTED)
+- set_target_properties(libswresample PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libswresample/libswresample.a)
+- add_library(libswscale STATIC IMPORTED)
+- set_target_properties(libswscale PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libswscale/libswscale.a)
+-
+- SET (FFMPEG_LIBRARIES
+- libavformat
+- libavcodec
+- libavutil
+- libswresample
+- libswscale
+- )
+- endif()
+-
+- if(APPLE OR BLACKBERRY)
+- set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} iconv)
+- endif()
+-
+- if(APPLE)
+- set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} bz2 "-framework CoreVideo")
+- if (NOT IOS)
+- set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} "-framework VideoDecodeAcceleration")
+- endif()
+- endif(APPLE)
+-
+- set(LinkCommon ${LinkCommon} ${FFMPEG_LIBRARIES})
++ SET (FFMPEG_LIBRARIES
++ avformat
++ avcodec
++ avutil
++ swresample
++ swscale
++ )
++ set(nativeExtraLibs ${nativeExtraLibs} ${FFMPEG_LIBRARIES})
++ target_link_libraries(Common ${FFMPEG_LIBRARIES})
+ add_definitions(-DUSE_FFMPEG)
+ endif(USE_FFMPEG)
+
+-# Modification to show where we are pulling the ffmpeg libraries from.
+-if(USE_FFMPEG AND DEFINED FFMPEG_LIBRARIES)
+- target_link_libraries(Common ${FFMPEG_LIBRARIES})
+- message(STATUS "FFMPEG library locations:")
+- if(DEFINED PLATFORM_ARCH)
+- set(TEMP ${CMAKE_SOURCE_DIR}/ffmpeg/${PLATFORM_ARCH}/lib)
+- message(STATUS "libavcodec location: ${TEMP}/libavcodec.a")
+- message(STATUS "libavformat location: ${TEMP}/libavformat.a")
+- message(STATUS "libavutil location: ${TEMP}/libavutil.a")
+- message(STATUS "libswresample location: ${TEMP}/libswresample.a")
+- message(STATUS "libswscale location: ${TEMP}/libswscale.a")
+- else()
+- get_target_property(TEMP libavcodec IMPORTED_LOCATION)
+- message(STATUS "libavcodec location: ${TEMP}")
+- get_target_property(TEMP libavformat IMPORTED_LOCATION)
+- message(STATUS "libavformat location: ${TEMP}")
+- get_target_property(TEMP libavutil IMPORTED_LOCATION)
+- message(STATUS "libavutil location: ${TEMP}")
+- get_target_property(TEMP libswresample IMPORTED_LOCATION)
+- message(STATUS "libswresample location: ${TEMP}")
+- get_target_property(TEMP libswscale IMPORTED_LOCATION)
+- message(STATUS "libswscale location: ${TEMP}")
+- endif(DEFINED PLATFORM_ARCH)
+-else()
+- message(STATUS "ERROR: No FFMPEG library locations")
+-endif()
+-
+-if(USE_FFMPEG AND NOT DEFINED FFMPEG_LIBRARIES)
+- message(WARNING "FFMPEG_BUILDDIR variable or manual path definition is required to enable FFmpeg. Disabling it.")
+- unset(USE_FFMPEG)
+-endif()
+-
+ find_package(ZLIB)
+ if(ZLIB_FOUND)
+ include_directories(${ZLIB_INCLUDE_DIR})
+diff -urN ppsspp-0.9.9/Core/HW/MediaEngine.h ppsspp-0.9.9-patched/Core/HW/MediaEngine.h
+--- ppsspp-0.9.9/Core/HW/MediaEngine.h 2014-07-23 01:14:59.000000000 +1100
++++ ppsspp-0.9.9-patched/Core/HW/MediaEngine.h 2014-07-23 18:36:01.267334510 +1100
+@@ -34,9 +34,20 @@
+ class SimpleAudio;
+
+ #ifdef USE_FFMPEG
++extern "C" {
++#include <libavformat/avformat.h>
++}
++#ifndef AVPixelFormat
++#define AVPixelFormat PixelFormat
++#define AV_PIX_FMT_BGR565LE PIX_FMT_BGR565LE
++#define AV_PIX_FMT_BGR555LE PIX_FMT_BGR555LE
++#define AV_PIX_FMT_BGR444LE PIX_FMT_BGR444LE
++#define AV_PIX_FMT_RGBA PIX_FMT_RGBA
++#endif
++
+ struct SwsContext;
+ struct AVFrame;
+-struct AVIOContext;
++//struct AVIOContext;
+ struct AVFormatContext;
+ struct AVCodecContext;
+ #endif
More information about the arch-commits
mailing list