From 3f6e0a87f11286a4b7a7bf5f291b8229cf59b758 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Sat, 17 Jan 2015 19:32:34 +0100 Subject: [PATCH] Add RetroArch recipe --- .../patches/retroarch-1.0.0.3_beta.patchset | 35 ++++++++ .../retroarch/retroarch-1.0.0.3_beta.recipe | 81 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 games-emulation/retroarch/patches/retroarch-1.0.0.3_beta.patchset create mode 100644 games-emulation/retroarch/retroarch-1.0.0.3_beta.recipe diff --git a/games-emulation/retroarch/patches/retroarch-1.0.0.3_beta.patchset b/games-emulation/retroarch/patches/retroarch-1.0.0.3_beta.patchset new file mode 100644 index 000000000..33669b03f --- /dev/null +++ b/games-emulation/retroarch/patches/retroarch-1.0.0.3_beta.patchset @@ -0,0 +1,35 @@ +From 4a135acf9cafd827f1a59ecdf268253848ca80b7 Mon Sep 17 00:00:00 2001 +From: Puck Meerburg +Date: Sat, 17 Jan 2015 18:58:21 +0100 +Subject: FFMPEG record driver: Fix Haiku build + + +diff --git a/record/ffmpeg.c b/record/ffmpeg.c +index f0099e0..6f17aa4 100644 +--- a/record/ffmpeg.c ++++ b/record/ffmpeg.c +@@ -27,7 +27,9 @@ extern "C" { + #include + #include + #include ++#ifndef __HAIKU__ + #include ++#endif + #include + #ifdef HAVE_AV_CHANNEL_LAYOUT + #include +@@ -56,7 +58,10 @@ extern "C" { + #include + #endif + +-#if LIBAVUTIL_VERSION_INT <= AV_VERSION_INT(52, 9, 0) ++#if defined(__HAIKU__) ++#define av_frame_alloc avcodec_alloc_frame ++#define av_frame_free av_free ++#elif LIBAVUTIL_VERSION_INT <= AV_VERSION_INT(52, 9, 0) + #define av_frame_alloc avcodec_alloc_frame + #define av_frame_free avcodec_free_frame + #endif +-- +1.8.3.4 + diff --git a/games-emulation/retroarch/retroarch-1.0.0.3_beta.recipe b/games-emulation/retroarch/retroarch-1.0.0.3_beta.recipe new file mode 100644 index 000000000..6a93f59a2 --- /dev/null +++ b/games-emulation/retroarch/retroarch-1.0.0.3_beta.recipe @@ -0,0 +1,81 @@ +SUMMARY="The reference frontend of libretro" +DESCRIPTION="RetroArch is a frontend for the libretro specification for \ +emulation. Libretro supports easy creation of emulators, but people can also \ +make their own frontends and plug existing emulators. It also supports OpenGL \ +shaders and other cool stuff." +HOMEPAGE="https://libretro.com" +SRC_URI="https://github.com/libretro/RetroArch/archive/1.0.0.3-beta.tar.gz" +CHECKSUM_SHA256="bd5be24d81c214db036b756e222f5a8e5cddd3e1c1a2a98180317673c0ca0cc7" +SOURCE_DIR="RetroArch-1.0.0.3-beta" +REVISION="1" +LICENSE="GNU GPL v3" +COPYRIGHT="2010-2015 The RetroArch Team" +PATCHES="retroarch-1.0.0.3_beta.patchset" + +ARCHITECTURES="?x86 ?x86_64" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +else + ARCHITECTURES="$ARCHITECTURES !x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + retroarch$secondaryArchSuffix = $portVersion + app:retroarch$secondaryArchSuffix = $portVersion + cmd:retroarch$secondaryArchSuffix = $portVersion + cmd:retroarch_joyconfig$secondaryArchSuffix = $portVersion + " +PROVIDES_devel=" + retroarch${secondaryArchSuffix}_devel = $portVersion + devel:retroarch$secondaryArchSuffix = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix + lib:libsdl2$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + ffmpeg$secondaryArchSuffix + " +REQUIRES_devel=" + haiku${secondaryArchSuffix}_devel + retroarch$secondaryArchSuffix == $portVersion base + ffmpeg${secondaryArchSuffix}_devel + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libsdl2$secondaryArchSuffix + devel:libgl$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:make + cmd:which + cmd:pkg_config$secondaryArchSuffix + cmd:gcc$secondaryArchSuffix + " + +BUILD() +{ + ./configure + make $jobArgs +} + +INSTALL() +{ + mkdir -p $appsDir/RetroArch + mkdir -p $binDir + mkdir -p $includeDir + + cp retroarch $appsDir/RetroArch + cp tools/retroarch-joyconfig $appsDir/RetroArch + + symlinkRelative -s $appsDir/RetroArch/* $binDir + addAppDeskbarSymlink $appsDir/RetroArch/retroarch RetroArch + + cp libretro.h $includeDir + packageEntries devel \ + $developDir +}