diff --git a/media-libs/libsdl2/libsdl2-2.0.4.recipe b/media-libs/libsdl2/libsdl2-2.0.4.recipe index 1ab1db353..ca6f62b4a 100644 --- a/media-libs/libsdl2/libsdl2-2.0.4.recipe +++ b/media-libs/libsdl2/libsdl2-2.0.4.recipe @@ -6,7 +6,7 @@ software, emulators, and popular games." HOMEPAGE="http://www.libsdl.org/" COPYRIGHT="1997-2014 Sam Lantinga" LICENSE="Zlib" -REVISION="1" +REVISION="2" SOURCE_URI="http://www.libsdl.org/release/SDL2-$portVersion.tar.gz" CHECKSUM_SHA256="da55e540bf6331824153805d58b590a29c39d2d506c6d02fa409aedeab21174b" SOURCE_DIR="SDL2-$portVersion" diff --git a/media-libs/libsdl2/patches/libsdl2-2.0.4.patchset b/media-libs/libsdl2/patches/libsdl2-2.0.4.patchset index 43326eca1..77ec90901 100644 --- a/media-libs/libsdl2/patches/libsdl2-2.0.4.patchset +++ b/media-libs/libsdl2/patches/libsdl2-2.0.4.patchset @@ -212,3 +212,55 @@ index 47186d6..5fcfeec 100644 -- 2.2.2 + +From c69f84542f84c2a40dd811c6524fa862fefff276 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Mon, 11 Jul 2016 15:39:01 +0200 +Subject: Try to find correct application signature from app resources + +Instead of always hardcoding application/x-SDL-executable. + +diff --git a/src/main/haiku/SDL_BeApp.cc b/src/main/haiku/SDL_BeApp.cc +index 36c2a1a..4676c58 100644 +--- a/src/main/haiku/SDL_BeApp.cc ++++ b/src/main/haiku/SDL_BeApp.cc +@@ -25,8 +25,10 @@ + /* Handle the BeApp specific portions of the application */ + + #include ++#include + #include + #include ++#include + #include + + #include "SDL_BApp.h" /* SDL_BApp class definition */ +@@ -49,7 +51,24 @@ StartBeApp(void *unused) + { + BApplication *App; + +- App = new SDL_BApp("application/x-SDL-executable"); ++ // default application signature ++ const char *signature = "application/x-SDL-executable"; ++ // dig resources for correct signature ++ image_info info; ++ int32 cookie = 0; ++ if (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) { ++ BFile f(info.name, O_RDONLY); ++ if (f.InitCheck() == B_OK) { ++ BAppFileInfo app_info(&f); ++ if (app_info.InitCheck() == B_OK) { ++ char sig[B_MIME_TYPE_LENGTH]; ++ if (app_info.GetSignature(sig) == B_OK) ++ signature = strndup(sig, B_MIME_TYPE_LENGTH); ++ } ++ } ++ } ++ ++ App = new BApplication(signature); + + App->Run(); + delete App; +-- +2.8.0 +