diff --git a/dev-games/mygui/additional-files/font_editor.rdef.in b/dev-games/mygui/additional-files/font_editor.rdef.in new file mode 100644 index 000000000..c7eea2b15 --- /dev/null +++ b/dev-games/mygui/additional-files/font_editor.rdef.in @@ -0,0 +1,24 @@ +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "MyGUI: FontEditor", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon array { + $"6E63696602036976E90501010613EE8EB3BB3C28273A28B9ACB616C10BB64956" + $"25552DC859B68D543454374532C3F1BA75BF5EB9DC3937404040BE5F40444048" + $"4844C308C02DC2D5C291464C4048444ABE93C2593646354EBB76C2E3BB44C7DD" + $"395E272A4CB6C8C755B723C26A2A3DB6E4C100B72BB987020A010100123FB17B" + $"0000000000003F9E7942EB744030C101178810040A000100023FB17B00000000" + $"00003F9E7942EB744030C1" +}; diff --git a/dev-games/mygui/additional-files/image_editor.rdef.in b/dev-games/mygui/additional-files/image_editor.rdef.in new file mode 100644 index 000000000..d598566bd --- /dev/null +++ b/dev-games/mygui/additional-files/image_editor.rdef.in @@ -0,0 +1,21 @@ +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "MyGUI: ImageEditor", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon array { + $"6E63696602036976E90501010606BE0C29273A2736273A27384038BD4F38473B" + $"5D292B402B482BBDB7020A010100123FB17B0000000000003FC3D4477ADDBC7F" + $"6401178810040A000100023FB17B0000000000003FC3D4477ADDBC7F64" +}; diff --git a/dev-games/mygui/additional-files/layout_editor.rdef.in b/dev-games/mygui/additional-files/layout_editor.rdef.in new file mode 100644 index 000000000..79b2aa616 --- /dev/null +++ b/dev-games/mygui/additional-files/layout_editor.rdef.in @@ -0,0 +1,23 @@ +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "MyGUI: LayoutEditor", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon array { + $"6E63696602036976E9050101060CEEEEF228273A28B9ACB616C10BB649562555" + $"2DC863B68F543353384534C3F1BB41BF5EBAA838323644BBDCBEE7BBAAC3E139" + $"5E272A4CB6C8C755B723C26A2A3DB6E4C100B72BB987020A010100123FB17B00" + $"0000000000BF9C2342EB744BE5F801178810040A000100023FB17B0000000000" + $"00BF9C2342EB744BE5F8" +}; diff --git a/dev-games/mygui/additional-files/skin_editor.rdef.in b/dev-games/mygui/additional-files/skin_editor.rdef.in new file mode 100644 index 000000000..5f4508428 --- /dev/null +++ b/dev-games/mygui/additional-files/skin_editor.rdef.in @@ -0,0 +1,22 @@ +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "MyGUI: SkinEditor", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon array { + $"6E63696602036976E9050101060AFAEB0F4E2D4A343333BBBEB547313C50544E" + $"39C681CCE2345EBE5CCCEF295A24522A4B4351BF3BCAA248452735B600BE8C26" + $"263C24BBBEB45F4725020A010100123FB17B0000000000003F9E7945F5BA4218" + $"6001178810040A000100023FB17B0000000000003F9E7945F5BA421860" +}; diff --git a/dev-games/mygui/mygui-3.2.3~git.recipe b/dev-games/mygui/mygui-3.2.3~git.recipe new file mode 100644 index 000000000..e5afad0a4 --- /dev/null +++ b/dev-games/mygui/mygui-3.2.3~git.recipe @@ -0,0 +1,181 @@ +SUMMARY="A library for creating GUIs for games" +DESCRIPTION="MyGUI is a library for creating Graphical User Interfaces (GUIs) for \ +games and 3D applications. The main goals of mygui are: speed, flexibility and easy \ +of use. Speed We speed up our system by using our own batching subsystem which \ +combines geometry. It is also possible for the more experienced developers to \ +write their own render system or new subsystems Flexibility The library supports \ +plugins that allows you to create dynamically loaded custom controls or subsystems. \ +Most subsystems are expandable with plugins without the need to touch the core code. \ +All resources and settings are described in XML files. It is possible to load \ +resources like fonts, cursors, images, skins, etc. Forms (layouts) via dynamically \ +by using XML files. Simplicity The user interface is easy to use and uses delegates \ +(Signals and slots) for easy to use event handling." +HOMEPAGE="http://mygui.info/" +COPYRIGHT="Albert Semenov + George Evmenov" +LICENSE="MIT" +REVISION="1" +srcGitRev="a021cc7e70b143c46688fcf29a0379571203beb4" +SOURCE_URI="https://github.com/MyGUI/mygui/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="4dfc6b696c834c0da1cf6d1f84b3e36c96e2873c69312ba4a2ada50e9cc6caa0" +SOURCE_FILENAME="MyGUI-$srcGitRev.tar.gz" +SOURCE_DIR="mygui-$srcGitRev" +PATCHES="mygui-$portVersion.patchset" +ADDITIONAL_FILES=" + skin_editor.rdef.in + layout_editor.rdef.in + image_editor.rdef.in + font_editor.rdef.in + " + +ARCHITECTURES="x86_gcc2 x86_64" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + mygui$secondaryArchSuffix = $portVersion compat >= 3 + lib:libMyGUIEngine$secondaryArchSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libglew$secondaryArchSuffix + lib:libGLU$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_image_2.0$secondaryArchSuffix + " + +PROVIDES_devel=" + mygui${secondaryArchSuffix}_devel = $portVersion + devel:libmygui.openglplatform$secondaryArchSuffix = $portVersion + devel:libmyguiengine$secondaryArchSuffix = $portVersion + " +REQUIRES_devel=" + mygui$secondaryArchSuffix == $portVersion base + haiku$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libglew$secondaryArchSuffix + lib:libGLU$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_image_2.0$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libfreetype$secondaryArchSuffix + devel:libGL$secondaryArchSuffix + devel:libglew$secondaryArchSuffix + devel:libGLU$secondaryArchSuffix + devel:libSDL2_2.0$secondaryArchSuffix + devel:libSDL2_image_2.0$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +BUILD() +{ + mkdir -p build && cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$prefix \ + -DMYGUI_RENDERSYSTEM=4 \ + -DMYGUI_SAMPLES_INPUT=4 \ + -DMYGUI_BUILD_TOOLS=TRUE \ + -DMYGUI_BUILD_DEMOS=FALSE \ + -DMYGUI_DISABLE_PLUGINS=FALSE \ + -DMYGUI_INSTALL_TOOLS=TRUE \ + -DMYGUI_INSTALL_MEDIA=TRUE \ + -DMYGUI_USE_SYSTEM_GLEW=TRUE + make $jobArgs +} + +INSTALL() +{ + cd build + make install + + mkdir -p $includeDir + mv $prefix/include/MYGUI $includeDir + + rm -rf $prefix/{include,lib} + + mkdir -p $libDir $developLibDir + + cp lib/libMyGUI.OpenGLPlatform.a $developLibDir + cp lib/libMyGUIEngine.* $libDir + cp -r pkgconfig $libDir + + mkdir -p $appsDir/MyGUI/lib + cp lib/libEditorFramework.so $appsDir/MyGUI/lib + cp bin/Plugin_StrangeButton.so $appsDir/MyGUI/lib + cp bin/*Editor $appsDir/MyGUI + cp bin/resources.xml $appsDir/MyGUI + rm -rf $prefix/bin + + fixPkgconfig + + sed -i "s|libdir=.*|libdir=$developLibDir|" $developLibDir/pkgconfig/MYGUI.pc + sed -i "s|includedir=.*|includedir=$includeDir|" $developLibDir/pkgconfig/MYGUI.pc + + mkdir -p ${dataDir}/deskbar/menu/Applications/MyGUI + + local APP_SIGNATURE="application/x-vnd.mygui-font-editor" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3 | cut -d~ -f1`" + local LONG_INFO="$SUMMARY" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/font_editor.rdef.in > $sourceDir/build/font_editor.rdef + addResourcesToBinaries $sourceDir/build/font_editor.rdef $appsDir/MyGUI/FontEditor + addAppDeskbarSymlink $appsDir/MyGUI/FontEditor "MyGUI/Font Editor" + + local APP_SIGNATURE="application/x-vnd.mygui-image-editor" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/image_editor.rdef.in > $sourceDir/build/image_editor.rdef + addResourcesToBinaries $sourceDir/build/image_editor.rdef $appsDir/MyGUI/ImageEditor + addAppDeskbarSymlink $appsDir/MyGUI/ImageEditor "MyGUI/Image Editor" + + local APP_SIGNATURE="application/x-vnd.mygui-layout-editor" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/layout_editor.rdef.in > $sourceDir/build/layout_editor.rdef + addResourcesToBinaries $sourceDir/build/layout_editor.rdef $appsDir/MyGUI/LayoutEditor + addAppDeskbarSymlink $appsDir/MyGUI/LayoutEditor "MyGUI/Layout Editor" + + local APP_SIGNATURE="application/x-vnd.mygui-skin-editor" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/skin_editor.rdef.in > $sourceDir/build/skin_editor.rdef + addResourcesToBinaries $sourceDir/build/skin_editor.rdef $appsDir/MyGUI/SkinEditor + addAppDeskbarSymlink $appsDir/MyGUI/SkinEditor "MyGUI/Skin Editor" + + prepareInstalledDevelLib libMyGUIEngine + + packageEntries devel \ + $appsDir \ + $dataDir \ + $developDir +} diff --git a/dev-games/mygui/patches/mygui-3.2.3~git.patchset b/dev-games/mygui/patches/mygui-3.2.3~git.patchset new file mode 100644 index 000000000..6c81c4e6a --- /dev/null +++ b/dev-games/mygui/patches/mygui-3.2.3~git.patchset @@ -0,0 +1,116 @@ +From 40640b29115eac5339721a78654e245278028339 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 4 Oct 2018 19:55:34 +1000 +Subject: Fix data dir for Haiku + + +diff --git a/Media/CMakeLists.txt b/Media/CMakeLists.txt +index c644ed1..41172f3 100644 +--- a/Media/CMakeLists.txt ++++ b/Media/CMakeLists.txt +@@ -5,6 +5,8 @@ + # Set media target directory + if (WIN32) + set(MYGUI_MEDIA_PATH "Media") ++elseif (HAIKU) ++ set(MYGUI_MEDIA_PATH "data/MYGUI/Media") + elseif (UNIX) + set(MYGUI_MEDIA_PATH "share/MYGUI/Media") + elseif (APPLE) +-- +2.19.0 + + +From aa46ff1e95801bcfee50e052c82220ca8866ae3d Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 4 Oct 2018 20:54:38 +1000 +Subject: Fix resource path + + +diff --git a/CMake/InstallResources.cmake b/CMake/InstallResources.cmake +index 47f28f1..c771423 100644 +--- a/CMake/InstallResources.cmake ++++ b/CMake/InstallResources.cmake +@@ -45,6 +45,8 @@ endif () + if (MYGUI_INSTALL_SAMPLES OR MYGUI_INSTALL_TOOLS) + if (WIN32) + set(MYGUI_MEDIA_DIR "../../Media") ++ elseif (HAIKU) ++ set(MYGUI_MEDIA_DIR "/system/data/MYGUI/Media") + elseif (UNIX) + set(MYGUI_MEDIA_DIR "../share/MYGUI/Media") + else () +-- +2.19.0 + + +From 9f39d1b46430ac7d0750779c9f5d8f83d611b56e Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 4 Oct 2018 20:54:56 +1000 +Subject: Fix crash + + +diff --git a/Common/FileSystemInfo/FileSystemInfo.h b/Common/FileSystemInfo/FileSystemInfo.h +index f1324cb..be25f24 100644 +--- a/Common/FileSystemInfo/FileSystemInfo.h ++++ b/Common/FileSystemInfo/FileSystemInfo.h +@@ -39,9 +39,14 @@ namespace common + { + std::wstring result; + result.resize(_input.size()); ++#ifndef __HAIKU__ + static std::locale sLocale(""); + for (unsigned int i=0; i<_input.size(); ++i) + result[i] = std::tolower(_input[i], sLocale); ++#else ++ for (unsigned int i=0; i<_input.size(); ++i) ++ result[i] = std::tolower(_input[i]); ++#endif + return result; + } + +-- +2.19.0 + + +From 8627190f4cbc8f0c1bb27b193fe0110c92e6fbb5 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 4 Oct 2018 22:00:45 +1000 +Subject: Set app dir + + +diff --git a/Common/Base/Main.h b/Common/Base/Main.h +index 426ba4d..6a20e86 100644 +--- a/Common/Base/Main.h ++++ b/Common/Base/Main.h +@@ -15,6 +15,9 @@ + #include + #include + #endif ++#ifdef __HAIKU__ ++#include ++#endif + + #if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32 + # ifdef MYGUI_CHECK_MEMORY_LEAKS +@@ -22,6 +25,17 @@ + # else + # define MYGUI_APP(cls) INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT argc) { return startApp(); } + # endif ++#elif defined(__HAIKU__) ++# define MYGUI_APP(cls) \ ++ int main(int argc, char **argv) \ ++ { \ ++ char *ptr; \ ++ if(ptr = strrchr(argv[0], '/')) { \ ++ *ptr = '\0'; \ ++ chdir(argv[0]); \ ++ } \ ++ return startApp(); \ ++ } + #else + # define MYGUI_APP(cls) int main(int argc, char **argv) { return startApp(); } + #endif +-- +2.19.0 +